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

ap: add support for PKCS1 "RSA PUBLIC KEY" pem block type #1179

Merged
merged 2 commits into from
Nov 30, 2022

Conversation

ftrvxmtrx
Copy link
Contributor

Signed-off-by: Sigrid Solveig Haflínudóttir sigrid@ftrv.se

Signed-off-by: Sigrid Solveig Haflínudóttir <sigrid@ftrv.se>
case "RSA PUBLIC KEY":
p, err = x509.ParsePKCS1PublicKey(block.Bytes)
default:
return nil, nil, errors.New("could not decode publicKeyPem to (RSA) PUBLIC KEY pem block type")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is it worth logging here what the block type we got was, if block wasn't nil? might be useful for debugging

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tsmethurst changed it to distinguish between no PEM data vs unknown block type and made it report the type in the latter case.

Signed-off-by: Sigrid Solveig Haflínudóttir <sigrid@ftrv.se>
@tsmethurst
Copy link
Contributor

Thank you, this looks great! :) Much appreciated!

@tsmethurst tsmethurst merged commit 5a0e418 into superseriousbusiness:main Nov 30, 2022
@ftrvxmtrx ftrvxmtrx deleted the rsa-pkcs1 branch November 30, 2022 23:09
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

Successfully merging this pull request may close these issues.

None yet

2 participants