Repository navigation
Conversation
Context::get_roc, set_roc, get_index and set_index were private, so a user of the crate could not read a stream's rollover counter or SRTCP index, or restore them in a new context. Pion exports the same four (ROC, SetROC, Index, SetIndex). Document what set_roc and set_index do, and add a test that carries a stream past a rollover over to new contexts.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Target branch:
v0.17.x.rtc-srtpon master has the same four functions private; I can send the same change there.Context::get_roc,set_roc,get_indexandset_indexare private, so a user of the crate cannot read a stream's rollover counter or SRTCP index, or restore them in a new context. Pion exports the same four (ROC,SetROC,Index,SetIndex).I need them to carry SRTP-terminated calls over to a standby process when a SIP B2BUA's active process fails. The keys are not enough: a new context starts at ROC 0, so it stops decrypting a stream once that has rolled over (65,536 packets, about 22 minutes at 50 packets/s). A ROC signalled out of band needs them too.
This makes the four public and documents what
set_rocandset_indexdo. The new testtest_rtp_carried_on_with_set_roccarries a stream past a rollover over to new contexts and checks that they encrypt and decrypt as the old ones.cargo test -p webrtc-srtp: 39 passed.cargo clippy -p webrtc-srtp --all-targets -- -D warnings,cargo fmt --all -- --check: clean. Theopensslfeatures were not built (no OpenSSL headers here); the change does not touch that code.