Skip to content

Commit

Permalink
[FABN-1056] update return type of sign() to Buffer
Browse files Browse the repository at this point in the history
current EC CryptoSuite sign() returns DER encoded signature
in array while the type definition for this is Buffer and the
jsdoc for api.CryptoSuite.sign() is byte[].

This CR updates the return type of sign() to Buffer.

Change-Id: Iea680c632b2465f552f3c7ae2181769bc6ce0572
Signed-off-by: zhaochy <[email protected]>
  • Loading branch information
zhaochy1990 committed Dec 10, 2018
1 parent 3cb3fa7 commit cac1354
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion fabric-client/lib/impl/CryptoSuite_ECDSA_AES.js
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,8 @@ class CryptoSuite_ECDSA_AES extends api.CryptoSuite {
let sig = this._ecdsa.sign(digest, signKey);
sig = _preventMalleability(sig, key._key.ecparams);
logger.debug('ecdsa signature: ', sig);
return sig.toDER();
const der = sig.toDER();
return Buffer.from(der);
}

verify(key, signature, digest) {
Expand Down

0 comments on commit cac1354

Please sign in to comment.