OSSL_OP_keymgmt_import_types_fn *import_types;
OSSL_OP_keymgmt_export_fn *export;
OSSL_OP_keymgmt_export_types_fn *export_types;
+ OSSL_OP_keymgmt_copy_fn *copy;
} /* EVP_KEYMGMT */ ;
struct evp_keyexch_st {
return NULL;
return keymgmt->export_types(selection);
}
+
+int evp_keymgmt_copy(const EVP_KEYMGMT *keymgmt,
+ void *keydata_to, const void *keydata_from,
+ int selection)
+{
+ /* We assume no copy if the implementation doesn't have a function */
+ if (keymgmt->copy == NULL)
+ return 0;
+ return keymgmt->copy(keydata_to, keydata_from, selection);
+}
OSSL_CALLBACK *param_cb, void *cbarg);
const OSSL_PARAM *OP_keymgmt_export_types(int selection);
+ /* Key object copy */
+ int OP_keymgmt_copy(void *keydata_to, const void *keydata_from, int selection);
+
/* Key object validation */
int OP_keymgmt_validate(void *keydata, int selection);
OP_keymgmt_export OSSL_FUNC_KEYMGMT_EXPORT
OP_keymgmt_export_types OSSL_FUNC_KEYMGMT_EXPORT_TYPES
+ OP_keymgmt_copy OSSL_FUNC_KEYMGMT_COPY
=head2 Key Objects
the caller has ensured that I<keydata1> and I<keydata2> are both owned
by the implementation of this function.
-=head2 Key Object Import and Export Functions
+=head2 Key Object Import, Export and Copy Functions
OP_keymgmt_import() should import data indicated by I<selection> into
I<keydata> with values taken from the B<OSSL_PARAM> array I<params>.
B<OSSL_PARAM> for data indicated by I<selection>, that the
OP_keymgmt_export() callback can expect to receive.
+OP_keymgmt_copy() should copy data subsets indicated by I<selection>
+from I<keydata_from> to I<keydata_to>. It is assumed that the caller
+has ensured that I<keydata_to> and I<keydata_from> are both owned by
+the implementation of this function.
+
=head2 Built-in RSA Import/Export Types
The following Import/Export types are available for the built-in RSA algorithm:
int selection, OSSL_CALLBACK *param_cb, void *cbarg);
const OSSL_PARAM *evp_keymgmt_export_types(const EVP_KEYMGMT *keymgmt,
int selection);
+int evp_keymgmt_copy(const EVP_KEYMGMT *keymgmt,
+ void *keydata_to, const void *keydata_from,
+ int selection);
/* Pulling defines out of C source files */
(const void *keydata1, const void *keydata2,
int selection))
-/* Import and export functions, with ddiscovery */
+/* Import and export functions, with discovery */
# define OSSL_FUNC_KEYMGMT_IMPORT 40
# define OSSL_FUNC_KEYMGMT_IMPORT_TYPES 41
# define OSSL_FUNC_KEYMGMT_EXPORT 42
OSSL_CORE_MAKE_FUNC(const OSSL_PARAM *, OP_keymgmt_export_types,
(int selection))
+/* Copy function, only works for matching keymgmt */
+# define OSSL_FUNC_KEYMGMT_COPY 44
+OSSL_CORE_MAKE_FUNC(int, OP_keymgmt_copy,
+ ( void *keydata_to, const void *keydata_from,
+ int selection))
+
/* Key Exchange */
# define OSSL_FUNC_KEYEXCH_NEWCTX 1