Skip to content

Commit

Permalink
[FAB-16140] Fix Missing error handling in EC query
Browse files Browse the repository at this point in the history
Proposal, return error when EC-point query fails.

Signed-off-by: Vieira Neto <vieiranetoc@gmail.com>
Change-Id: I8a9ef44c4d7bcf2046f2c8d116f23803888dee72
(cherry picked from commit 2885268)
  • Loading branch information
vieirin authored and mastersingh24 committed Jul 31, 2019
1 parent f78f7b9 commit fc4f3a5
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion bccsp/pkcs11/pkcs11.go
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,10 @@ func (csp *impl) generateECKey(curve asn1.ObjectIdentifier, ephemeral bool) (ski
return nil, nil, fmt.Errorf("P11: keypair generate failed [%s]", err)
}

ecpt, _, _ := ecPoint(p11lib, session, pub)
ecpt, _, err := ecPoint(p11lib, session, pub)
if err != nil {
return nil, nil, fmt.Errorf("Error querying EC-point: [%s]", err)
}
hash := sha256.Sum256(ecpt)
ski = hash[:]

Expand Down

0 comments on commit fc4f3a5

Please sign in to comment.