Add EC-DSA, custom certificate common names for DTLS #607
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.
Update Str0m to support EC-DSA certification for DTLS. See: https://developer.chrome.com/blog/webrtc-ecdsa/
This updates both the OpenSSL and Wincrypto providers to allow both RSA or EC-DSA certificates. The default remains RSA, although perhaps it should change to EC-DSA at some point.
Took the opportunity to also allow the CN of the certificate to be configured (as this was an existing TODO).
OpenSSL is configured to indicate SHA1 is not acceptable for the DTLS certificate signing, but then proceeded to use SHA1 and for some reason accepts it. This changes it to use SHA256 which matches WinCrypto, since the Windows APIs refused to offer a SHA1 signed cert if the DTLS handshake indicated it wasn't supported.
WinCrypto was updated to use the Owned struct that windows-rs offers for cleaning up the SrtpKey, rather than having a custom Drop impl.
WinCrypto had an issue when compiled in --release, where DTLS handshake would fail as a server. This was related to buffers being marked as immutable, but then cast to mutable in unsafe code. The compiler (I believe) was using the immutability to avoid reading the values multiple times, so although things were mutated in the unsafe code, the code did not recognize the changes. This just updated those buffers to be marked
mut
, it also eliminated some of the double-casts in unsafe code.