Skip to content

Commit

Permalink
[FABN-1314]
Browse files Browse the repository at this point in the history
in CryptoSuite_PKCS11.generateEphemeralKey:
move the statement to declare variable 'key' to be before it's referenced.

Signed-off-by: huxd <[email protected]>
Change-Id: I66b6dbb824bf5674e39c7351c4f9d21631850ded
  • Loading branch information
huxd committed Jul 15, 2019
1 parent 7634660 commit 5d1a88b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions fabric-common/lib/impl/bccsp_pkcs11.js
Original file line number Diff line number Diff line change
Expand Up @@ -817,15 +817,15 @@ class CryptoSuite_PKCS11 extends CryptoSuite {

const attributes = this._pkcs11GenerateKey(this._pkcs11, this._pkcs11Session, !!opts.persist);
// generateKey will need to know the ski, so set in a map here for use later
this.keyToSki.set(key, attributes.ski);
const key = new aesKey(attributes, this._keySize);
this.keyToSki.set(key, attributes.ski);
return key;
}
case 'ECDSA': {
const attributes = this._pkcs11GenerateECKeyPair(this._pkcs11, this._pkcs11Session, !!opts.persist);
// generateKey will need to know the ski, so set in a map here for use later
this.keyToSki.set(key, attributes.ski);
const key = new ecdsaKey(attributes, this._keySize);
this.keyToSki.set(key, attributes.ski);
key._cryptoSuite = this;
return key;
}
Expand Down

0 comments on commit 5d1a88b

Please sign in to comment.