I’m using an OpenSSL engine that uses the RSA_FLAG_SIGN_VER flag and implements RSA_METHOD.rsa_sign() instead rsa_priv_enc(). This is mainly because of the requirement that it work with Windows CryptoAPI which does not support low-level
RSA signing (see CAPI engine). Everything works as it should until FIPS mode is enabled. Under FIPS mode, the “non-implemented” rsa_priv_enc() is called and an error is returned. The simplified backtrace is:
#0 rsa_priv_enc // non-implemented engine function
#1 FIPS_rsa_sign_digest // FIPS canister
It appears that FIPS_rsa_sign_digest() never checks RSA_FLAG_SIGN_VER or calls rsa_sign() - it simply defaults to rsa_priv_enc(). I can’t find any place rsa_sign is called.
There are posts that specifically reference running CAPI with FIPS mode, so I don’t know what I’m missing.