Skip to content

Commit

Permalink
Enhance warning for unsupported key
Browse files Browse the repository at this point in the history
The warning in the logs when a key algorithm was not
supported was to big. Only the common names are used
now, instead of the whole subject and issuer.

Signed-off-by: Johann Westphall <johannwestphall@gmail.com>
  • Loading branch information
johannww committed Nov 25, 2022
1 parent 6d38e89 commit a007b56
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions msp/mspimplvalidate.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ func (msp *bccspmsp) validateIdentity(id *identity) error {

if !msp.supportedPublicKeyAlgorithms[id.cert.PublicKeyAlgorithm] {
err := errors.Errorf("%s is not supported", id.cert.PublicKeyAlgorithm.String())
id.validationErr = errors.WithMessage(err, "could not validate identity public key algorithm")
mspLogger.Warnf("Could not validate identity: %s (certificate subject=%s issuer=%s serialnumber=%d) Unsupported public key algorithm: %s", id.validationErr, id.cert.Subject, id.cert.Issuer, id.cert.SerialNumber, id.cert.PublicKeyAlgorithm)
id.validationErr = errors.WithMessage(err, "could not validate identity's public key algorithm")
mspLogger.Warnf("Could not validate identity: %s (certificate subject=%s issuer=%s serialnumber=%d) Unsupported public key algorithm: %s", id.validationErr, id.cert.Subject.CommonName, id.cert.Issuer.CommonName, id.cert.SerialNumber, id.cert.PublicKeyAlgorithm)
return id.validationErr
}

Expand Down

0 comments on commit a007b56

Please sign in to comment.