summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorRichard Levitte <levitte@openssl.org>2020-09-04 18:00:29 +0200
committerRichard Levitte <levitte@openssl.org>2020-09-08 12:07:40 +0200
commit8d6481f532ab8c502de2ad17e09f688abb675a71 (patch)
tree7c7a472963f32cd077cc28bbbf76cca62ee971fa /include
parentb968945204130620b1328f585610cbe1d6b5a69e (diff)
EVP: Move the functions and controls for setting and getting distid
Those functions were located in the EC files, but is really broader than that, even thought currently only used for SM2. They should therefore be in a more central location, which was also indicated by diverse TODOs. Reviewed-by: Shane Lontis <shane.lontis@oracle.com> (Merged from https://github.com/openssl/openssl/pull/12789)
Diffstat (limited to 'include')
-rw-r--r--include/openssl/ec.h8
-rw-r--r--include/openssl/evp.h8
2 files changed, 7 insertions, 9 deletions
diff --git a/include/openssl/ec.h b/include/openssl/ec.h
index 24605d0055..9e0a6486cd 100644
--- a/include/openssl/ec.h
+++ b/include/openssl/ec.h
@@ -1492,10 +1492,6 @@ int EVP_PKEY_CTX_set0_ecdh_kdf_ukm(EVP_PKEY_CTX *ctx, unsigned char *ukm,
int len);
int EVP_PKEY_CTX_get0_ecdh_kdf_ukm(EVP_PKEY_CTX *ctx, unsigned char **ukm);
-int EVP_PKEY_CTX_set1_id(EVP_PKEY_CTX *ctx, const void *id, int len);
-int EVP_PKEY_CTX_get1_id(EVP_PKEY_CTX *ctx, void *id);
-int EVP_PKEY_CTX_get1_id_len(EVP_PKEY_CTX *ctx, size_t *id_len);
-
# define EVP_PKEY_CTRL_EC_PARAMGEN_CURVE_NID (EVP_PKEY_ALG_CTRL + 1)
# define EVP_PKEY_CTRL_EC_PARAM_ENC (EVP_PKEY_ALG_CTRL + 2)
# define EVP_PKEY_CTRL_EC_ECDH_COFACTOR (EVP_PKEY_ALG_CTRL + 3)
@@ -1506,10 +1502,6 @@ int EVP_PKEY_CTX_get1_id_len(EVP_PKEY_CTX *ctx, size_t *id_len);
# define EVP_PKEY_CTRL_GET_EC_KDF_OUTLEN (EVP_PKEY_ALG_CTRL + 8)
# define EVP_PKEY_CTRL_EC_KDF_UKM (EVP_PKEY_ALG_CTRL + 9)
# define EVP_PKEY_CTRL_GET_EC_KDF_UKM (EVP_PKEY_ALG_CTRL + 10)
-/* TODO move next three #defines to evp.h when 'breaking' change is possible */
-# define EVP_PKEY_CTRL_SET1_ID 15
-# define EVP_PKEY_CTRL_GET1_ID 16
-# define EVP_PKEY_CTRL_GET1_ID_LEN 17
/* KDF types */
# define EVP_PKEY_ECDH_KDF_NONE 1
diff --git a/include/openssl/evp.h b/include/openssl/evp.h
index 6bd6e26edf..74f97fd3e2 100644
--- a/include/openssl/evp.h
+++ b/include/openssl/evp.h
@@ -1496,6 +1496,10 @@ void EVP_PKEY_asn1_set_security_bits(EVP_PKEY_ASN1_METHOD *ameth,
int EVP_PKEY_CTX_get_signature_md(EVP_PKEY_CTX *ctx, const EVP_MD **md);
int EVP_PKEY_CTX_set_signature_md(EVP_PKEY_CTX *ctx, const EVP_MD *md);
+int EVP_PKEY_CTX_set1_id(EVP_PKEY_CTX *ctx, const void *id, int len);
+int EVP_PKEY_CTX_get1_id(EVP_PKEY_CTX *ctx, void *id);
+int EVP_PKEY_CTX_get1_id_len(EVP_PKEY_CTX *ctx, size_t *id_len);
+
# define EVP_PKEY_OP_UNDEFINED 0
# define EVP_PKEY_OP_PARAMGEN (1<<1)
# define EVP_PKEY_OP_KEYGEN (1<<2)
@@ -1544,7 +1548,9 @@ int EVP_PKEY_CTX_set_mac_key(EVP_PKEY_CTX *ctx, const unsigned char *key,
# define EVP_PKEY_CTRL_CIPHER 12
# define EVP_PKEY_CTRL_GET_MD 13
# define EVP_PKEY_CTRL_SET_DIGEST_SIZE 14
-/* TODO move here three #defines of EVP_PKEY_CTRL_*ET1_ID* from ec.h */
+# define EVP_PKEY_CTRL_SET1_ID 15
+# define EVP_PKEY_CTRL_GET1_ID 16
+# define EVP_PKEY_CTRL_GET1_ID_LEN 17
# define EVP_PKEY_ALG_CTRL 0x1000