-
-
Notifications
You must be signed in to change notification settings - Fork 398
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
ProtectionProfile::AeadAes256Gcm => 16 for JetKVM #656
Comments
So I was the person helping to troubleshoot this over discord. For the most part the most major issue would seem that it is possible to cause a panic based on data coming from the network. Going off the stack trace the source of panic is roughly webrtc/srtp/src/key_derivation.rs Lines 43 to 44 in 6cdafce
though it isn't super clear if the overarching problem is the fact that this panics when given unexpected(ly sized) input or that the unexpected(ly sized) input gets to here at all. The code seems to be written under an assumption of 128-bit AES both in the code above and in the call site of this function webrtc/srtp/src/cipher/cipher_aead_aes_gcm.rs Lines 154 to 164 in 6cdafce
even though the session and config code supposedly understands 256-bit AES keys are 32-bits long. |
I also ran into this issue, thanks for the fork @davehorner. Indeed it would be nice to have a fix merged into the main repo |
https://crates.io/crates/jetkvm_control
I'm working on releasing this crate and when you install via cargo, it doesn't use my forked version of webrtc so it is broken for users that try to install that route.
If I use the webrtc crate as is and try to connect the user gets:
my patch:
84d763f
I have to set this to 16 for it to work with JetKVM.
Someone told me that
https://github.com/pion/webrtc/blob/98a00250830c8c5cea5a858dd4e3b652743c0b69/constants.go#L47-L53 are the default profiles in the library, and imagines it tries them first to last.
I really don't want to maintain a fork of webrtc for a key length patch. Is there a way to specify the protection profile to be used?
#649 - has the code I was looking for to select the desired profiles.
I need to test more and I will come back to close this ticket; still the question of the hard assert.
the webrtc crate should probably not panic when faced with weird input from the network?
I'm not sure if the JetKVM is doing something wrong. But it it is valid for IV to be 16 bytes. A similar issue in Rust land denoland/deno#13689
my issue has been solved. the settings change above allows my client to work with stock webrtc. this can be closed if a hard assert is the proper response.
The text was updated successfully, but these errors were encountered: