aboutsummaryrefslogtreecommitdiff
path: root/include/openssl
diff options
context:
space:
mode:
authorRichard Levitte <levitte@openssl.org>2020-01-08 03:44:28 +0100
committerRichard Levitte <levitte@openssl.org>2020-01-17 09:04:04 +0100
commit6508e858836020622efff5dd4be3fa4530d1584b (patch)
treeec7f0d78108dadd5762d07cc373f67af5a931464 /include/openssl
parente4a1d0230016d090ba78bc7092384315f85b0e72 (diff)
downloadopenssl-6508e858836020622efff5dd4be3fa4530d1584b.zip
openssl-6508e858836020622efff5dd4be3fa4530d1584b.tar.gz
openssl-6508e858836020622efff5dd4be3fa4530d1584b.tar.bz2
EVP: make EVP_PKEY_{bits,security_bits,size} work with provider only keys
These functions relied entirely on the presence of 'pkey->pmeth', which is NULL on provider only keys. This adds an interface to get domparam and key data from a provider, given corresponding provider data (the actual domparam or key). The retrieved data is cached in the EVP_PKEY structure (lending the idea from provided EVP_CIPHER). Reviewed-by: Nicola Tuveri <nic.tuv@gmail.com> (Merged from https://github.com/openssl/openssl/pull/10778)
Diffstat (limited to 'include/openssl')
-rw-r--r--include/openssl/core_names.h5
-rw-r--r--include/openssl/core_numbers.h17
2 files changed, 21 insertions, 1 deletions
diff --git a/include/openssl/core_names.h b/include/openssl/core_names.h
index 0bc51b3..a347d96 100644
--- a/include/openssl/core_names.h
+++ b/include/openssl/core_names.h
@@ -154,6 +154,11 @@ extern "C" {
#define OSSL_KDF_NAME_KRB5KDF "KRB5KDF"
/* PKEY parameters */
+/* Common PKEY parameters */
+#define OSSL_PKEY_PARAM_BITS "bits" /* integer */
+#define OSSL_PKEY_PARAM_MAX_SIZE "max-size" /* integer */
+#define OSSL_PKEY_PARAM_SECURITY_BITS "security-bits" /* integer */
+
/* Diffie-Hellman/DSA Parameters */
#define OSSL_PKEY_PARAM_FFC_P "p"
#define OSSL_PKEY_PARAM_FFC_G "g"
diff --git a/include/openssl/core_numbers.h b/include/openssl/core_numbers.h
index f41f7c0..0a809de 100644
--- a/include/openssl/core_numbers.h
+++ b/include/openssl/core_numbers.h
@@ -371,6 +371,14 @@ OSSL_CORE_MAKE_FUNC(const OSSL_PARAM *, OP_keymgmt_importdomparam_types,
OSSL_CORE_MAKE_FUNC(const OSSL_PARAM *, OP_keymgmt_exportdomparam_types,
(void))
+/* Key domain parameter information */
+#define OSSL_FUNC_KEYMGMT_GET_DOMPARAM_PARAMS 7
+#define OSSL_FUNC_KEYMGMT_GETTABLE_DOMPARAM_PARAMS 8
+OSSL_CORE_MAKE_FUNC(int, OP_keymgmt_get_domparam_params,
+ (void *domparam, OSSL_PARAM params[]))
+OSSL_CORE_MAKE_FUNC(const OSSL_PARAM *, OP_keymgmt_gettable_domparam_params,
+ (void))
+
/* Key creation and destruction */
# define OSSL_FUNC_KEYMGMT_IMPORTKEY 10
# define OSSL_FUNC_KEYMGMT_GENKEY 11
@@ -400,8 +408,15 @@ OSSL_CORE_MAKE_FUNC(int, OP_keymgmt_exportkey,
OSSL_CORE_MAKE_FUNC(const OSSL_PARAM *, OP_keymgmt_importkey_types, (void))
OSSL_CORE_MAKE_FUNC(const OSSL_PARAM *, OP_keymgmt_exportkey_types, (void))
+/* Key information */
+#define OSSL_FUNC_KEYMGMT_GET_KEY_PARAMS 17
+#define OSSL_FUNC_KEYMGMT_GETTABLE_KEY_PARAMS 18
+OSSL_CORE_MAKE_FUNC(int, OP_keymgmt_get_key_params,
+ (void *key, OSSL_PARAM params[]))
+OSSL_CORE_MAKE_FUNC(const OSSL_PARAM *, OP_keymgmt_gettable_key_params, (void))
+
/* Discovery of supported operations */
-# define OSSL_FUNC_KEYMGMT_QUERY_OPERATION_NAME 17
+# define OSSL_FUNC_KEYMGMT_QUERY_OPERATION_NAME 20
OSSL_CORE_MAKE_FUNC(const char *,OP_keymgmt_query_operation_name,
(int operation_id))