re-introduce old nss im too tired for this

This commit is contained in:
wuggy 2026-06-30 06:37:32 +01:00
commit 3a838106b9
2871 changed files with 1374431 additions and 1762417 deletions

View file

@ -77,23 +77,19 @@ TEST_F(RSATest, DecryptBlockTestErrors) {
EXPECT_EQ(SECFailure, rv);
uint8_t in[256] = {0};
// This should fail because the padding checks will fail,
// however, mitigations for Bleichenbacher attacks transform failures
// to a different output.
// This should fail because the padding checks will fail.
rv = RSA_DecryptBlock(key.get(), out, &outputLen, maxOutputLen, in,
sizeof(in));
EXPECT_EQ(SECSuccess, rv);
// outputLen should <= 256-11=245.
EXPECT_LE(outputLen, 245u);
EXPECT_EQ(SECFailure, rv);
// outputLen should be maxOutputLen.
EXPECT_EQ(maxOutputLen, outputLen);
// This should fail because the padding checks will fail,
// however, mitigations for Bleichenbacher attacks transform failures
// to a different output.
// This should fail because the padding checks will fail.
uint8_t out_long[260] = {0};
maxOutputLen = sizeof(out_long);
rv = RSA_DecryptBlock(key.get(), out_long, &outputLen, maxOutputLen, in,
sizeof(in));
EXPECT_EQ(SECSuccess, rv);
EXPECT_EQ(SECFailure, rv);
// outputLen should <= 256-11=245.
EXPECT_LE(outputLen, 245u);
// Everything over 256 must be 0 in the output.