The recent move of the DH code into the default provider broke no-dh. This
adds back in various missing guards.
Reviewed-by: Tim Hudson <tjh@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/9399)
/*
* TODO(3.0): Temporarily unavailable in FIPS mode. This will need to be added
* in later.
*/
/*
* TODO(3.0): Temporarily unavailable in FIPS mode. This will need to be added
* in later.
*/
typedef struct {
/* Number of the current param */
size_t curr;
typedef struct {
/* Number of the current param */
size_t curr;
return param_template_to_param(&tmpl, sz);
}
return param_template_to_param(&tmpl, sz);
}
+# endif /* OPENSSL_NO_DH */
OSSL_PARAM *evp_pkey_to_param(EVP_PKEY *pkey, size_t *sz)
{
switch (pkey->type) {
OSSL_PARAM *evp_pkey_to_param(EVP_PKEY *pkey, size_t *sz)
{
switch (pkey->type) {
case EVP_PKEY_DH:
return evp_pkey_dh_to_param(pkey, sz);
case EVP_PKEY_DH:
return evp_pkey_dh_to_param(pkey, sz);
int EVP_PKEY_CTX_set_dh_pad(EVP_PKEY_CTX *ctx, int pad)
{
OSSL_PARAM dh_pad_params[2];
int EVP_PKEY_CTX_set_dh_pad(EVP_PKEY_CTX *ctx, int pad)
{
OSSL_PARAM dh_pad_params[2];
return EVP_PKEY_CTX_set_params(ctx, dh_pad_params);
}
return EVP_PKEY_CTX_set_params(ctx, dh_pad_params);
}
static int legacy_ctrl_to_param(EVP_PKEY_CTX *ctx, int keytype, int optype,
int cmd, int p1, void *p2)
{
switch (cmd) {
static int legacy_ctrl_to_param(EVP_PKEY_CTX *ctx, int keytype, int optype,
int cmd, int p1, void *p2)
{
switch (cmd) {
case EVP_PKEY_CTRL_DH_PAD:
return EVP_PKEY_CTX_set_dh_pad(ctx, p1);
case EVP_PKEY_CTRL_DH_PAD:
return EVP_PKEY_CTX_set_dh_pad(ctx, p1);
static int legacy_ctrl_str_to_param(EVP_PKEY_CTX *ctx, const char *name,
const char *value)
{
static int legacy_ctrl_str_to_param(EVP_PKEY_CTX *ctx, const char *name,
const char *value)
{
if (strcmp(name, "dh_pad") == 0) {
int pad;
pad = atoi(value);
return EVP_PKEY_CTX_set_dh_pad(ctx, pad);
}
if (strcmp(name, "dh_pad") == 0) {
int pad;
pad = atoi(value);
return EVP_PKEY_CTX_set_dh_pad(ctx, pad);
}
-SOURCE[../../../libcrypto]=\
- dh.c
+IF[{- !$disabled{dh} -}]
+ SOURCE[../../../libcrypto]=\
+ dh.c
+ENDIF
};
static const OSSL_ALGORITHM deflt_keyexch[] = {
};
static const OSSL_ALGORITHM deflt_keyexch[] = {
{ "dhKeyAgreement", "default=yes", dh_functions },
{ "dhKeyAgreement", "default=yes", dh_functions },