Skip to content
This repository has been archived by the owner on Feb 27, 2023. It is now read-only.

Check key size on ECDSA signing #30

Merged
merged 2 commits into from
May 8, 2015
Merged

Conversation

csstaub
Copy link
Collaborator

@csstaub csstaub commented May 8, 2015

Check key size on ECDSA signing, fixes a panic when using a key with incorrect algorithm (e.g. using ES256 signature with P-384 key).

R: @dgalling

@@ -430,13 +435,18 @@ func (ctx ecDecrypterSigner) signPayload(payload []byte, alg SignatureAlgorithm)
return Signature{}, err
}

keyBytes := curveBits / 8
if curveBits%8 > 0 {
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: spaces around operators

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Nope, gofmt formats it like this.

Copy link
Contributor

Choose a reason for hiding this comment

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

That's unfortunate.

dgalling added a commit that referenced this pull request May 8, 2015
@dgalling dgalling merged commit 9a65ee2 into master May 8, 2015
@dgalling dgalling deleted the cs/fix-invalid-curve-panic branch May 8, 2015 23:10
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants