Skip to content
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

Add bindings for SRTP support #4099

Merged
merged 1 commit into from
Feb 5, 2018
Merged

Conversation

jlaine
Copy link
Contributor

@jlaine jlaine commented Feb 5, 2018

I spotted a number of new bindings being added to support DTLS, which is great!

One useful application is negotiating SRTP keys using DTLS, for instance for use with WebRTC:

https://tools.ietf.org/html/rfc5764

To do so, you need bindings for SSL_set_tlsext_use_srtp and/or SSL_CTX_set_tlsext_use_srtp, which this pull request provides.

Copy link
Member

@reaperhulk reaperhulk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for providing the use case. This LGTM as these bindings are present even in 1.0.1 (the oldest OpenSSL we support).

@reaperhulk
Copy link
Member

(These are technically in srtp.h but ssl.h includes it so I'm okay with them being in this file).

@reaperhulk reaperhulk merged commit c58d019 into pyca:master Feb 5, 2018
@jlaine
Copy link
Contributor Author

jlaine commented Feb 6, 2018

Thanks a lot!

Once this gets released and DTLSv1_method trickles into pyopenssl's SSL.Context, I'd be happy to follow up with a patch for pyopenssl to add SSL.Context.set_tlsext_use_srtp(self, profiles).

@jlaine
Copy link
Contributor Author

jlaine commented Feb 6, 2018

FYI you can find an example of asyncio-based code which performs DTLS handshake and SRTP keying here:

https://gist.github.com/jlaine/4c39326b251a43423b477d14ed67b21b

Thanks to the bindings you added I'll be able to use cryptography's bindings, and eventually pyopenssl hopefully.

@reaperhulk
Copy link
Member

reaperhulk commented Feb 6, 2018

Thanks for contributing! Feel free to send a PR to add your name to AUTHORS.rst

You can actually submit a PR to pyOpenSSL now if you'd like. The CI job will fail, but we have several jobs in the CI that test against the master branch of cryptography so if those pass then once we do a cryptography release all you'll need to do is rebase (and bump the minimum version of cryptography required).

@jlaine jlaine deleted the srtp-binding branch February 6, 2018 08:13
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 11, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants