diff options
author | Pauli <paul.dale@oracle.com> | 2019-08-21 18:52:32 +1000 |
---|---|---|
committer | Pauli <paul.dale@oracle.com> | 2019-09-06 19:27:57 +1000 |
commit | 2f7557016c8fa9a8ad2d0ba7d7b927a189d0369e (patch) | |
tree | adc8a2ff04adc572ba629507f2832e4b1eebbf5c /include | |
parent | bf5739a0263ced7c70d94fbd73e8a840dabaf077 (diff) |
KDF additons to names and numbers
Reviewed-by: Richard Levitte <levitte@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/9662)
Diffstat (limited to 'include')
-rw-r--r-- | include/openssl/core_names.h | 25 | ||||
-rw-r--r-- | include/openssl/core_numbers.h | 30 |
2 files changed, 55 insertions, 0 deletions
diff --git a/include/openssl/core_names.h b/include/openssl/core_names.h index 2fe06dc272..1d8857295c 100644 --- a/include/openssl/core_names.h +++ b/include/openssl/core_names.h @@ -92,6 +92,31 @@ extern "C" { #define OSSL_MAC_NAME_KMAC128 "KMAC128" #define OSSL_MAC_NAME_KMAC256 "KMAC256" +/* KDF / PRF parameters */ +#define OSSL_KDF_PARAM_SECRET "secret" /* octet string */ +#define OSSL_KDF_PARAM_KEY "key" /* octet string */ +#define OSSL_KDF_PARAM_SALT "salt" /* octet string */ +#define OSSL_KDF_PARAM_PASSWORD "pass" /* octet string */ +#define OSSL_KDF_PARAM_DIGEST "digest" /* utf8 string */ +#define OSSL_KDF_PARAM_MAC "mac" /* utf8 string */ +#define OSSL_KDF_PARAM_MAC_SIZE "maclen" /* size_t */ +#define OSSL_KDF_PARAM_PROPERTIES "properties" /* utf8 string */ +#define OSSL_KDF_PARAM_ITER "iter" /* unsigned int */ +#define OSSL_KDF_PARAM_MODE "mode" /* utf8 string or int */ +#define OSSL_KDF_PARAM_PKCS5 "pkcs5" /* int */ +#define OSSL_KDF_PARAM_UKM "ukm" /* octet string */ +#define OSSL_KDF_PARAM_CEK_ALG "cekalg" /* utf8 string */ +#define OSSL_KDF_PARAM_SCRYPT_N "n" /* uint64_t */ +#define OSSL_KDF_PARAM_SCRYPT_R "r" /* uint32_t */ +#define OSSL_KDF_PARAM_SCRYPT_P "p" /* uint32_t */ +#define OSSL_KDF_PARAM_SCRYPT_MAXMEM "maxmem_bytes" /* uint64_t */ +#define OSSL_KDF_PARAM_INFO "info" /* octet string */ +#define OSSL_KDF_PARAM_SEED "seed" /* octet string */ +#define OSSL_KDF_PARAM_SSHKDF_XCGHASH "xcghash" /* octet string */ +#define OSSL_KDF_PARAM_SSHKDF_SESSION_ID "session_id" /* octet string */ +#define OSSL_KDF_PARAM_SSHKDF_TYPE "type" /* int */ +#define OSSL_KDF_PARAM_SIZE "size" /* size_t */ + /* PKEY parameters */ /* Diffie-Hellman Parameters */ #define OSSL_PKEY_PARAM_DH_P "dh-p" diff --git a/include/openssl/core_numbers.h b/include/openssl/core_numbers.h index e39410893e..4fd91b465c 100644 --- a/include/openssl/core_numbers.h +++ b/include/openssl/core_numbers.h @@ -281,6 +281,36 @@ OSSL_CORE_MAKE_FUNC(int, OP_mac_get_ctx_params, OSSL_CORE_MAKE_FUNC(int, OP_mac_set_ctx_params, (void *mctx, const OSSL_PARAM params[])) +/* KDFs and PRFs */ +# define OSSL_OP_KDF 4 + +# define OSSL_FUNC_KDF_NEWCTX 1 +# define OSSL_FUNC_KDF_DUPCTX 2 +# define OSSL_FUNC_KDF_FREECTX 3 +# define OSSL_FUNC_KDF_RESET 4 +# define OSSL_FUNC_KDF_DERIVE 5 +# define OSSL_FUNC_KDF_GETTABLE_PARAMS 6 +# define OSSL_FUNC_KDF_GETTABLE_CTX_PARAMS 7 +# define OSSL_FUNC_KDF_SETTABLE_CTX_PARAMS 8 +# define OSSL_FUNC_KDF_GET_PARAMS 9 +# define OSSL_FUNC_KDF_GET_CTX_PARAMS 10 +# define OSSL_FUNC_KDF_SET_CTX_PARAMS 11 + +OSSL_CORE_MAKE_FUNC(void *, OP_kdf_newctx, (void *provctx)) +OSSL_CORE_MAKE_FUNC(void *, OP_kdf_dupctx, (void *src)) +OSSL_CORE_MAKE_FUNC(void, OP_kdf_freectx, (void *kctx)) +OSSL_CORE_MAKE_FUNC(void, OP_kdf_reset, (void *kctx)) +OSSL_CORE_MAKE_FUNC(int, OP_kdf_derive, (void *kctx, unsigned char *key, + size_t keylen)) +OSSL_CORE_MAKE_FUNC(const OSSL_PARAM *, OP_kdf_gettable_params, (void)) +OSSL_CORE_MAKE_FUNC(const OSSL_PARAM *, OP_kdf_gettable_ctx_params, (void)) +OSSL_CORE_MAKE_FUNC(const OSSL_PARAM *, OP_kdf_settable_ctx_params, (void)) +OSSL_CORE_MAKE_FUNC(int, OP_kdf_get_params, (OSSL_PARAM params[])) +OSSL_CORE_MAKE_FUNC(int, OP_kdf_get_ctx_params, + (void *kctx, OSSL_PARAM params[])) +OSSL_CORE_MAKE_FUNC(int, OP_kdf_set_ctx_params, + (void *kctx, const OSSL_PARAM params[])) + /*- * Key management * |