Skip to content

Commit a007b56

Browse files
committed
Enhance warning for unsupported key
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>
1 parent 6d38e89 commit a007b56

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

msp/mspimplvalidate.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ func (msp *bccspmsp) validateIdentity(id *identity) error {
3131

3232
if !msp.supportedPublicKeyAlgorithms[id.cert.PublicKeyAlgorithm] {
3333
err := errors.Errorf("%s is not supported", id.cert.PublicKeyAlgorithm.String())
34-
id.validationErr = errors.WithMessage(err, "could not validate identity public key algorithm")
35-
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)
34+
id.validationErr = errors.WithMessage(err, "could not validate identity's public key algorithm")
35+
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)
3636
return id.validationErr
3737
}
3838

0 commit comments

Comments
 (0)