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

Crypto fail on SCT retrieval #270

Open
Talanor opened this issue May 28, 2015 · 6 comments · May be fixed by #1239
Open

Crypto fail on SCT retrieval #270

Talanor opened this issue May 28, 2015 · 6 comments · May be fixed by #1239
Labels

Comments

@Talanor
Copy link

Talanor commented May 28, 2015

When executing this code (http://hastebin.com/arinusefex.py) on "twitter.com" (which only displays basic informations and X509 extensions of the certificate), it raises an exception on the last extension, which oid is : 1.3.6.1.4.1.11129.2.4.2.

@reaperhulk
Copy link
Member

1.3.6.1.4.1.11129.2.4.2 is the OID for certificate transparency (RFC 6962). Since your install (and indeed almost all installs) of OpenSSL don't know this extension an error is raised when __str__ is called, which calls X509V3_EXT_print. pyOpenSSL should definitely just provide a __str__ of "unknown extension" or something when it encounters an OID it doesn't recognize.

@reaperhulk reaperhulk added the bug label May 28, 2015
@Talanor
Copy link
Author

Talanor commented May 28, 2015

Thank you. Additionally, would you have any idea as of why my openssl command seem to be able to display the informations properly and pyopenssl can't?

@reaperhulk
Copy link
Member

What version of openssl? I can parse CT Precertificate SCTs with 1.0.2, but it's possible your pyopenssl isn't linked against that. To test you can run:

python -c "import OpenSSL.SSL; print(OpenSSL.SSL.SSLeay_version(OpenSSL.SSL.SSLEAY_VERSION))"

@Talanor
Copy link
Author

Talanor commented May 28, 2015

It prints out OpenSSL 1.0.1f 6 Jan 2014

and openssl version also returns OpenSSL 1.0.1f 6 Jan 2014

@reaperhulk
Copy link
Member

Hmm, I'm not sure why you're having problems then. I believe x509 -text uses the same X509V3_EXT_print function we're calling, but maybe I'm mistaken?

@Talanor
Copy link
Author

Talanor commented May 28, 2015

After reading some code, it would seem (not sure at all, correct me if i'm wrong), that cffi compiles python wrappers to call X509V3_EXT_print (and a bunch of other functions). Maybe the problem comes from the wrapper?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

Successfully merging a pull request may close this issue.

2 participants