Skip to content

Commit a26ed3d

Browse files
author
Keith Smith
committed
[FAB-7523] Improve bccsp error message
The current error message prints as Unsupported 'SignKey' provided [&[<binary data]] Change it to display similar to: Unsupported 'SignKey' provided [*ecdsaPublicKey] Change-Id: I6b2004cf24c30a245df7f360a533933303de486e Signed-off-by: Keith Smith <bksmith@us.ibm.com>
1 parent ce8c0ab commit a26ed3d

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

bccsp/sw/impl.go

+3-2
Original file line numberDiff line numberDiff line change
@@ -316,9 +316,10 @@ func (csp *impl) Sign(k bccsp.Key, digest []byte, opts bccsp.SignerOpts) (signat
316316
return nil, errors.New("Invalid digest. Cannot be empty.")
317317
}
318318

319-
signer, found := csp.signers[reflect.TypeOf(k)]
319+
keyType := reflect.TypeOf(k)
320+
signer, found := csp.signers[keyType]
320321
if !found {
321-
return nil, errors.Errorf("Unsupported 'SignKey' provided [%v]", k)
322+
return nil, errors.Errorf("Unsupported 'SignKey' provided [%s]", keyType)
322323
}
323324

324325
signature, err = signer.Sign(k, digest, opts)

0 commit comments

Comments
 (0)