return NULL;
}
+#ifndef FIPS_MODE
+ /*
+ * FIPS module note: since internal fetches will be entirely
+ * provider based, we know that none of its code depends on legacy
+ * NIDs or any functionality that use them.
+ *
+ * TODO(3.x) get rid of the need for legacy NIDs
+ */
+ md->type = OBJ_sn2nid(name);
+#endif
+
for (; fns->function_id != 0; fns++) {
switch (fns->function_id) {
case OSSL_FUNC_DIGEST_NEWCTX:
evp_md_from_dispatch, evp_md_up_ref,
evp_md_free);
-#ifndef FIPS_MODE
- /* TODO(3.x) get rid of the need for legacy NIDs */
- if (md != NULL) {
- /*
- * FIPS module note: since internal fetches will be entirely
- * provider based, we know that none of its code depends on legacy
- * NIDs or any functionality that use them.
- */
- md->type = OBJ_sn2nid(algorithm);
- }
-#endif
-
return md;
}
EVP_CIPHER *cipher = NULL;
int fnciphcnt = 0, fnctxcnt = 0;
- /*
- * The legacy NID is set by EVP_CIPHER_fetch() if the name exists in
- * the object database.
- */
if ((cipher = EVP_CIPHER_meth_new(0, 0, 0)) == NULL
|| (cipher->name = OPENSSL_strdup(name)) == NULL) {
EVP_CIPHER_meth_free(cipher);
return NULL;
}
+#ifndef FIPS_MODE
+ /*
+ * FIPS module note: since internal fetches will be entirely
+ * provider based, we know that none of its code depends on legacy
+ * NIDs or any functionality that use them.
+ *
+ * TODO(3.x) get rid of the need for legacy NIDs
+ */
+ cipher->nid = OBJ_sn2nid(name);
+#endif
+
for (; fns->function_id != 0; fns++) {
switch (fns->function_id) {
case OSSL_FUNC_CIPHER_NEWCTX:
evp_cipher_from_dispatch, evp_cipher_up_ref,
evp_cipher_free);
-#ifndef FIPS_MODE
- /* TODO(3.x) get rid of the need for legacy NIDs */
- if (cipher != NULL) {
- /*
- * FIPS module note: since internal fetches will be entirely
- * provider based, we know that none of its code depends on legacy
- * NIDs or any functionality that use them.
- */
- cipher->nid = OBJ_sn2nid(algorithm);
- }
-#endif
-
return cipher;
}