Skip to content
This repository was archived by the owner on Jan 26, 2026. It is now read-only.

Commit 7468cdf

Browse files
JakujeNIIBE Yutaka
authored andcommitted
Revert "tests: Expect the RSA PKCS #1.5 encryption to fail in FIPS mode"
This reverts commit f736f3c. The pubkey encryption has already separate explicit FIPS service indicator.
1 parent e83280b commit 7468cdf

2 files changed

Lines changed: 5 additions & 20 deletions

File tree

tests/basic.c

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16876,16 +16876,14 @@ check_pubkey_crypt (int n, gcry_sexp_t skey, gcry_sexp_t pkey, int algo,
1687616876
NULL,
1687716877
0,
1687816878
0,
16879-
0,
16880-
FLAG_NOFIPS },
16879+
0 },
1688116880
{ GCRY_PK_RSA,
1688216881
"(data\n (flags pkcs1)\n"
1688316882
" (value #11223344556677889900AA#))\n",
1688416883
"(flags pkcs1)",
1688516884
1,
1688616885
0,
16887-
0,
16888-
FLAG_NOFIPS },
16886+
0 },
1688916887
{ GCRY_PK_RSA,
1689016888
"(data\n (flags oaep)\n"
1689116889
" (value #11223344556677889900AA#))\n",
@@ -16987,8 +16985,7 @@ check_pubkey_crypt (int n, gcry_sexp_t skey, gcry_sexp_t pkey, int algo,
1698716985
die ("converting data failed: %s\n", gpg_strerror (rc));
1698816986

1698916987
rc = gcry_pk_encrypt (&ciph, data, pkey);
16990-
if (in_fips_mode && ((flags & FLAG_NOFIPS) ||
16991-
(datas[dataidx].flags & FLAG_NOFIPS)))
16988+
if (in_fips_mode && (flags & FLAG_NOFIPS))
1699216989
{
1699316990
if (!rc)
1699416991
fail ("gcry_pk_encrypt did not fail as expected in FIPS mode\n");
@@ -17037,7 +17034,7 @@ check_pubkey_crypt (int n, gcry_sexp_t skey, gcry_sexp_t pkey, int algo,
1703717034
ciph = list;
1703817035
}
1703917036
rc = gcry_pk_decrypt (&plain, ciph, skey);
17040-
if ((!rc || in_fips_mode) && (datas[dataidx].flags & FLAG_SPECIAL))
17037+
if (!rc && (datas[dataidx].flags & FLAG_SPECIAL))
1704117038
{
1704217039
/* It may happen that OAEP formatted data which is
1704317040
decrypted as pkcs#1 data returns a valid pkcs#1

tests/pkcs1v2.c

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -454,19 +454,7 @@ check_v15crypt (void)
454454
gcry_free (seed);
455455

456456
err = gcry_pk_encrypt (&ciph, plain, pub_key);
457-
if (in_fips_mode)
458-
{
459-
if (!err)
460-
{
461-
fail ("gcry_pk_encrypt should have failed in FIPS mode:\n");
462-
}
463-
gcry_sexp_release (plain);
464-
plain = NULL;
465-
gcry_sexp_release (ciph);
466-
ciph = NULL;
467-
continue;
468-
}
469-
else if (err)
457+
if (err)
470458
{
471459
show_sexp ("plain:\n", ciph);
472460
fail ("gcry_pk_encrypt failed: %s\n", gpg_strerror (err));

0 commit comments

Comments
 (0)