Latest update
This commit is contained in:
@@ -1198,7 +1198,7 @@ static EXT_RETURN tls_construct_certificate_authorities(SSL *s, WPACKET *pkt,
|
||||
X509 *x,
|
||||
size_t chainidx)
|
||||
{
|
||||
const STACK_OF(X509_NAME) *ca_sk = SSL_get0_CA_list(s);
|
||||
const STACK_OF(X509_NAME) *ca_sk = get_ca_names(s);
|
||||
|
||||
if (ca_sk == NULL || sk_X509_NAME_num(ca_sk) == 0)
|
||||
return EXT_RETURN_NOT_SENT;
|
||||
@@ -1211,7 +1211,7 @@ static EXT_RETURN tls_construct_certificate_authorities(SSL *s, WPACKET *pkt,
|
||||
return EXT_RETURN_FAIL;
|
||||
}
|
||||
|
||||
if (!construct_ca_names(s, pkt)) {
|
||||
if (!construct_ca_names(s, ca_sk, pkt)) {
|
||||
/* SSLfatal() already called */
|
||||
return EXT_RETURN_FAIL;
|
||||
}
|
||||
|
||||
+32
-4
@@ -1506,7 +1506,8 @@ static int ssl_method_error(const SSL *s, const SSL_METHOD *method)
|
||||
*/
|
||||
static int is_tls13_capable(const SSL *s)
|
||||
{
|
||||
int i;
|
||||
int i, curve;
|
||||
EC_KEY *eckey;
|
||||
|
||||
#ifndef OPENSSL_NO_PSK
|
||||
if (s->psk_server_callback != NULL)
|
||||
@@ -1527,7 +1528,20 @@ static int is_tls13_capable(const SSL *s)
|
||||
default:
|
||||
break;
|
||||
}
|
||||
if (ssl_has_cert(s, i))
|
||||
if (!ssl_has_cert(s, i))
|
||||
continue;
|
||||
if (i != SSL_PKEY_ECC)
|
||||
return 1;
|
||||
/*
|
||||
* Prior to TLSv1.3 sig algs allowed any curve to be used. TLSv1.3 is
|
||||
* more restrictive so check that our sig algs are consistent with this
|
||||
* EC cert. See section 4.2.3 of RFC8446.
|
||||
*/
|
||||
eckey = EVP_PKEY_get0_EC_KEY(s->cert->pkeys[SSL_PKEY_ECC].privatekey);
|
||||
if (eckey == NULL)
|
||||
continue;
|
||||
curve = EC_GROUP_get_curve_name(EC_KEY_get0_group(eckey));
|
||||
if (tls_check_sigalg_curve(s, curve))
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -2295,10 +2309,24 @@ int parse_ca_names(SSL *s, PACKET *pkt)
|
||||
return 0;
|
||||
}
|
||||
|
||||
int construct_ca_names(SSL *s, WPACKET *pkt)
|
||||
const STACK_OF(X509_NAME) *get_ca_names(SSL *s)
|
||||
{
|
||||
const STACK_OF(X509_NAME) *ca_sk = SSL_get0_CA_list(s);
|
||||
const STACK_OF(X509_NAME) *ca_sk = NULL;;
|
||||
|
||||
if (s->server) {
|
||||
ca_sk = SSL_get_client_CA_list(s);
|
||||
if (ca_sk != NULL && sk_X509_NAME_num(ca_sk) == 0)
|
||||
ca_sk = NULL;
|
||||
}
|
||||
|
||||
if (ca_sk == NULL)
|
||||
ca_sk = SSL_get0_CA_list(s);
|
||||
|
||||
return ca_sk;
|
||||
}
|
||||
|
||||
int construct_ca_names(SSL *s, const STACK_OF(X509_NAME) *ca_sk, WPACKET *pkt)
|
||||
{
|
||||
/* Start sub-packet for client CA list */
|
||||
if (!WPACKET_start_sub_packet_u16(pkt)) {
|
||||
SSLfatal(s, SSL_AD_INTERNAL_ERROR, SSL_F_CONSTRUCT_CA_NAMES,
|
||||
|
||||
@@ -61,7 +61,8 @@ int create_synthetic_message_hash(SSL *s, const unsigned char *hashval,
|
||||
size_t hashlen, const unsigned char *hrr,
|
||||
size_t hrrlen);
|
||||
int parse_ca_names(SSL *s, PACKET *pkt);
|
||||
int construct_ca_names(SSL *s, WPACKET *pkt);
|
||||
const STACK_OF(X509_NAME) *get_ca_names(SSL *s);
|
||||
int construct_ca_names(SSL *s, const STACK_OF(X509_NAME) *ca_sk, WPACKET *pkt);
|
||||
size_t construct_key_exchange_tbs(SSL *s, unsigned char **ptbs,
|
||||
const void *param, size_t paramlen);
|
||||
|
||||
|
||||
@@ -2881,7 +2881,7 @@ int tls_construct_certificate_request(SSL *s, WPACKET *pkt)
|
||||
}
|
||||
}
|
||||
|
||||
if (!construct_ca_names(s, pkt)) {
|
||||
if (!construct_ca_names(s, get_ca_names(s), pkt)) {
|
||||
/* SSLfatal() already called */
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user