-
-
Notifications
You must be signed in to change notification settings - Fork 10.2k
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
openssl doesn't accept ring generated ed25519 key pairs #9134
Comments
ring generates PKSC#8 v2 for Ed25519 and (eventually) X25519 so that the public key can be included, so that the pairwise consistency check required by some NIST standards can be done by the receiving side. (NIST doesn't have standards for Ed25519 yet but I expect they will require a pairwise consistency check like they do for RSA, ECDSA, and ECDH if/when they allow Ed25519.) |
For the format OpenSSL uses, see RFC 8410.
|
But using the example from the RFC that includes the public key doesn't seem to work.
|
It's PKCS#8 v2 format, like ring generates. |
fwiw, ring doesn't accept it either. Probably because of the additional attribute. |
#10468 is a new issue specifically asking for PKCS#8 v2. We can close this one. |
Yeah I realized later that this bug was formulated in a bad way. Opening a new one is a good idea. |
Rust snippet used to generated the ed25519 key:
Example for a generated key:
If you put the Rust generated key into a file
key.pem
and then create a CSR and try to sign it, you'll get an error:Example CSR (the CSR uses RSA-2048):
Generating an ed25519 key with openssl and using it to sign the CSR works great:
The version of the openssl CLI is 1.1.1b (ubuntu distro build).
See also rustls/rcgen#11 where I use the openssl library to load the private key and where it's giving me a similar "wrong tag" error (I've tried both versions 1.1.1b and 1.1.1c both fail).
See also briansmith/ring#833 which is about the other direction: the default parsing function of ring for ed25519 keys is unable to read certificates generated by openssl at least by the default flags (dunno if there are custom flags/modes to generate certificates that ring wants). It seems that openssl and ring are incompatible to each other which is very sad :/.
If I compare the keys that ring generates with the keys that openssl generates, I note two differences: first the version field is set to 0 (v1) in openssl, while the version field is set to 1 (v2) in ring. Second, ring includes the public key while openssl doesn't. The version fields are set consistently by both to RFC 5958 which states:
Maybe openssl is just unable to read the public key (v2 encoded keys)?
cc @briansmith author of ring.
The text was updated successfully, but these errors were encountered: