Make sure we save the copy function when registering a new Keymgmt
authorMatt Caswell <matt@openssl.org>
Fri, 22 May 2020 13:09:13 +0000 (14:09 +0100)
committerMatt Caswell <matt@openssl.org>
Fri, 19 Jun 2020 09:19:32 +0000 (10:19 +0100)
If a provider had a "copy" function in the its keymgmt definition we
were ignoring it.

Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
(Merged from https://github.com/openssl/openssl/pull/11914)

crypto/evp/keymgmt_meth.c

index b75d02f..ab5e00d 100644 (file)
@@ -124,6 +124,10 @@ static void *keymgmt_from_dispatch(int name_id,
             if (keymgmt->has == NULL)
                 keymgmt->has = OSSL_get_OP_keymgmt_has(fns);
             break;
+        case OSSL_FUNC_KEYMGMT_COPY:
+            if (keymgmt->copy == NULL)
+                keymgmt->copy = OSSL_get_OP_keymgmt_copy(fns);
+            break;
         case OSSL_FUNC_KEYMGMT_VALIDATE:
             if (keymgmt->validate == NULL)
                 keymgmt->validate = OSSL_get_OP_keymgmt_validate(fns);