Skip to content

Commit ceda20e

Browse files
committed
Ensure PSS_SALTLEN_E is always treated as failed verification
Should fix the remaining intermittent failures in NSS gtests.
1 parent 5e9e8f8 commit ceda20e

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

src/internal.c

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10347,15 +10347,10 @@ int WP11_RsaPKCSPSS_Verify(unsigned char* sig, word32 sigLen,
1034710347
pss->hashType, pss->saltLen, 0);
1034810348
if (ret == 0)
1034910349
*stat = 1;
10350-
/* Both can indicate that the verification failed */
10351-
if (ret == BAD_PADDING_E || ret == PSS_SALTLEN_E) {
10352-
*stat = 0;
10353-
ret = 0;
10354-
}
1035510350
}
10356-
/* Make sure bad padding returns success, but verify failed.
10351+
/* Make sure bad padding/salt length returns success, but verify failed.
1035710352
* Calling code expects this. */
10358-
if (ret == BAD_PADDING_E) {
10353+
if (ret == BAD_PADDING_E || ret == PSS_SALTLEN_E) {
1035910354
ret = 0;
1036010355
*stat = 0;
1036110356
}

0 commit comments

Comments
 (0)