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

fix(ext/node): add alternative RSA OID #22511

Closed
wants to merge 1 commit into from

Conversation

iuioiua
Copy link
Collaborator

@iuioiua iuioiua commented Feb 21, 2024

While working on #22489, I noticed that this private key was unable to be created using crypto.createPrivateKey(). This is because it uses an RSA OID, 1.2.840.113549.1.3.1, which is less commonly used than the currently used one, 1.2.840.113549.1.1.1. This change adds the lesser-used RSA OID.

CC @littledivy

Comment on lines 1396 to 1398
let private_key =
rsa::pkcs1::RsaPrivateKey::from_der(pk_info.private_key)?;
let modulus_length = private_key.modulus.as_bytes().len() * 8;
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Currently encountering error:

Error: unexpected ASN.1 DER tag: expected SEQUENCE, got INTEGER

@aapoalas aapoalas requested a review from littledivy March 5, 2024 18:43
@bartlomieju bartlomieju modified the milestone: 1.42 Mar 6, 2024
@iuioiua iuioiua marked this pull request as ready for review March 13, 2024 00:48
Copy link
Member

@littledivy littledivy left a comment

Choose a reason for hiding this comment

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

The OID has .3.1 ending hence so I'm pretty sure that's not related to RSA

http://oid-info.com/get/1.2.840.113549.1.3.1

This is the object identifier for dhKeyAgreement defined in PKCS #3: Diffie-Hellman KeyAgreement Standard (1993). PDF

The key material in the PEM is DH private key.

@iuioiua
Copy link
Collaborator Author

iuioiua commented Mar 14, 2024

This has been superseded by #22891.

@iuioiua iuioiua closed this Mar 14, 2024
@iuioiua iuioiua deleted the node-alt-rsa-oid branch March 14, 2024 03:50
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

3 participants