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

X509_V_ERR_EC_KEY_EXPLICIT_PARAMS after upgrading from 1.1.1 to 3.0.2 #20117

Closed
user8547 opened this issue Jan 23, 2023 · 9 comments
Closed

X509_V_ERR_EC_KEY_EXPLICIT_PARAMS after upgrading from 1.1.1 to 3.0.2 #20117

user8547 opened this issue Jan 23, 2023 · 9 comments
Labels
resolved: answered The issue contained a question which has been answered triaged: question The issue contains a question

Comments

@user8547
Copy link

After upgrading from OpenSSL v1.1.1 to 3.0.2 (Ubuntu 22.04) I get error "X509_V_ERR_EC_KEY_EXPLICIT_PARAMS" when verifying end-entity certificates that have explicit curve parameters (ICAO eMRTD certificates have them).

In the source code I see that in v1.1.1 the check was enforced only in the strict mode, but in v3.0.2 it is applied always and there is no way to opt out.

@user8547 user8547 added the issue: bug report The issue was opened to report a bug label Jan 23, 2023
@t8m t8m added triaged: question The issue contains a question and removed issue: bug report The issue was opened to report a bug labels Jan 23, 2023
@t8m
Copy link
Member

t8m commented Jan 23, 2023

Yes, this is intentional. Explicit curve parameters are dangerous. The verification error can be dismissed if the application registers a verification callback.

@user8547
Copy link
Author

I had an impression that explicit curve parameters have been deprecated and are dangerous in TLS context.
There is a good reason why ICAO standards mandate explicit curve parameters only.

Do you know whether it is possible to define such callback outside TLS/SSL use case? I.e., when using X509_STORE to verify certificate chain?

Thanks!

@t8m
Copy link
Member

t8m commented Jan 23, 2023

Yes, you set the verify callback on the X509_STORE_CTX by the X509_STORE_CTX_set_verify_cb() function. Please see the manual pages.

@t8m t8m added the resolved: answered The issue contained a question which has been answered label Jan 23, 2023
@user8547
Copy link
Author

Thanks!
However, it seems that currently this functionality is not exposed in PyOpenSSL.
For now downgrading to v1.1.1 with a hope that in the future some verification flag enabling explicit EC curve parameters will be added to openssl :)

@t8m
Copy link
Member

t8m commented Jan 23, 2023

For now downgrading to v1.1.1 with a hope that in the future some verification flag enabling explicit EC curve parameters will be added to openssl :)

That is very unlikely to happen.

I'd recommend asking PyOpenSSL to implement the verification callback functionality. That callback is useful in other scenarios too.

@Aaargh20318
Copy link

Yes, you set the verify callback on the X509_STORE_CTX by the X509_STORE_CTX_set_verify_cb() function. Please see the manual pages.

This is not possible when verifying a CMS SignedData structure using CMS_verify as it does not expose the X509_STORE_CTX used.

@t8m
Copy link
Member

t8m commented Aug 16, 2023

Yes, you set the verify callback on the X509_STORE_CTX by the X509_STORE_CTX_set_verify_cb() function. Please see the manual pages.

This is not possible when verifying a CMS SignedData structure using CMS_verify as it does not expose the X509_STORE_CTX used.

It exposes X509_STORE and there is an equivalent X509_STORE_set_verify_cb() for X509_STORE.

@Aaargh20318
Copy link

It exposes X509_STORE and there is an equivalent X509_STORE_set_verify_cb() for X509_STORE.

Thanks, I was looking for that but somehow missed it.

@mattcaswell
Copy link
Member

Closing since this is marked as resolved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
resolved: answered The issue contained a question which has been answered triaged: question The issue contains a question
Projects
None yet
Development

No branches or pull requests

4 participants