{
const EVP_CIPHER *fcipher;
if (cipher)
- fcipher = FIPS_get_cipherbynid(EVP_CIPHER_type(cipher));
+ fcipher = evp_get_fips_cipher(cipher);
if (fcipher)
cipher = fcipher;
return FIPS_cipherinit(ctx, cipher, key, iv, enc);
{
#ifdef OPENSSL_FIPS
const EVP_CIPHER *fcipher;
- fcipher = FIPS_get_cipherbynid(EVP_CIPHER_type(cipher));
+ fcipher = evp_get_fips_cipher(cipher);
if (fcipher && fcipher->flags & EVP_CIPH_FLAG_FIPS)
return cipher->flags | EVP_CIPH_FLAG_FIPS;
#endif
else
return FIPS_get_digestbynid(nid);
}
+
+const EVP_CIPHER *evp_get_fips_cipher(const EVP_CIPHER *cipher)
+ {
+ if (cipher->nid == NID_undef)
+ return FIPS_evp_enc_null();
+ else
+ return FIPS_get_cipherbynid(EVP_CIPHER_type(cipher));
+ }
+
#endif
unsigned long EVP_MD_flags(const EVP_MD *md)
const EVP_CIPHER *c, const EVP_MD *md, int en_de);
const EVP_MD *evp_get_fips_md(const EVP_MD *md);
+const EVP_CIPHER *evp_get_fips_cipher(const EVP_CIPHER *cipher);
#ifdef OPENSSL_FIPS