summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorRichard Levitte <levitte@openssl.org>2019-10-14 08:41:17 +0200
committerRichard Levitte <levitte@openssl.org>2019-10-17 13:01:14 +0200
commit02f060d17e667a2805eb0c71266c35de9e7e3864 (patch)
treebaa05788336ac5001d1d8b0f7a2ff5b9ee0f6e45 /include
parentc00d9311c1a8fc7f25a65dcfbdfc90d4e7709e23 (diff)
PKEY: adapt the export_to_provider funtions to handle domain params too
Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/10169)
Diffstat (limited to 'include')
-rw-r--r--include/crypto/asn1.h3
-rw-r--r--include/crypto/evp.h13
2 files changed, 10 insertions, 6 deletions
diff --git a/include/crypto/asn1.h b/include/crypto/asn1.h
index 674fa704a1..2581619831 100644
--- a/include/crypto/asn1.h
+++ b/include/crypto/asn1.h
@@ -70,7 +70,8 @@ struct evp_pkey_asn1_method_st {
*/
/* Exports to providers */
size_t (*dirty_cnt) (const EVP_PKEY *pk);
- void *(*export_to) (const EVP_PKEY *pk, EVP_KEYMGMT *keymgmt);
+ void *(*export_to) (const EVP_PKEY *pk, EVP_KEYMGMT *keymgmt,
+ int want_domainparams);
} /* EVP_PKEY_ASN1_METHOD */ ;
DEFINE_STACK_OF_CONST(EVP_PKEY_ASN1_METHOD)
diff --git a/include/crypto/evp.h b/include/crypto/evp.h
index 22ef7e5602..dad7174bc5 100644
--- a/include/crypto/evp.h
+++ b/include/crypto/evp.h
@@ -538,13 +538,15 @@ struct evp_pkey_st {
/*
* To support transparent export/import between providers that
* support the methods for it, and still not having to do the
- * export/import every time a key is used, we maintain a cache
- * of imported key, indexed by provider address.
- * pkeys[0] is *always* the "original" key.
+ * export/import every time a key or domain params are used, we
+ * maintain a cache of imported key / domain params, indexed by
+ * provider address. pkeys[0] is *always* the "original" data.
*/
struct {
EVP_KEYMGMT *keymgmt;
- void *provkey;
+ void *provdata;
+ /* 0 = provdata is a key, 1 = provdata is domain params */
+ int domainparams;
} pkeys[10];
/*
* If there is a legacy key assigned to this structure, we keep
@@ -569,7 +571,8 @@ void evp_cleanup_int(void);
void evp_app_cleanup_int(void);
/* KEYMGMT helper functions */
-void *evp_keymgmt_export_to_provider(EVP_PKEY *pk, EVP_KEYMGMT *keymgmt);
+void *evp_keymgmt_export_to_provider(EVP_PKEY *pk, EVP_KEYMGMT *keymgmt,
+ int domainparams);
void evp_keymgmt_clear_pkey_cache(EVP_PKEY *pk);
/* KEYMGMT provider interface functions */