summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn M. Schanck <jschanck@mozilla.com>2023-03-02 19:39:00 +0000
committerJohn M. Schanck <jschanck@mozilla.com>2023-03-02 19:39:00 +0000
commit65aef21637ba6551e24933a4903f6e3b5c2e77a6 (patch)
treea2c34507bbf410598c307df1a493e4ce814aa5a2
parent2b1b89ec6cee1233e6d9d5188104db0f1df9a437 (diff)
downloadnss-hg-65aef21637ba6551e24933a4903f6e3b5c2e77a6.tar.gz
Bug 1815136 - set PORT error after sftk_HMACCmp failure. r=nss-reviewers,nkulatova
Differential Revision: https://phabricator.services.mozilla.com/D171495
-rw-r--r--lib/softoken/pkcs11c.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/softoken/pkcs11c.c b/lib/softoken/pkcs11c.c
index a0ef85aca..cbdd2108a 100644
--- a/lib/softoken/pkcs11c.c
+++ b/lib/softoken/pkcs11c.c
@@ -2099,7 +2099,12 @@ static SECStatus
sftk_HMACCmp(CK_ULONG *copyLen, unsigned char *sig, unsigned int sigLen,
unsigned char *hash, unsigned int hashLen)
{
- return (NSS_SecureMemcmp(sig, hash, *copyLen) == 0) ? SECSuccess : SECFailure;
+ if (NSS_SecureMemcmp(sig, hash, *copyLen) == 0) {
+ return SECSuccess;
+ }
+
+ PORT_SetError(SEC_ERROR_BAD_SIGNATURE);
+ return SECFailure;
}
/*