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

Do not unnecessarily pad RSA exponent length to 4 bytes #8381

Merged
merged 1 commit into from
Oct 25, 2019

Conversation

heaths
Copy link
Member

@heaths heaths commented Oct 24, 2019

Fixes #8380

@heaths heaths requested a review from schaabs as a code owner October 24, 2019 18:20
@@ -313,7 +313,7 @@ public RSA ToRSA(bool includePrivateParameters = false)
// Key parameter length requirements defined by 2.2.2.9.1 RSA Private Key BLOB specification: https://docs.microsoft.com/openspecs/windows_protocols/ms-wcce/5cf2e6b9-3195-4f85-bc18-05b50e6d4e11
var rsaParameters = new RSAParameters
{
Exponent = ForceBufferLength(nameof(E), E, 4),
Exponent = E,
Modulus = TrimBuffer(N),
Copy link
Member

Choose a reason for hiding this comment

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

Is the trim also needed? or should that be removed too?

Copy link
Member Author

Choose a reason for hiding this comment

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

Apart from copying it (mostly) from track 1, I think now that we don't let you create your own JWK it may be unnecessary. In fact, if/when we do let people create their own JWKs we could still opt not to, i.e. make sure callers provide the right buffer sizes. Seems like a much larger change we might postpone to post GA. If you agree, I can open a separate bug; or, we can fix it now.

Copy link
Member

Choose a reason for hiding this comment

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

Fine to postpone so we can do a more in depth observation.

@heaths heaths merged commit 2e0bc39 into Azure:master Oct 25, 2019
@heaths heaths deleted the issue8380 branch October 25, 2019 00:53
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.

Do not unnecessarily pad RSA exponent length to 4 bytes
2 participants