diff options
author | Matt Caswell <matt@openssl.org> | 2020-07-31 16:05:57 +0200 |
---|---|---|
committer | Matt Caswell <matt@openssl.org> | 2020-08-10 15:51:59 +0200 |
commit | 194de849ccb269272b71994edf988dc1cdbafc0d (patch) | |
tree | 2b976cdf01bbabcafaeea67206113f5fb0b0b279 /providers | |
parent | Extend the EVP_PKEY KDF to KDF provider bridge to also support HKDF (diff) | |
download | openssl-194de849ccb269272b71994edf988dc1cdbafc0d.tar.xz openssl-194de849ccb269272b71994edf988dc1cdbafc0d.zip |
Extend the EVP_PKEY KDF to KDF provider bridge to also support Scrypt
Reviewed-by: Paul Dale <paul.dale@oracle.com>
(Merged from https://github.com/openssl/openssl/pull/12573)
Diffstat (limited to 'providers')
-rw-r--r-- | providers/defltprov.c | 2 | ||||
-rw-r--r-- | providers/implementations/exchange/kdf_exch.c | 6 | ||||
-rw-r--r-- | providers/implementations/include/prov/implementations.h | 1 |
3 files changed, 8 insertions, 1 deletions
diff --git a/providers/defltprov.c b/providers/defltprov.c index f2fe98fc7f..00d1800c24 100644 --- a/providers/defltprov.c +++ b/providers/defltprov.c @@ -341,6 +341,7 @@ static const OSSL_ALGORITHM deflt_keyexch[] = { #endif { "TLS1-PRF", "provider=default", kdf_tls1_prf_keyexch_functions }, { "HKDF", "provider=default", kdf_hkdf_keyexch_functions }, + { "SCRYPT:id-scrypt", "provider=default", kdf_scrypt_keyexch_functions }, { NULL, NULL, NULL } }; @@ -388,6 +389,7 @@ static const OSSL_ALGORITHM deflt_keymgmt[] = { #endif { "TLS1-PRF", "provider=default", kdf_keymgmt_functions }, { "HKDF", "provider=default", kdf_keymgmt_functions }, + { "SCRYPT:id-scrypt", "provider=default", kdf_keymgmt_functions }, { NULL, NULL, NULL } }; diff --git a/providers/implementations/exchange/kdf_exch.c b/providers/implementations/exchange/kdf_exch.c index e238b0307b..5943cfcd12 100644 --- a/providers/implementations/exchange/kdf_exch.c +++ b/providers/implementations/exchange/kdf_exch.c @@ -18,6 +18,7 @@ static OSSL_FUNC_keyexch_newctx_fn kdf_tls1_prf_newctx; static OSSL_FUNC_keyexch_newctx_fn kdf_hkdf_newctx; +static OSSL_FUNC_keyexch_newctx_fn kdf_scrypt_newctx; static OSSL_FUNC_keyexch_init_fn kdf_init; static OSSL_FUNC_keyexch_derive_fn kdf_derive; static OSSL_FUNC_keyexch_freectx_fn kdf_freectx; @@ -25,6 +26,7 @@ static OSSL_FUNC_keyexch_dupctx_fn kdf_dupctx; static OSSL_FUNC_keyexch_set_ctx_params_fn kdf_set_ctx_params; static OSSL_FUNC_keyexch_settable_ctx_params_fn kdf_tls1_prf_settable_ctx_params; static OSSL_FUNC_keyexch_settable_ctx_params_fn kdf_hkdf_settable_ctx_params; +static OSSL_FUNC_keyexch_settable_ctx_params_fn kdf_scrypt_settable_ctx_params; typedef struct { void *provctx; @@ -60,7 +62,7 @@ typedef struct { KDF_NEWCTX(tls1_prf, "TLS1-PRF") KDF_NEWCTX(hkdf, "HKDF") - +KDF_NEWCTX(scrypt, "SCRYPT") static int kdf_init(void *vpkdfctx, void *vkdf) { @@ -144,6 +146,7 @@ static int kdf_set_ctx_params(void *vpkdfctx, const OSSL_PARAM params[]) KDF_SETTABLE_CTX_PARAMS(tls1_prf, "TLS1-PRF") KDF_SETTABLE_CTX_PARAMS(hkdf, "HKDF") +KDF_SETTABLE_CTX_PARAMS(scrypt, "SCRYPT") #define KDF_KEYEXCH_FUNCTIONS(funcname) \ @@ -161,3 +164,4 @@ KDF_SETTABLE_CTX_PARAMS(hkdf, "HKDF") KDF_KEYEXCH_FUNCTIONS(tls1_prf) KDF_KEYEXCH_FUNCTIONS(hkdf) +KDF_KEYEXCH_FUNCTIONS(scrypt) diff --git a/providers/implementations/include/prov/implementations.h b/providers/implementations/include/prov/implementations.h index d30a105d2d..9e3ef4d79c 100644 --- a/providers/implementations/include/prov/implementations.h +++ b/providers/implementations/include/prov/implementations.h @@ -284,6 +284,7 @@ extern const OSSL_DISPATCH x448_keyexch_functions[]; extern const OSSL_DISPATCH ecdh_keyexch_functions[]; extern const OSSL_DISPATCH kdf_tls1_prf_keyexch_functions[]; extern const OSSL_DISPATCH kdf_hkdf_keyexch_functions[]; +extern const OSSL_DISPATCH kdf_scrypt_keyexch_functions[]; /* Signature */ extern const OSSL_DISPATCH dsa_signature_functions[]; |