webrtc-rs / webrtc

A pure Rust implementation of WebRTC
https://webrtc.rs
Apache License 2.0
4.08k stars 363 forks source link

fix OBS-studio DTLS failed #557

Closed a-wing closed 5 months ago

a-wing commented 5 months ago

We found use OBS-studio WHIP cannot PeerConnected

package DTLS have problem

We found after this commit have this bug

This PR https://github.com/webrtc-rs/webrtc/pull/496 and this commit after https://github.com/webrtc-rs/webrtc/pull/496/commits/935283abc719b2c3a6925cd8bb90ffb3809bccc5

Finally we found the problem. But, I'm not sure this have bug

https://github.com/RustCrypto/utils/blob/master/block-padding/src/lib.rs#L176-L216

Maybe, webrtc-rs is using this library incorrectly

https://github.com/binbat/live777/issues/39 https://github.com/binbat/live777/issues/58

codecov[bot] commented 5 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 61.70%. Comparing base (a97d49e) to head (6ae4033). Report is 4 commits behind head on master.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #557 +/- ## ========================================== - Coverage 61.76% 61.70% -0.07% ========================================== Files 529 530 +1 Lines 48828 48848 +20 Branches 12250 12274 +24 ========================================== - Hits 30161 30141 -20 - Misses 9532 9544 +12 - Partials 9135 9163 +28 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

yngrtc commented 5 months ago

please fix formatting

edaniels commented 5 months ago

@rainliu, can you comment on why https://github.com/webrtc-rs/webrtc/commit/935283abc719b2c3a6925cd8bb90ffb3809bccc5 changed the padding in the first place? I'm not sure I understand the reasoning and this was particularly hard to track down. Thank you!

rainliu commented 5 months ago

dtls dependent crates upgrade to new version, however, incorrect usage of new APIs of those crates causes incompatible PADDING.

aes = "0.8" cbc = { version = "0.1", features = [ "block-padding", "alloc"] } ccm = "0.5"

edaniels commented 5 months ago

I see, but how is PKCS7 relevant to DTLS? Does the RFC say somewhere that the padding schemes are equivalent?