Allow use of long name for KDFs
[openssl.git] / test / evp_test.c
index 6fcf3c6077e3bca76d96752f6be753470c245a26..8fd082f30c34761832a9c483ce812b2eb19ea47c 100644 (file)
@@ -1623,10 +1623,14 @@ typedef struct kdf_data_st {
 static int kdf_test_init(EVP_TEST *t, const char *name)
 {
     KDF_DATA *kdata;
+    int kdf_nid = OBJ_sn2nid(name);
+
+    if (kdf_nid == NID_undef)
+        kdf_nid = OBJ_ln2nid(name);
 
     if (!TEST_ptr(kdata = OPENSSL_zalloc(sizeof(*kdata))))
         return 0;
-    kdata->ctx = EVP_PKEY_CTX_new_id(OBJ_sn2nid(name), NULL);
+    kdata->ctx = EVP_PKEY_CTX_new_id(kdf_nid, NULL);
     if (kdata->ctx == NULL) {
         OPENSSL_free(kdata);
         return 0;