Skip to content

Commit

Permalink
Check correct error
Browse files Browse the repository at this point in the history
The error check accidentally checks for a previous
error instead of the current

Signed-off-by: Brett Logan <brett.t.logan@ibm.com>
(cherry picked from commit 7da02d1)
  • Loading branch information
Brett Logan committed Dec 16, 2020
1 parent 73b39dc commit b2a5aec
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion bccsp/pkcs11/pkcs11.go
Original file line number Diff line number Diff line change
Expand Up @@ -544,7 +544,7 @@ func (csp *impl) generateECKey(curve asn1.ObjectIdentifier, ephemeral bool) (ski
return nil, nil, fmt.Errorf("P11: Private Key copy failed with error [%s]. Please contact your HSM vendor", prvCopyerror)
}
prvKeyDestroyError := csp.ctx.DestroyObject(session, prv)
if pubKeyDestroyError != nil {
if prvKeyDestroyError != nil {
return nil, nil, fmt.Errorf("P11: Private Key destroy failed with error [%s]. Please contact your HSM vendor", prvKeyDestroyError)
}
}
Expand Down

0 comments on commit b2a5aec

Please sign in to comment.