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

change oid lookup for signing #29

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

nbutkowski-chub
Copy link

When pulling the OID from SubjectPublicKeyInfo, we can get values like rsaEncryption (1.2.840.113549.1.1) which breaks @peculiar/webcrypto. Their docs indicate This one should not be used for signing.

I don't know enough to say if this is safer, but it appears to be working when testing with a key/cert generated this way:

openssl version
OpenSSL 3.0.5 5 Jul 2022 (Library: OpenSSL 3.0.5 5 Jul 2022)
openssl req -nodes -new -x509 -keyout test.key -out test.cer
openssl asn1parse -in test.cer -item X509 | grep algorithm
algorithm: sha256WithRSAEncryption (1.2.840.113549.1.1.11)
algorithm: rsaEncryption (1.2.840.113549.1.1.1)
algorithm: sha256WithRSAEncryption (1.2.840.113549.1.1.11)

When pulling the OID from SubjectPublicKeyInfo, we can get values like rsaEncryption (1.2.840.113549.1.1) which breaks @peculiar/webcrypto. Their docs indicate This one should not be used for signing. 

I don't know enough to say if this is safer, but it appears to be working when testing with a key/cert generated this way:

> openssl version
OpenSSL 3.0.5 5 Jul 2022 (Library: OpenSSL 3.0.5 5 Jul 2022)
> openssl req -nodes -new -x509 -keyout test.key -out test.cer
> openssl asn1parse -in test.cer -item X509 | grep algorithm
      algorithm: sha256WithRSAEncryption (1.2.840.113549.1.1.11)
        algorithm: rsaEncryption (1.2.840.113549.1.1.1)
    algorithm: sha256WithRSAEncryption (1.2.840.113549.1.1.11)
@sonarcloud
Copy link

sonarcloud bot commented Oct 22, 2022

SonarCloud Quality Gate failed.    Quality Gate failed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell C 1 Code Smell

No Coverage information No Coverage information
0.0% 0.0% Duplication

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.

1 participant