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 edge case importing RSA key #580

Merged
merged 1 commit into from
Jun 28, 2024
Merged

Fix edge case importing RSA key #580

merged 1 commit into from
Jun 28, 2024

Conversation

OronDF343
Copy link
Contributor

Description

Fixes edge case Exception importing private key when D is shorter in length than MODULUS by 8 bits or more.

If D is shorter, it is copied to the end of a new array with the same length as MODULUS. Naive, but this is a rare edge case.

Motivation and Context

This fixes issue #357 that I just ran into using an older Vonage application private key.

How Has This Been Tested?

Ran unit tests with old and new keys and published to our production server (which uses multiple private keys).

@Tr00d
Copy link
Contributor

Tr00d commented Jun 28, 2024

Hi @OronDF343,

Thanks for looking into this 👏 The problem didn't occur for a year so, as you said, it's probably related to older keys.
PemParse.cs is a tricky one as it was blatantly copied from an obscur source, without any sense of ownership or testing - which is why I tried to stay away from it.

@Tr00d Tr00d merged commit 6436947 into Vonage:main Jun 28, 2024
2 of 3 checks passed
@Tr00d
Copy link
Contributor

Tr00d commented Jun 28, 2024

@OronDF343,
I released v7.6.1, which includes your change.
Thanks again for contributing

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