-
Notifications
You must be signed in to change notification settings - Fork 722
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
Ed25519 pkcs8
documents do not have RFC-valid public key part
#1464
Comments
pkcs8
documents do not have RFC-valid public key partpkcs8
documents do not have RFC-valid public key part
First, thanks for reporting this. I think I have a fix already in my local tree. I have some questions though.
You filed #1299, and then very soon after closed it, saying "this behaviour is - albeit confusing - intended." I thought when you wrote "this behaviour is - albeit confusing - intended" you were saying that the bug report was invalid. Should we reopen #1299?
It turns out that I was mistaken when I filed #834. The issue is actually exactly the same as the one you're reporting in this issue (#1464): We're encoding/decoding the public key as though it is EXPLICITLY tagged, but it is actually IMPLICITLY tagged.
As you noted elsewhere, other PKCS#8 libraries have had the same or similar issues. |
#1299 was about a bug that OpenSSL had wrt this, but that they refuse to revert, and effectively has become standard. That bug is fine, this is not, I'm recommending to move to those libraries as other libraries have undoubtedly encountered these problems before, and applied fixes themselves. |
As a first step, I've refactored the Ed25519 PKCS#8 parser tests to get better coverage, which will enable the fixing of this. Those changes are in #1466. |
I came across this bug while using Ed25519 PKCS#8 v2 key documents fail to parse under the stricter parsing rules in
It seems that this issue was recognized and fixed on the parsing side in #1480, but I'll try to make a PR for this. Wish me luck. |
I discovered this while working with
pkcs8
0.8;In the key template,
ring
prefixes the public key bit withA1 23 03 21
(Context Specific[1]
, thenBITSTRING
), while the RFC works with "Context Specific[1]
" only, the parser is then supposed to infer the following data is aBITSTRING
, without prefix.Furthermore, together with #1299 and #834, i strongly recommend switching to a pkcs8-parser library, instead of manually wrapping and generating keys like this.
The text was updated successfully, but these errors were encountered: