Skip to content

Commit

Permalink
Only canonize ECDSA signatures in MSP:IsWellFormed (#1495)
Browse files Browse the repository at this point in the history
Currently, the MSP IsWellFormed function expects any signature to be
a valid ECDSA signature, however the certificate can be signed by
a non-ECDSA algorithm which will then yield a false negative.

This change set ensures the check only applies if the signature is ECDSA.

Change-Id: I0b14e3e9b87e860a3ca29cc233dc4810de1768ab
Signed-off-by: yacovm <[email protected]>
  • Loading branch information
yacovm authored Jun 30, 2020
1 parent c2ea18f commit 34294ad
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions msp/mspimpl.go
Original file line number Diff line number Diff line change
Expand Up @@ -825,6 +825,10 @@ func (msp *bccspmsp) IsWellFormed(identity *m.SerializedIdentity) error {
return err
}

if !isECDSASignedCert(cert) {
return nil
}

return isIdentitySignedInCanonicalForm(cert.Signature, identity.Mspid, identity.IdBytes)

}
Expand Down

0 comments on commit 34294ad

Please sign in to comment.