X-Git-Url: https://git.openssl.org/?p=openssl.git;a=blobdiff_plain;f=crypto%2Frsa%2Frsa_pk1.c;h=eedc558e3f4184a75e9237cb7af780ef4fbf7c5e;hp=007e9b8cd533e46f7034d1c9a60cda68c42e0beb;hb=afb638f137958205b6b089da8967f4775b4c9bb6;hpb=1b72105076bb2e73f3c8461f9c0ca5ecefe007c8 diff --git a/crypto/rsa/rsa_pk1.c b/crypto/rsa/rsa_pk1.c index 007e9b8cd5..eedc558e3f 100644 --- a/crypto/rsa/rsa_pk1.c +++ b/crypto/rsa/rsa_pk1.c @@ -251,8 +251,15 @@ int RSA_padding_check_PKCS1_type_2(unsigned char *to, int tlen, } OPENSSL_clear_free(em, num); +#ifndef FIPS_MODE + /* + * This trick doesn't work in the FIPS provider because libcrypto manages + * the error stack. Instead we opt not to put an error on the stack at all + * in case of padding failure in the FIPS provider. + */ RSAerr(RSA_F_RSA_PADDING_CHECK_PKCS1_TYPE_2, RSA_R_PKCS_DECODING_ERROR); err_clear_last_constant_time(1 & good); +#endif return constant_time_select_int(good, mlen, -1); }