-
Notifications
You must be signed in to change notification settings - Fork 866
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Should undecryptable packets arrive at the epoll? #2503
Comments
No, that part is only to copy the readiness information that was earlier set through the call to (somewhere from a function in
This looks like that the above call was executed after the decryption failed and the packet was requested to be dropped - that is, the readiness was set even if there was no packet ready to read. We do have unit tests for encryption handling, it's Note that this test checks things in various combinations of encryption settings on both sides together with the value of |
I've modified, well right now it's just a horrible kludge of, the test code you mentioned. I copied the kludge into the 1.4.3 code and the epoll does not report the event. So it looks like something changed between versions. The area around the snippet you posted; i.e. this part (1.5.0):
Putting a breakpoint on that call fires in the test for the 1.5.0 version.
Does not trigger. Perhaps it's related to the determination of the |
In light of the above findings, this is now a suspected regression. Can the label be updated, or should another issue be raised? |
@Chardrazle Could you please share the test you have to reproduce the issue? TODO
|
As mentioned, the test code was hacked just for the specific case. But, FWIW, the attached diff can be applied. It's likely the code (incorrectly) breaks other unit-tests because it was purely based on exercising the D.3 matrix case. We have now moved over to |
I tried this, applied the patch and ran according to the instruction. Is it expected to fail? This is the result with the latest version:
To make sure, I retrtied by installing release from label
It's then quite probable that this problem did exist, but has been fixed in the latest master. Could you try to confirm this, please? |
Yes, I can confirm the same findings as yourself 👍 |
Ok, I'm closing this issue then - there's nothing more to do, and it is still visible as required the 1.5.1 release. |
Just for the record: the #2599 PR has fixed the problem (likely, that is, maybe the fix wasn't exactly intended for this problem, but it did fix it). The change was related to the new receiver buffer logics. With the old receiver buffer logics packets that failed to get decrypted had the encryption flags not cleared and as such the packet didn't constitute any valid data and hence it wasn't also triggering read-readiness. In the new receiver buffer the encryption logics have been taken away and therefore the decryption failure had to be programmed differently - that is, undecrypted packets (after adding to the buffer) had to be removed from the buffer, and not only themselves, but the whole message, if the packet was a part of a message. |
We are currently upgrading from version 1.4.3 to 1.5.0, and just wanted to check if there were any behavioural changes that might explain what we see - before delving deeper into the investigation.
We have some (relatively) simple unit-tests that set up a local sender/receiver. One of those tests is for encryption and has a missing passphrase in the receiver.
In the version 1.4.3 build the packet does not make it past the epoll, but in the 1.5.0 version it does. So an undecryptable packet is presented to the handler.
In both cases the logs can be seen to:
At first this looked like symptoms similar to issue #1977, but that appears to be for earlier versions.
(The
SRTO_ENFORCEDENCRYPTION
is switched off, though.)When trying to identify a difference, a preliminary trace through the code found that the iteration loop in epoll.cpp (~607):
for (CEPollDesc::enotice_t::iterator it = ed.enotice_begin(), it_next = it; it != ed.enotice_end(); it = it_next)
was not entered for the 1.4.3 version, so the
total
counter was not incremented.There is a 'notice' in this container for the 1.5.0 -based build, resulting in a non-zero return.
Of course, this may just be highlighting that we're doing something wrong elsewhere, hence the question rather than issue :)
The text was updated successfully, but these errors were encountered: