diff options
author | Matt Caswell <matt@openssl.org> | 2019-06-27 17:37:44 +0200 |
---|---|---|
committer | Matt Caswell <matt@openssl.org> | 2019-07-16 11:16:32 +0200 |
commit | 35aca9eccbaf0abbd0d7f350e199a7c97274845a (patch) | |
tree | d3c32308bc57ed087f788e133ce1b1a62e5af5c9 /crypto/evp/exchange.c | |
parent | Enable PKCS#3 DH in the providers (diff) | |
download | openssl-35aca9eccbaf0abbd0d7f350e199a7c97274845a.tar.xz openssl-35aca9eccbaf0abbd0d7f350e199a7c97274845a.zip |
Add the ability to set PKCS#3 DH padding in providers
This also adds the ability to set arbitrary parameters on key exchange
algorithms. The ability to pad the output is one such parameter for DH.
Reviewed-by: Paul Dale <paul.dale@oracle.com>
(Merged from https://github.com/openssl/openssl/pull/9266)
Diffstat (limited to 'crypto/evp/exchange.c')
-rw-r--r-- | crypto/evp/exchange.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/crypto/evp/exchange.c b/crypto/evp/exchange.c index 479cc0d42d..208bb9885a 100644 --- a/crypto/evp/exchange.c +++ b/crypto/evp/exchange.c @@ -76,13 +76,19 @@ static void *evp_keyexch_from_dispatch(const OSSL_DISPATCH *fns, break; exchange->dupctx = OSSL_get_OP_keyexch_dupctx(fns); break; + case OSSL_FUNC_KEYEXCH_SET_PARAMS: + if (exchange->set_params != NULL) + break; + exchange->set_params = OSSL_get_OP_keyexch_set_params(fns); + break; } } if (fncnt != 4) { /* * In order to be a consistent set of functions we must have at least * a complete set of "exchange" functions: init, derive, newctx, - * and freectx. The dupctx and set_peer functions are optional. + * and freectx. The dupctx, set_peer and set_params functions are + * optional. */ EVP_KEYEXCH_free(exchange); EVPerr(EVP_F_EVP_KEYEXCH_FROM_DISPATCH, |