-
Notifications
You must be signed in to change notification settings - Fork 534
Fix PKCS8 decoding for some RSA private keys #937
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
Conversation
(ready to be reviewed) |
Assigned to Chris as I believe he wrote this code :) |
Hold off on reviewing. I just realized I introduced a bug in the array copying logic. |
Ok, fixed now. PTAL. |
Just to check, is this still needed bearing in mind your other changes around URL signing? |
I'm fairly sure this PR and URL signing are unrelated. I expect to get time to review this PR today. |
Yes, this is unrelated and just an odd edge case Ian happened to hit with the first credentials for the CI service account. |
This fails without PR googleapis#937, passes with it
I have created PR #938, which generates many RSA keys in PKCS8 format and verifies the Pkcs8 class now decodes them successfully. This fails (as expected) without the fix in this PS. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
This fails without PR googleapis#937, passes with it
This fails without PR googleapis#937, passes with it
According to this answer on the cryptography StackExchange site, there is a 1 in 400 edge case where the private key's D value will only require 255 bytes to be encoded, so we were trimming it to 255 bytes, but when .NET imports the RSA key parameters, it requires them to be aligned on 8 byte boundaries apparently.
cc @iantalarico