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
SSL: add OID / NID lookup #63647
Comments
For bpo-17134 I need a decent way to map OIDs to human readable strings and vice versa. OpenSSL has a couple of method for the task, e.g. http://www.openssl.org/docs/crypto/OBJ_nid2obj.html The patch implements three ways to lookup NID, SN, LN and OID: by OpenSSL's internal numeric id (NID), by OID or by name: >>> ssl.txt2obj("MD5", name=True)
ASN1Object(nid=4, shortname='MD5', longname='md5', oid='1.2.840.113549.2.5')
>>> ssl.txt2obj("clientAuth", name=True)
ASN1Object(nid=130, shortname='clientAuth', longname='TLS Web Client Authentication', oid='1.3.6.1.5.5.7.3.2')
>>> ssl.txt2obj("1.3.6.1.5.5.7.3.1")
ASN1Object(nid=129, shortname='serverAuth', longname='TLS Web Server Authentication', oid='1.3.6.1.5.5.7.3.1') |
Thanks for the feed back! The new patch implements a class with two additional class methods. The low level functions are no longer part of the public API. |
Does anybody want to do a review of the patch? |
If it's for bpo-17134, couldn't it remain a private API? I'm rather uncomfortable about exposing such things unless we make the ssl module a full-fledged toolbox to handle X509 certificates (and perhaps think a bit more about the APIs). Are there any common use cases? |
OK, let's keep it as private API for now and maybe make it public in 3.5. I'm going to rename ASN1Object to _ASN1Object, remove the docs and adjust the tests. Agreed? |
Yup. |
New changeset f43f65038e2a by Christian Heimes in branch 'default': |
Thanks! |
New changeset 7d914d4b05fe by Christian Heimes in branch 'default': |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: