-/* $OpenBSD: s3_lib.c,v 1.222 2022/01/07 15:46:30 jsing Exp $ */
+/* $OpenBSD: s3_lib.c,v 1.223 2022/01/07 16:45:06 jsing Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
static int
_SSL_set_tmp_dh(SSL *s, DH *dh)
{
- DH *dh_tmp;
+ DH *dhe_params;
if (dh == NULL) {
SSLerror(s, ERR_R_PASSED_NULL_PARAMETER);
return 0;
}
- if ((dh_tmp = DHparams_dup(dh)) == NULL) {
+ if ((dhe_params = DHparams_dup(dh)) == NULL) {
SSLerror(s, ERR_R_DH_LIB);
return 0;
}
- DH_free(s->cert->dh_tmp);
- s->cert->dh_tmp = dh_tmp;
+ DH_free(s->cert->dhe_params);
+ s->cert->dhe_params = dhe_params;
return 1;
}
static int
_SSL_set_dh_auto(SSL *s, int state)
{
- s->cert->dh_tmp_auto = state;
+ s->cert->dhe_params_auto = state;
return 1;
}
return 0;
case SSL_CTRL_SET_TMP_DH_CB:
- s->cert->dh_tmp_cb = (DH *(*)(SSL *, int, int))fp;
+ s->cert->dhe_params_cb = (DH *(*)(SSL *, int, int))fp;
return 1;
case SSL_CTRL_SET_TMP_ECDH_CB:
static int
_SSL_CTX_set_tmp_dh(SSL_CTX *ctx, DH *dh)
{
- DH *dh_tmp;
+ DH *dhe_params;
- if ((dh_tmp = DHparams_dup(dh)) == NULL) {
+ if (dh == NULL) {
+ SSLerrorx(ERR_R_PASSED_NULL_PARAMETER);
+ return 0;
+ }
+
+ if ((dhe_params = DHparams_dup(dh)) == NULL) {
SSLerrorx(ERR_R_DH_LIB);
return 0;
}
- DH_free(ctx->internal->cert->dh_tmp);
- ctx->internal->cert->dh_tmp = dh_tmp;
+ DH_free(ctx->internal->cert->dhe_params);
+ ctx->internal->cert->dhe_params = dhe_params;
return 1;
}
static int
_SSL_CTX_set_dh_auto(SSL_CTX *ctx, int state)
{
- ctx->internal->cert->dh_tmp_auto = state;
+ ctx->internal->cert->dhe_params_auto = state;
return 1;
}
return 0;
case SSL_CTRL_SET_TMP_DH_CB:
- ctx->internal->cert->dh_tmp_cb =
+ ctx->internal->cert->dhe_params_cb =
(DH *(*)(SSL *, int, int))fp;
return 1;
-/* $OpenBSD: ssl_cert.c,v 1.90 2022/01/07 15:56:33 jsing Exp $ */
+/* $OpenBSD: ssl_cert.c,v 1.91 2022/01/07 16:45:06 jsing Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
ret->mask_k = cert->mask_k;
ret->mask_a = cert->mask_a;
- if (cert->dh_tmp != NULL) {
- ret->dh_tmp = DHparams_dup(cert->dh_tmp);
- if (ret->dh_tmp == NULL) {
+ if (cert->dhe_params != NULL) {
+ ret->dhe_params = DHparams_dup(cert->dhe_params);
+ if (ret->dhe_params == NULL) {
SSLerrorx(ERR_R_DH_LIB);
goto err;
}
}
- ret->dh_tmp_cb = cert->dh_tmp_cb;
- ret->dh_tmp_auto = cert->dh_tmp_auto;
+ ret->dhe_params_cb = cert->dhe_params_cb;
+ ret->dhe_params_auto = cert->dhe_params_auto;
for (i = 0; i < SSL_PKEY_NUM; i++) {
if (cert->pkeys[i].x509 != NULL) {
return (ret);
err:
- DH_free(ret->dh_tmp);
+ DH_free(ret->dhe_params);
for (i = 0; i < SSL_PKEY_NUM; i++) {
X509_free(ret->pkeys[i].x509);
if (i > 0)
return;
- DH_free(c->dh_tmp);
+ DH_free(c->dhe_params);
for (i = 0; i < SSL_PKEY_NUM; i++) {
X509_free(c->pkeys[i].x509);
-/* $OpenBSD: ssl_lib.c,v 1.280 2021/12/04 14:03:22 jsing Exp $ */
+/* $OpenBSD: ssl_lib.c,v 1.281 2022/01/07 16:45:06 jsing Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
mask_a = SSL_aNULL | SSL_aTLS1_3;
mask_k = SSL_kECDHE | SSL_kTLS1_3;
- if (c->dh_tmp != NULL || c->dh_tmp_cb != NULL || c->dh_tmp_auto != 0)
+ if (c->dhe_params != NULL || c->dhe_params_cb != NULL ||
+ c->dhe_params_auto != 0)
mask_k |= SSL_kDHE;
cpk = &(c->pkeys[SSL_PKEY_ECC]);
CERT_PKEY *cpk;
int key_bits;
- if (s->cert->dh_tmp_auto == 2) {
+ if (s->cert->dhe_params_auto == 2) {
key_bits = 1024;
} else if (S3I(s)->hs.cipher->algorithm_auth & SSL_aNULL) {
key_bits = 1024;
-/* $OpenBSD: ssl_locl.h,v 1.375 2022/01/07 15:46:30 jsing Exp $ */
+/* $OpenBSD: ssl_locl.h,v 1.376 2022/01/07 16:45:06 jsing Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
unsigned long mask_k;
unsigned long mask_a;
- DH *dh_tmp;
- DH *(*dh_tmp_cb)(SSL *ssl, int is_export, int keysize);
- int dh_tmp_auto;
+ DH *dhe_params;
+ DH *(*dhe_params_cb)(SSL *ssl, int is_export, int keysize);
+ int dhe_params_auto;
CERT_PKEY pkeys[SSL_PKEY_NUM];
-/* $OpenBSD: ssl_srvr.c,v 1.131 2022/01/07 15:46:30 jsing Exp $ */
+/* $OpenBSD: ssl_srvr.c,v 1.132 2022/01/07 16:45:06 jsing Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
if ((S3I(s)->hs.key_share = tls_key_share_new_nid(nid)) == NULL)
goto err;
- if (s->cert->dh_tmp_auto != 0) {
+ if (s->cert->dhe_params_auto != 0) {
size_t key_bits;
if ((key_bits = ssl_dhe_params_auto_key_bits(s)) == 0) {
tls_key_share_set_key_bits(S3I(s)->hs.key_share,
key_bits);
} else {
- DH *dh_params = s->cert->dh_tmp;
+ DH *dh_params = s->cert->dhe_params;
- if (dh_params == NULL && s->cert->dh_tmp_cb != NULL)
- dh_params = s->cert->dh_tmp_cb(s, 0,
+ if (dh_params == NULL && s->cert->dhe_params_cb != NULL)
+ dh_params = s->cert->dhe_params_cb(s, 0,
SSL_C_PKEYLENGTH(S3I(s)->hs.cipher));
if (dh_params == NULL) {