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

Trouble Validating RSA2048 cert signed by ECDSA CA #69

Closed
obelisk opened this issue Jan 28, 2021 · 5 comments
Closed

Trouble Validating RSA2048 cert signed by ECDSA CA #69

obelisk opened this issue Jan 28, 2021 · 5 comments

Comments

@obelisk
Copy link

obelisk commented Jan 28, 2021

Just tried to do this, OpenSSL verifies fine but the library balks. Using RSA for both the CA and Leaf cert works fine.

@chifflier
Copy link
Member

Hi,
I ran several tests, and could reproduce part of the problem, depending of the elliptic curve used to sign the certificate, and the size of the hash.

Can you check the curve used by the CA certificate ?

@obelisk
Copy link
Author

obelisk commented Feb 1, 2021

I believe these two certs reproduce the issue
Certs.zip

@chifflier
Copy link
Member

Thank you for providing test data.

I confirm the authority is using NIST P-521, as shown by the following command:

$ openssl x509 -text -noout -in RTCA.pem  | grep -E '(CURVE|OID)'
                ASN1 OID: secp521r1
                NIST CURVE: P-521

So, biggest part of the problem is that NIST P-521is currently not well supported in common Rust crates like ring or ecdsa.

I will look more at possible solutions, but it seems that currently the only option is to use the openssl crate, which would require some rewriting in the current code. I'll have a look.

@obelisk
Copy link
Author

obelisk commented Feb 2, 2021

I totally missed that it was a 521 cert, I suppose I chose the wrong settings when creating it. I know that ring doesn't support it for whatever reason. Sorry for the noise 🍻

@obelisk obelisk closed this as completed Feb 2, 2021
@chifflier
Copy link
Member

Well, that was not noise, because I know have a working implementation based on openssl, and I'm currently considering to switch from ring, or eventually to keep both implementations (and use features to allow only one).

I'd prefer to use a Rust solution if possible, but it seems ring aims at correct crypto use (even if that means having only a few algorithms). x509-parser is different, because the objective is to support existing certificates, even if they use weak crypto.

I'll reopen an issue to discuss the switch to openssl.
Thanks!

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

No branches or pull requests

2 participants