C_VerifyFinal does not return accurate error code for incorrect HMACs
Categories
(NSS :: Libraries, defect, P2)
Tracking
(Not tracked)
People
(Reporter: joachim, Assigned: jschanck)
Details
(Whiteboard: [nss-triage])
Attachments
(1 file)
Steps to reproduce:
sftk_HMACCmp is used in the NSC_VerifyFinal function to finalize the result of an HMAC verification. If the return value is not SECSuccess, the PORT error is retrieved and mapped to CKR_xxx: https://github.com/nss-dev/nss/blob/master/lib/softoken/pkcs11c.c#L3840-L3842
However, sftk_HMACCmp doesn't actually set a PORT error. Consequently, sftk_MapCryptError receives garbage and returns a garbage result as well.
Actual results:
The return code of C_VerifyFinal is all over the place, e.g. CKR_ARGUMENTS_BAD or CKR_GENERAL_ERROR depending on the specific HMAC mechanism.
Expected results:
Return code CKR_SIGNATURE_INVALID.
An easy fix is to add PORT_SetError(SEC_ERROR_BAD_SIGNATURE); to the sftk_HMACCmp function.
Comment 1•1 year ago
|
||
The severity field is not set for this bug.
:beurdouche, could you have a look please?
For more information, please visit auto_nag documentation.
Updated•1 year ago
|
Comment 2•1 year ago
|
||
The severity field is not set for this bug.
:beurdouche, could you have a look please?
For more information, please visit auto_nag documentation.
Updated•1 year ago
|
Comment 3•1 year ago
|
||
The severity field is not set for this bug.
:beurdouche, could you have a look please?
For more information, please visit auto_nag documentation.
Assignee | ||
Comment 4•1 year ago
|
||
Assignee | ||
Updated•1 year ago
|
Assignee | ||
Comment 5•1 year ago
|
||
Description
•