-
Notifications
You must be signed in to change notification settings - Fork 131
feat: Data packet cryptor. #191
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
base: m137_release
Are you sure you want to change the base?
Conversation
@@ -753,4 +761,156 @@ uint8_t FrameCryptorTransformer::getIvSize() { | |||
} | |||
} | |||
|
|||
DataPacketCryptor::DataPacketCryptor( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey, I noticed this doesn't use the signalling thread. Will this cause any multi-threading issues with the key provider potentially being used at the same time as frame crypting?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure. The signaling thread in FrameCryptor is actually only used to deliver the onFrameCryptionStateChanged event. Internally, a separate thread ["FrameCryptorTransformer"] is used to encryptFrame/decryptFrame. Unless we use same thread as a worker thread for DataPacketCryptor to avoid keyProvider contention.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think they compete strongly by default. It only happens once when retrieving the key_handler key_handler->GetKeySet(key_index);
and once when the key ratchet needs to update the key material.
This is essentially similar to the two thread competition in frameCryptor for rtp_sender and rtp_receiver.
TODO: