Skip to content

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)
@sonarqubecloud
Copy link

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