diff options
author | John M. Schanck <jschanck@mozilla.com> | 2023-03-02 19:39:00 +0000 |
---|---|---|
committer | John M. Schanck <jschanck@mozilla.com> | 2023-03-02 19:39:00 +0000 |
commit | 65aef21637ba6551e24933a4903f6e3b5c2e77a6 (patch) | |
tree | a2c34507bbf410598c307df1a493e4ce814aa5a2 | |
parent | 2b1b89ec6cee1233e6d9d5188104db0f1df9a437 (diff) | |
download | nss-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.c | 7 |
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; } /* |