{
if (!value)
return 0;
+#ifndef FIPS_MODE
+ /*
+ * We don't have EVP_get_digestbyname() in FIPS_MODE. That function returns
+ * an EVP_MD without an associated provider implementation (i.e. it is
+ * using "implicit fetch"). We could replace it with an "explicit" fetch
+ * using EVP_MD_fetch(), but we'd then be required to free the returned
+ * EVP_MD somewhere. Probably the complexity isn't worth it as we are
+ * unlikely to need this ctrl in FIPS_MODE anyway.
+ */
if (strcmp(type, "digest") == 0) {
const EVP_MD *d = EVP_get_digestbyname(value);
return 0;
return hmac_ctrl_int(hctx, EVP_MAC_CTRL_SET_MD, d);
}
+#endif
if (strcmp(type, "key") == 0)
return EVP_str2ctrl(hmac_ctrl_str_cb, hctx, EVP_MAC_CTRL_SET_KEY,
value);