providers/common/include/prov/der_hkdf.h
providers/implementations/asymciphers/rsa_enc.inc
providers/implementations/asymciphers/sm2_enc.inc
-providers/implementations/exchange/dh_exch.c
-providers/implementations/exchange/ecdh_exch.c
-providers/implementations/exchange/ecx_exch.c
+providers/implementations/exchange/dh_exch.inc
+providers/implementations/exchange/ecdh_exch.inc
+providers/implementations/exchange/ecx_exch.inc
providers/implementations/encode_decode/decode_der2key.inc
providers/implementations/encode_decode/decode_epki2pki.inc
providers/implementations/encode_decode/decode_pem2der.inc
include/crypto/bn_conf.h include/crypto/dso_conf.h \
providers/implementations/asymciphers/rsa_enc.inc \
providers/implementations/asymciphers/sm2_enc.inc \
- providers/implementations/exchange/dh_exch.c \
- providers/implementations/exchange/ecdh_exch.c \
- providers/implementations/exchange/ecx_exch.c \
+ providers/implementations/exchange/dh_exch.inc \
+ providers/implementations/exchange/ecdh_exch.inc \
+ providers/implementations/exchange/ecx_exch.inc \
providers/implementations/encode_decode/decode_der2key.inc \
providers/implementations/encode_decode/decode_epki2pki.inc \
providers/implementations/encode_decode/decode_pem2der.inc \
DEPEND[providers/implementations/asymciphers/rsa_enc.inc \
providers/implementations/asymciphers/sm2_enc.inc \
- providers/implementations/exchange/dh_exch.c \
- providers/implementations/exchange/ecdh_exch.c \
- providers/implementations/exchange/ecx_exch.c \
+ providers/implementations/exchange/dh_exch.inc \
+ providers/implementations/exchange/ecdh_exch.inc \
+ providers/implementations/exchange/ecx_exch.inc \
providers/implementations/encode_decode/decode_der2key.inc \
providers/implementations/encode_decode/decode_epki2pki.inc \
providers/implementations/encode_decode/decode_pem2der.inc \
providers/implementations/asymciphers/rsa_enc.inc.in
GENERATE[providers/implementations/asymciphers/sm2_enc.inc]=\
providers/implementations/asymciphers/sm2_enc.inc.in
-GENERATE[providers/implementations/exchange/dh_exch.c]=\
- providers/implementations/exchange/dh_exch.c.in
-GENERATE[providers/implementations/exchange/ecdh_exch.c]=\
- providers/implementations/exchange/ecdh_exch.c.in
-GENERATE[providers/implementations/exchange/ecx_exch.c]=\
- providers/implementations/exchange/ecx_exch.c.in
+GENERATE[providers/implementations/exchange/dh_exch.inc]=\
+ providers/implementations/exchange/dh_exch.inc.in
+GENERATE[providers/implementations/exchange/ecdh_exch.inc]=\
+ providers/implementations/exchange/ecdh_exch.inc.in
+GENERATE[providers/implementations/exchange/ecx_exch.inc]=\
+ providers/implementations/exchange/ecx_exch.inc.in
GENERATE[providers/implementations/encode_decode/decode_der2key.inc]=\
providers/implementations/encode_decode/decode_der2key.inc.in
GENERATE[providers/implementations/encode_decode/decode_epki2pki.inc]=\
* in the file LICENSE in the source distribution or at
* https://www.openssl.org/source/license.html
*/
-{-
-use OpenSSL::paramnames qw(produce_param_decoder);
--}
/*
* DH low level APIs are deprecated for public use, but still ok for
#include "prov/provider_ctx.h"
#include "prov/securitycheck.h"
#include "crypto/dh.h"
+#include "providers/implementations/exchange/dh_exch.inc"
static OSSL_FUNC_keyexch_newctx_fn dh_newctx;
static OSSL_FUNC_keyexch_init_fn dh_init;
return NULL;
}
-{- produce_param_decoder('dh_set_ctx_params',
- (['OSSL_EXCHANGE_PARAM_PAD', 'pad', 'int'],
- ['OSSL_EXCHANGE_PARAM_KDF_TYPE', 'kdf', 'utf8_string'],
- ['OSSL_EXCHANGE_PARAM_KDF_DIGEST', 'digest', 'utf8_string'],
- ['OSSL_EXCHANGE_PARAM_KDF_DIGEST_PROPS', 'propq', 'utf8_string'],
- ['OSSL_EXCHANGE_PARAM_KDF_OUTLEN', 'len', 'size_t'],
- ['OSSL_EXCHANGE_PARAM_KDF_UKM', 'ukm', 'octet_string'],
- ['OSSL_KDF_PARAM_CEK_ALG', 'cekalg', 'utf8_string'],
- ['OSSL_EXCHANGE_PARAM_FIPS_KEY_CHECK', 'ind_k', 'int', 'fips'],
- ['OSSL_EXCHANGE_PARAM_FIPS_DIGEST_CHECK', 'ind_d', 'int', 'fips'],
- )); -}
-
static int dh_set_ctx_params(void *vpdhctx, const OSSL_PARAM params[])
{
PROV_DH_CTX *pdhctx = (PROV_DH_CTX *)vpdhctx;
return dh_set_ctx_params_list;
}
-{- produce_param_decoder('dh_get_ctx_params',
- (['OSSL_EXCHANGE_PARAM_KDF_TYPE', 'kdf', 'utf8_string'],
- ['OSSL_EXCHANGE_PARAM_KDF_DIGEST', 'digest', 'utf8_string'],
- ['OSSL_EXCHANGE_PARAM_KDF_OUTLEN', 'len', 'size_t'],
- ['OSSL_EXCHANGE_PARAM_KDF_UKM', 'ukm', 'octet_ptr'],
- ['OSSL_KDF_PARAM_CEK_ALG', 'cekalg', 'utf8_string'],
- ['OSSL_ALG_PARAM_FIPS_APPROVED_INDICATOR', 'ind', 'int', 'fips'],
- )); -}
-
static const OSSL_PARAM *dh_gettable_ctx_params(ossl_unused void *vpdhctx,
ossl_unused void *provctx)
{
--- /dev/null
+/*
+ * Copyright 2025 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License 2.0 (the \"License\"). You may not use
+ * this file except in compliance with the License. You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+{-
+use OpenSSL::paramnames qw(produce_param_decoder);
+-}
+
+{- produce_param_decoder('dh_set_ctx_params',
+ (['OSSL_EXCHANGE_PARAM_PAD', 'pad', 'int'],
+ ['OSSL_EXCHANGE_PARAM_KDF_TYPE', 'kdf', 'utf8_string'],
+ ['OSSL_EXCHANGE_PARAM_KDF_DIGEST', 'digest', 'utf8_string'],
+ ['OSSL_EXCHANGE_PARAM_KDF_DIGEST_PROPS', 'propq', 'utf8_string'],
+ ['OSSL_EXCHANGE_PARAM_KDF_OUTLEN', 'len', 'size_t'],
+ ['OSSL_EXCHANGE_PARAM_KDF_UKM', 'ukm', 'octet_string'],
+ ['OSSL_KDF_PARAM_CEK_ALG', 'cekalg', 'utf8_string'],
+ ['OSSL_EXCHANGE_PARAM_FIPS_KEY_CHECK', 'ind_k', 'int', 'fips'],
+ ['OSSL_EXCHANGE_PARAM_FIPS_DIGEST_CHECK', 'ind_d', 'int', 'fips'],
+ )); -}
+
+{- produce_param_decoder('dh_get_ctx_params',
+ (['OSSL_EXCHANGE_PARAM_KDF_TYPE', 'kdf', 'utf8_string'],
+ ['OSSL_EXCHANGE_PARAM_KDF_DIGEST', 'digest', 'utf8_string'],
+ ['OSSL_EXCHANGE_PARAM_KDF_OUTLEN', 'len', 'size_t'],
+ ['OSSL_EXCHANGE_PARAM_KDF_UKM', 'ukm', 'octet_ptr'],
+ ['OSSL_KDF_PARAM_CEK_ALG', 'cekalg', 'utf8_string'],
+ ['OSSL_ALG_PARAM_FIPS_APPROVED_INDICATOR', 'ind', 'int', 'fips'],
+ )); -}
* in the file LICENSE in the source distribution or at
* https://www.openssl.org/source/license.html
*/
-{-
-use OpenSSL::paramnames qw(produce_param_decoder);
--}
/*
* ECDH low level APIs are deprecated for public use, but still ok for
#include "prov/implementations.h"
#include "prov/securitycheck.h"
#include "crypto/ec.h" /* ossl_ecdh_kdf_X9_63() */
+#include "providers/implementations/exchange/ecdh_exch.inc"
static OSSL_FUNC_keyexch_newctx_fn ecdh_newctx;
static OSSL_FUNC_keyexch_init_fn ecdh_init;
return NULL;
}
-{- produce_param_decoder('ecdh_set_ctx_params',
- (['OSSL_EXCHANGE_PARAM_EC_ECDH_COFACTOR_MODE', 'mode', 'int'],
- ['OSSL_EXCHANGE_PARAM_KDF_TYPE', 'kdf', 'utf8_string'],
- ['OSSL_EXCHANGE_PARAM_KDF_DIGEST', 'digest', 'utf8_string'],
- ['OSSL_EXCHANGE_PARAM_KDF_DIGEST_PROPS', 'propq', 'utf8_string'],
- ['OSSL_EXCHANGE_PARAM_KDF_OUTLEN', 'len', 'size_t'],
- ['OSSL_EXCHANGE_PARAM_KDF_UKM', 'ukm', 'octet_string'],
- ['OSSL_EXCHANGE_PARAM_FIPS_KEY_CHECK', 'ind_k', 'int', 'fips'],
- ['OSSL_EXCHANGE_PARAM_FIPS_DIGEST_CHECK', 'ind_d', 'int', 'fips'],
- ['OSSL_EXCHANGE_PARAM_FIPS_ECDH_COFACTOR_CHECK', 'ind_cofac', 'int', 'fips'],
- )); -}
-
static
int ecdh_set_ctx_params(void *vpecdhctx, const OSSL_PARAM params[])
{
return ecdh_set_ctx_params_list;
}
-{- produce_param_decoder('ecdh_get_ctx_params',
- (['OSSL_EXCHANGE_PARAM_EC_ECDH_COFACTOR_MODE', 'mode', 'int'],
- ['OSSL_EXCHANGE_PARAM_KDF_TYPE', 'kdf', 'utf8_string'],
- ['OSSL_EXCHANGE_PARAM_KDF_DIGEST', 'digest', 'utf8_string'],
- ['OSSL_EXCHANGE_PARAM_KDF_OUTLEN', 'len', 'size_t'],
- ['OSSL_EXCHANGE_PARAM_KDF_UKM', 'ukm', 'octet_ptr'],
- ['OSSL_ALG_PARAM_FIPS_APPROVED_INDICATOR', 'ind', 'int', 'fips'],
- )); -}
-
static
int ecdh_get_ctx_params(void *vpecdhctx, OSSL_PARAM params[])
{
--- /dev/null
+/*
+ * Copyright 2025 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License 2.0 (the \"License\"). You may not use
+ * this file except in compliance with the License. You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+{-
+use OpenSSL::paramnames qw(produce_param_decoder);
+-}
+
+{- produce_param_decoder('ecdh_set_ctx_params',
+ (['OSSL_EXCHANGE_PARAM_EC_ECDH_COFACTOR_MODE', 'mode', 'int'],
+ ['OSSL_EXCHANGE_PARAM_KDF_TYPE', 'kdf', 'utf8_string'],
+ ['OSSL_EXCHANGE_PARAM_KDF_DIGEST', 'digest', 'utf8_string'],
+ ['OSSL_EXCHANGE_PARAM_KDF_DIGEST_PROPS', 'propq', 'utf8_string'],
+ ['OSSL_EXCHANGE_PARAM_KDF_OUTLEN', 'len', 'size_t'],
+ ['OSSL_EXCHANGE_PARAM_KDF_UKM', 'ukm', 'octet_string'],
+ ['OSSL_EXCHANGE_PARAM_FIPS_KEY_CHECK', 'ind_k', 'int', 'fips'],
+ ['OSSL_EXCHANGE_PARAM_FIPS_DIGEST_CHECK', 'ind_d', 'int', 'fips'],
+ ['OSSL_EXCHANGE_PARAM_FIPS_ECDH_COFACTOR_CHECK', 'ind_cofac', 'int', 'fips'],
+ )); -}
+
+{- produce_param_decoder('ecdh_get_ctx_params',
+ (['OSSL_EXCHANGE_PARAM_EC_ECDH_COFACTOR_MODE', 'mode', 'int'],
+ ['OSSL_EXCHANGE_PARAM_KDF_TYPE', 'kdf', 'utf8_string'],
+ ['OSSL_EXCHANGE_PARAM_KDF_DIGEST', 'digest', 'utf8_string'],
+ ['OSSL_EXCHANGE_PARAM_KDF_OUTLEN', 'len', 'size_t'],
+ ['OSSL_EXCHANGE_PARAM_KDF_UKM', 'ukm', 'octet_ptr'],
+ ['OSSL_ALG_PARAM_FIPS_APPROVED_INDICATOR', 'ind', 'int', 'fips'],
+ )); -}
* in the file LICENSE in the source distribution or at
* https://www.openssl.org/source/license.html
*/
-{-
-use OpenSSL::paramnames qw(produce_param_decoder);
--}
#include <openssl/crypto.h>
#include <openssl/core_dispatch.h>
#include "prov/providercommon.h"
#include "prov/securitycheck.h"
+#ifdef FIPS_MODULE
+# include "providers/implementations/exchange/ecx_exch.inc"
+#endif
+
static OSSL_FUNC_keyexch_newctx_fn x25519_newctx;
static OSSL_FUNC_keyexch_newctx_fn x448_newctx;
static OSSL_FUNC_keyexch_init_fn x25519_init;
}
#ifdef FIPS_MODULE
-{- produce_param_decoder('ecx_get_ctx_params',
- (['OSSL_ALG_PARAM_FIPS_APPROVED_INDICATOR', 'ind', 'int', 'fips'],
- )); -}
+
#endif
static const OSSL_PARAM *ecx_gettable_ctx_params(ossl_unused void *vctx,
--- /dev/null
+/*
+ * Copyright 2025 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License 2.0 (the \"License\"). You may not use
+ * this file except in compliance with the License. You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+{-
+use OpenSSL::paramnames qw(produce_param_decoder);
+-}
+
+{- produce_param_decoder('ecx_get_ctx_params',
+ (['OSSL_ALG_PARAM_FIPS_APPROVED_INDICATOR', 'ind', 'int', 'fips'],
+ )); -}