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);