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

Issue verifying child certificate using RSA #11

Open
alxdavids opened this issue May 21, 2020 · 0 comments
Open

Issue verifying child certificate using RSA #11

alxdavids opened this issue May 21, 2020 · 0 comments

Comments

@alxdavids
Copy link

I have a child certificate that is signed by an issuing certificate using an RSA key. When I run:

issuingCert.checkSignature(childCert);

I get the following error:

wrong public key type

I noticed that the error occurs here: https://github.com/fidm/x509/blob/master/src/pki.ts#L267 and that only the hashAlgorithm is passed (which is SHA-256). When running createVerify("SHA-256") an ECDSA verifier is created. When I replaced hashAlgorithm with RSA-SHA256, verification worked.

So I think the fix is to check for the public key type before accepting hashAlgorithm.

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

1 participant