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

Get channel binding binding information for TLS connection #44

Closed
wants to merge 1 commit into from

Conversation

fedor-brunner
Copy link
Contributor

Channel Bindings for TLS (RFC 5929, RFC 5056). Channel Bindings for TLS is very usefull because it can be used to detect MiTM attacks when the attacker is using valid certificates (certificates signed by Certification Authority).

For example: if a XMPP client is connecting to a XMPP server and the SCRAM-SHA-1-PLUS authentication mechanism is used during login (RFC 5802), the login will fail in the presence of MiTM attacker, because the TLS channel binding data is used in calculation of password hashes.

The method get_channel_binding supports only "tls-unique" channel binding. It can used the same way as get_channel_binding() in Python 3 ssl module.
http://docs.python.org/3/library/ssl.html

@@ -1416,6 +1416,33 @@ def set_session(self, session):
if not result:
_raise_current_error()

def get_channel_binding(self, cb_type="tls-unique"):
Copy link
Member

Choose a reason for hiding this comment

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

All pyOpenSSL APIs should have a docstring explaining what they are for, what their parameters mean, and what they return and raise.

Also please expand abbreviations. I think that "cb" is short for "channel binding"? You can probably just call this "type" here. Alternatively, "channel_binding_type" or "binding_type".

Also please declare a constant for magic strings like "tls-unique" so that applications don't have to be careful to spell a string literal just right.

@exarkun
Copy link
Member

exarkun commented Mar 1, 2014

Thanks. I've left some inline comments. Two more things:

  • the build is failing on travis - apparently because these APIs have not yet been added to cryptography.
  • Please also add howto-style documentation (in the doc directory) for any new APIs.

Thanks again!

@exarkun exarkun closed this Mar 1, 2014
@fedor-brunner
Copy link
Contributor Author

The code in cryptography has been merged only recently
pyca/cryptography#686
I wanted to make the code compatible with Python 3 ssl module, but I will change the code to wrappers of session_reused, get_finished, and get_peer_finished . Then get_channel_binding() can be implemented directly in application.

http://docs.python.org/3/library/ssl.html#ssl.SSLSocket.get_channel_binding

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 24, 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.

None yet

2 participants