diff --git a/src/rgw/rgw_crypt.cc b/src/rgw/rgw_crypt.cc index 243d2badf55..373f36eea1b 100644 --- a/src/rgw/rgw_crypt.cc +++ b/src/rgw/rgw_crypt.cc @@ -972,6 +972,8 @@ int rgw_s3_prepare_encrypt(struct req_state* s, } MD5 key_hash; + // Allow use of MD5 digest in FIPS mode for non-cryptographic purposes + key_hash.SetFlags(EVP_MD_CTX_FLAG_NON_FIPS_ALLOW); unsigned char key_hash_res[CEPH_CRYPTO_MD5_DIGESTSIZE]; key_hash.Update(reinterpret_cast(key_bin.c_str()), key_bin.size()); key_hash.Final(key_hash_res); @@ -1222,6 +1224,8 @@ int rgw_s3_prepare_decrypt(struct req_state* s, } MD5 key_hash; + // Allow use of MD5 digest in FIPS mode for non-cryptographic purposes + key_hash.SetFlags(EVP_MD_CTX_FLAG_NON_FIPS_ALLOW); uint8_t key_hash_res[CEPH_CRYPTO_MD5_DIGESTSIZE]; key_hash.Update(reinterpret_cast(key_bin.c_str()), key_bin.size()); key_hash.Final(key_hash_res); diff --git a/src/rgw/rgw_keystone.cc b/src/rgw/rgw_keystone.cc index 32502bec06f..6c045afa5f3 100644 --- a/src/rgw/rgw_keystone.cc +++ b/src/rgw/rgw_keystone.cc @@ -40,6 +40,8 @@ void rgw_get_token_id(const string& token, string& token_id) unsigned char m[CEPH_CRYPTO_MD5_DIGESTSIZE]; MD5 hash; + // Allow use of MD5 digest in FIPS mode for non-cryptographic purposes + hash.SetFlags(EVP_MD_CTX_FLAG_NON_FIPS_ALLOW); hash.Update((const unsigned char *)token.c_str(), token.size()); hash.Final(m);