]> git.ipfire.org Git - thirdparty/openssl.git/blobdiff - crypto/evp/keymgmt_lib.c
Remove keymgmt_copy function from the provider API
[thirdparty/openssl.git] / crypto / evp / keymgmt_lib.c
index 4300daa1f3988b2159b1496ae5495e81ba46ef87..80aea65e881aba3d5d4d80784d74a2460f5c46ce 100644 (file)
@@ -441,26 +441,8 @@ int evp_keymgmt_util_copy(EVP_PKEY *to, EVP_PKEY *from, int selection)
     if (to_keymgmt == NULL)
         to_keymgmt = from->keymgmt;
 
-    if (to_keymgmt == from->keymgmt && to_keymgmt->copy != NULL) {
-        /* Make sure there's somewhere to copy to */
-        if (to_keydata == NULL
-            && ((to_keydata = alloc_keydata = evp_keymgmt_newdata(to_keymgmt))
-                == NULL)) {
-            ERR_raise(ERR_LIB_EVP, ERR_R_MALLOC_FAILURE);
-            return 0;
-        }
-
-        /*
-         * |to| and |from| have the same keymgmt, and the copy function is
-         * implemented, so just copy and be done
-         */
-        if (!evp_keymgmt_copy(to_keymgmt, to_keydata, from->keydata,
-                              selection)) {
-            evp_keymgmt_freedata(to_keymgmt, alloc_keydata);
-            return 0;
-        }
-    } else if (to_keymgmt == from->keymgmt && to_keymgmt->dup != NULL
-               && to_keydata == NULL) {
+    if (to_keymgmt == from->keymgmt && to_keymgmt->dup != NULL
+        && to_keydata == NULL) {
         to_keydata = alloc_keydata = evp_keymgmt_dup(to_keymgmt,
                                                      from->keydata,
                                                      selection);