Latest update and remove TLSv1.3 draft
This commit is contained in:
@@ -173,9 +173,8 @@ int tls13_enc(SSL *s, SSL3_RECORD *recs, size_t n_recs, int sending)
|
||||
if (((alg_enc & SSL_AESCCM) != 0
|
||||
&& EVP_CipherUpdate(ctx, NULL, &lenu, NULL,
|
||||
(unsigned int)rec->length) <= 0)
|
||||
|| (s->version_draft != TLS1_3_VERSION_DRAFT_23
|
||||
&& EVP_CipherUpdate(ctx, NULL, &lenu, recheader,
|
||||
sizeof(recheader)) <= 0)
|
||||
|| EVP_CipherUpdate(ctx, NULL, &lenu, recheader,
|
||||
sizeof(recheader)) <= 0
|
||||
|| EVP_CipherUpdate(ctx, rec->data, &lenu, rec->input,
|
||||
(unsigned int)rec->length) <= 0
|
||||
|| EVP_CipherFinal_ex(ctx, rec->data + lenu, &lenf) <= 0
|
||||
|
||||
+10
-10
@@ -2240,7 +2240,7 @@ int SSL_key_update(SSL *s, int updatetype)
|
||||
return 1;
|
||||
}
|
||||
|
||||
int SSL_get_key_update_type(SSL *s)
|
||||
int SSL_get_key_update_type(const SSL *s)
|
||||
{
|
||||
return s->key_update;
|
||||
}
|
||||
@@ -2281,7 +2281,7 @@ int SSL_renegotiate_abbreviated(SSL *s)
|
||||
return s->method->ssl_renegotiate(s);
|
||||
}
|
||||
|
||||
int SSL_renegotiate_pending(SSL *s)
|
||||
int SSL_renegotiate_pending(const SSL *s)
|
||||
{
|
||||
/*
|
||||
* becomes true when negotiation is requested; false again once a
|
||||
@@ -3565,12 +3565,12 @@ void ssl_update_cache(SSL *s, int mode)
|
||||
}
|
||||
}
|
||||
|
||||
const SSL_METHOD *SSL_CTX_get_ssl_method(SSL_CTX *ctx)
|
||||
const SSL_METHOD *SSL_CTX_get_ssl_method(const SSL_CTX *ctx)
|
||||
{
|
||||
return ctx->method;
|
||||
}
|
||||
|
||||
const SSL_METHOD *SSL_get_ssl_method(SSL *s)
|
||||
const SSL_METHOD *SSL_get_ssl_method(const SSL *s)
|
||||
{
|
||||
return s->method;
|
||||
}
|
||||
@@ -4010,7 +4010,7 @@ const SSL_CIPHER *SSL_get_pending_cipher(const SSL *s)
|
||||
return s->s3->tmp.new_cipher;
|
||||
}
|
||||
|
||||
const COMP_METHOD *SSL_get_current_compression(SSL *s)
|
||||
const COMP_METHOD *SSL_get_current_compression(const SSL *s)
|
||||
{
|
||||
#ifndef OPENSSL_NO_COMP
|
||||
return s->compress ? COMP_CTX_get_method(s->compress) : NULL;
|
||||
@@ -4019,7 +4019,7 @@ const COMP_METHOD *SSL_get_current_compression(SSL *s)
|
||||
#endif
|
||||
}
|
||||
|
||||
const COMP_METHOD *SSL_get_current_expansion(SSL *s)
|
||||
const COMP_METHOD *SSL_get_current_expansion(const SSL *s)
|
||||
{
|
||||
#ifndef OPENSSL_NO_COMP
|
||||
return s->expand ? COMP_CTX_get_method(s->expand) : NULL;
|
||||
@@ -4467,7 +4467,7 @@ void SSL_CTX_set_record_padding_callback_arg(SSL_CTX *ctx, void *arg)
|
||||
ctx->record_padding_arg = arg;
|
||||
}
|
||||
|
||||
void *SSL_CTX_get_record_padding_callback_arg(SSL_CTX *ctx)
|
||||
void *SSL_CTX_get_record_padding_callback_arg(const SSL_CTX *ctx)
|
||||
{
|
||||
return ctx->record_padding_arg;
|
||||
}
|
||||
@@ -4496,7 +4496,7 @@ void SSL_set_record_padding_callback_arg(SSL *ssl, void *arg)
|
||||
ssl->record_padding_arg = arg;
|
||||
}
|
||||
|
||||
void *SSL_get_record_padding_callback_arg(SSL *ssl)
|
||||
void *SSL_get_record_padding_callback_arg(const SSL *ssl)
|
||||
{
|
||||
return ssl->record_padding_arg;
|
||||
}
|
||||
@@ -4520,7 +4520,7 @@ int SSL_set_num_tickets(SSL *s, size_t num_tickets)
|
||||
return 1;
|
||||
}
|
||||
|
||||
size_t SSL_get_num_tickets(SSL *s)
|
||||
size_t SSL_get_num_tickets(const SSL *s)
|
||||
{
|
||||
return s->num_tickets;
|
||||
}
|
||||
@@ -4532,7 +4532,7 @@ int SSL_CTX_set_num_tickets(SSL_CTX *ctx, size_t num_tickets)
|
||||
return 1;
|
||||
}
|
||||
|
||||
size_t SSL_CTX_get_num_tickets(SSL_CTX *ctx)
|
||||
size_t SSL_CTX_get_num_tickets(const SSL_CTX *ctx)
|
||||
{
|
||||
return ctx->num_tickets;
|
||||
}
|
||||
|
||||
@@ -1126,8 +1126,6 @@ struct ssl_st {
|
||||
* DTLS1_VERSION)
|
||||
*/
|
||||
int version;
|
||||
/* TODO(TLS1.3): Remove this before release */
|
||||
int version_draft;
|
||||
/* SSLv3 */
|
||||
const SSL_METHOD *method;
|
||||
/*
|
||||
|
||||
@@ -533,25 +533,8 @@ EXT_RETURN tls_construct_ctos_supported_versions(SSL *s, WPACKET *pkt,
|
||||
return EXT_RETURN_FAIL;
|
||||
}
|
||||
|
||||
/*
|
||||
* TODO(TLS1.3): There is some discussion on the TLS list as to whether
|
||||
* we should include versions <TLS1.2. For the moment we do. To be
|
||||
* reviewed later.
|
||||
*/
|
||||
for (currv = max_version; currv >= min_version; currv--) {
|
||||
/* TODO(TLS1.3): Remove this first if clause prior to release!! */
|
||||
if (currv == TLS1_3_VERSION) {
|
||||
if (!WPACKET_put_bytes_u16(pkt, TLS1_3_VERSION)
|
||||
|| !WPACKET_put_bytes_u16(pkt, TLS1_3_VERSION_DRAFT)
|
||||
|| !WPACKET_put_bytes_u16(pkt, TLS1_3_VERSION_DRAFT_27)
|
||||
|| !WPACKET_put_bytes_u16(pkt, TLS1_3_VERSION_DRAFT_26)
|
||||
|| !WPACKET_put_bytes_u16(pkt, TLS1_3_VERSION_DRAFT_23)) {
|
||||
SSLfatal(s, SSL_AD_INTERNAL_ERROR,
|
||||
SSL_F_TLS_CONSTRUCT_CTOS_SUPPORTED_VERSIONS,
|
||||
ERR_R_INTERNAL_ERROR);
|
||||
return EXT_RETURN_FAIL;
|
||||
}
|
||||
} else if (!WPACKET_put_bytes_u16(pkt, currv)) {
|
||||
if (!WPACKET_put_bytes_u16(pkt, currv)) {
|
||||
SSLfatal(s, SSL_AD_INTERNAL_ERROR,
|
||||
SSL_F_TLS_CONSTRUCT_CTOS_SUPPORTED_VERSIONS,
|
||||
ERR_R_INTERNAL_ERROR);
|
||||
@@ -1780,15 +1763,6 @@ int tls_parse_stoc_supported_versions(SSL *s, PACKET *pkt, unsigned int context,
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* TODO(TLS1.3): Remove this before release */
|
||||
if (version == TLS1_3_VERSION_DRAFT
|
||||
|| version == TLS1_3_VERSION_DRAFT_27
|
||||
|| version == TLS1_3_VERSION_DRAFT_26
|
||||
|| version == TLS1_3_VERSION_DRAFT_23) {
|
||||
s->version_draft = version;
|
||||
version = TLS1_3_VERSION;
|
||||
}
|
||||
|
||||
/*
|
||||
* The only protocol version we support which is valid in this extension in
|
||||
* a ServerHello is TLSv1.3 therefore we shouldn't be getting anything else.
|
||||
|
||||
@@ -897,8 +897,7 @@ int tls_parse_ctos_cookie(SSL *s, PACKET *pkt, unsigned int context, X509 *x,
|
||||
}
|
||||
if (!WPACKET_put_bytes_u16(&hrrpkt, TLSEXT_TYPE_supported_versions)
|
||||
|| !WPACKET_start_sub_packet_u16(&hrrpkt)
|
||||
/* TODO(TLS1.3): Fix this before release */
|
||||
|| !WPACKET_put_bytes_u16(&hrrpkt, s->version_draft)
|
||||
|| !WPACKET_put_bytes_u16(&hrrpkt, s->version)
|
||||
|| !WPACKET_close(&hrrpkt)) {
|
||||
WPACKET_cleanup(&hrrpkt);
|
||||
SSLfatal(s, SSL_AD_INTERNAL_ERROR, SSL_F_TLS_PARSE_CTOS_COOKIE,
|
||||
@@ -1653,8 +1652,7 @@ EXT_RETURN tls_construct_stoc_supported_versions(SSL *s, WPACKET *pkt,
|
||||
|
||||
if (!WPACKET_put_bytes_u16(pkt, TLSEXT_TYPE_supported_versions)
|
||||
|| !WPACKET_start_sub_packet_u16(pkt)
|
||||
/* TODO(TLS1.3): Update to remove the TLSv1.3 draft indicator */
|
||||
|| !WPACKET_put_bytes_u16(pkt, s->version_draft)
|
||||
|| !WPACKET_put_bytes_u16(pkt, s->version)
|
||||
|| !WPACKET_close(pkt)) {
|
||||
SSLfatal(s, SSL_AD_INTERNAL_ERROR,
|
||||
SSL_F_TLS_CONSTRUCT_STOC_SUPPORTED_VERSIONS,
|
||||
|
||||
@@ -1707,6 +1707,7 @@ MSG_PROCESS_RETURN tls_process_server_hello(SSL *s, PACKET *pkt)
|
||||
if (SSL_IS_DTLS(s) && s->hit) {
|
||||
unsigned char sctpauthkey[64];
|
||||
char labelbuffer[sizeof(DTLS1_SCTP_AUTH_LABEL)];
|
||||
size_t labellen;
|
||||
|
||||
/*
|
||||
* Add new shared key for SCTP-Auth, will be ignored if
|
||||
@@ -1715,10 +1716,15 @@ MSG_PROCESS_RETURN tls_process_server_hello(SSL *s, PACKET *pkt)
|
||||
memcpy(labelbuffer, DTLS1_SCTP_AUTH_LABEL,
|
||||
sizeof(DTLS1_SCTP_AUTH_LABEL));
|
||||
|
||||
/* Don't include the terminating zero. */
|
||||
labellen = sizeof(labelbuffer) - 1;
|
||||
if (s->mode & SSL_MODE_DTLS_SCTP_LABEL_LENGTH_BUG)
|
||||
labellen += 1;
|
||||
|
||||
if (SSL_export_keying_material(s, sctpauthkey,
|
||||
sizeof(sctpauthkey),
|
||||
labelbuffer,
|
||||
sizeof(labelbuffer), NULL, 0, 0) <= 0) {
|
||||
labellen, NULL, 0, 0) <= 0) {
|
||||
SSLfatal(s, SSL_AD_INTERNAL_ERROR, SSL_F_TLS_PROCESS_SERVER_HELLO,
|
||||
ERR_R_INTERNAL_ERROR);
|
||||
goto err;
|
||||
@@ -3397,6 +3403,7 @@ int tls_client_key_exchange_post_work(SSL *s)
|
||||
if (SSL_IS_DTLS(s)) {
|
||||
unsigned char sctpauthkey[64];
|
||||
char labelbuffer[sizeof(DTLS1_SCTP_AUTH_LABEL)];
|
||||
size_t labellen;
|
||||
|
||||
/*
|
||||
* Add new shared key for SCTP-Auth, will be ignored if no SCTP
|
||||
@@ -3405,9 +3412,14 @@ int tls_client_key_exchange_post_work(SSL *s)
|
||||
memcpy(labelbuffer, DTLS1_SCTP_AUTH_LABEL,
|
||||
sizeof(DTLS1_SCTP_AUTH_LABEL));
|
||||
|
||||
/* Don't include the terminating zero. */
|
||||
labellen = sizeof(labelbuffer) - 1;
|
||||
if (s->mode & SSL_MODE_DTLS_SCTP_LABEL_LENGTH_BUG)
|
||||
labellen += 1;
|
||||
|
||||
if (SSL_export_keying_material(s, sctpauthkey,
|
||||
sizeof(sctpauthkey), labelbuffer,
|
||||
sizeof(labelbuffer), NULL, 0, 0) <= 0) {
|
||||
labellen, NULL, 0, 0) <= 0) {
|
||||
SSLfatal(s, SSL_AD_INTERNAL_ERROR,
|
||||
SSL_F_TLS_CLIENT_KEY_EXCHANGE_POST_WORK,
|
||||
ERR_R_INTERNAL_ERROR);
|
||||
|
||||
@@ -1770,8 +1770,6 @@ int ssl_choose_server_version(SSL *s, CLIENTHELLO_MSG *hello, DOWNGRADE *dgrd)
|
||||
unsigned int best_vers = 0;
|
||||
const SSL_METHOD *best_method = NULL;
|
||||
PACKET versionslist;
|
||||
/* TODO(TLS1.3): Remove this before release */
|
||||
unsigned int orig_candidate = 0;
|
||||
|
||||
suppversions->parsed = 1;
|
||||
|
||||
@@ -1793,23 +1791,6 @@ int ssl_choose_server_version(SSL *s, CLIENTHELLO_MSG *hello, DOWNGRADE *dgrd)
|
||||
return SSL_R_BAD_LEGACY_VERSION;
|
||||
|
||||
while (PACKET_get_net_2(&versionslist, &candidate_vers)) {
|
||||
/* TODO(TLS1.3): Remove this before release */
|
||||
if (candidate_vers == TLS1_3_VERSION
|
||||
|| candidate_vers == TLS1_3_VERSION_DRAFT
|
||||
|| candidate_vers == TLS1_3_VERSION_DRAFT_26
|
||||
|| candidate_vers == TLS1_3_VERSION_DRAFT_23) {
|
||||
if (best_vers == TLS1_3_VERSION
|
||||
&& (orig_candidate > candidate_vers
|
||||
|| orig_candidate == TLS1_3_VERSION))
|
||||
continue;
|
||||
orig_candidate = candidate_vers;
|
||||
candidate_vers = TLS1_3_VERSION;
|
||||
}
|
||||
/*
|
||||
* TODO(TLS1.3): There is some discussion on the TLS list about
|
||||
* whether to ignore versions <TLS1.2 in supported_versions. At the
|
||||
* moment we honour them if present. To be reviewed later
|
||||
*/
|
||||
if (version_cmp(s, candidate_vers, best_vers) <= 0)
|
||||
continue;
|
||||
if (ssl_version_supported(s, candidate_vers, &best_method))
|
||||
@@ -1832,9 +1813,6 @@ int ssl_choose_server_version(SSL *s, CLIENTHELLO_MSG *hello, DOWNGRADE *dgrd)
|
||||
}
|
||||
check_for_downgrade(s, best_vers, dgrd);
|
||||
s->version = best_vers;
|
||||
/* TODO(TLS1.3): Remove this before release */
|
||||
if (best_vers == TLS1_3_VERSION)
|
||||
s->version_draft = orig_candidate;
|
||||
s->method = best_method;
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -830,6 +830,7 @@ WORK_STATE ossl_statem_server_post_work(SSL *s, WORK_STATE wst)
|
||||
if (SSL_IS_DTLS(s) && s->hit) {
|
||||
unsigned char sctpauthkey[64];
|
||||
char labelbuffer[sizeof(DTLS1_SCTP_AUTH_LABEL)];
|
||||
size_t labellen;
|
||||
|
||||
/*
|
||||
* Add new shared key for SCTP-Auth, will be ignored if no
|
||||
@@ -838,9 +839,14 @@ WORK_STATE ossl_statem_server_post_work(SSL *s, WORK_STATE wst)
|
||||
memcpy(labelbuffer, DTLS1_SCTP_AUTH_LABEL,
|
||||
sizeof(DTLS1_SCTP_AUTH_LABEL));
|
||||
|
||||
/* Don't include the terminating zero. */
|
||||
labellen = sizeof(labelbuffer) - 1;
|
||||
if (s->mode & SSL_MODE_DTLS_SCTP_LABEL_LENGTH_BUG)
|
||||
labellen += 1;
|
||||
|
||||
if (SSL_export_keying_material(s, sctpauthkey,
|
||||
sizeof(sctpauthkey), labelbuffer,
|
||||
sizeof(labelbuffer), NULL, 0,
|
||||
labellen, NULL, 0,
|
||||
0) <= 0) {
|
||||
SSLfatal(s, SSL_AD_INTERNAL_ERROR,
|
||||
SSL_F_OSSL_STATEM_SERVER_POST_WORK,
|
||||
@@ -3501,6 +3507,7 @@ WORK_STATE tls_post_process_client_key_exchange(SSL *s, WORK_STATE wst)
|
||||
if (SSL_IS_DTLS(s)) {
|
||||
unsigned char sctpauthkey[64];
|
||||
char labelbuffer[sizeof(DTLS1_SCTP_AUTH_LABEL)];
|
||||
size_t labellen;
|
||||
/*
|
||||
* Add new shared key for SCTP-Auth, will be ignored if no SCTP
|
||||
* used.
|
||||
@@ -3508,9 +3515,14 @@ WORK_STATE tls_post_process_client_key_exchange(SSL *s, WORK_STATE wst)
|
||||
memcpy(labelbuffer, DTLS1_SCTP_AUTH_LABEL,
|
||||
sizeof(DTLS1_SCTP_AUTH_LABEL));
|
||||
|
||||
/* Don't include the terminating zero. */
|
||||
labellen = sizeof(labelbuffer) - 1;
|
||||
if (s->mode & SSL_MODE_DTLS_SCTP_LABEL_LENGTH_BUG)
|
||||
labellen += 1;
|
||||
|
||||
if (SSL_export_keying_material(s, sctpauthkey,
|
||||
sizeof(sctpauthkey), labelbuffer,
|
||||
sizeof(labelbuffer), NULL, 0,
|
||||
labellen, NULL, 0,
|
||||
0) <= 0) {
|
||||
SSLfatal(s, SSL_AD_INTERNAL_ERROR,
|
||||
SSL_F_TLS_POST_PROCESS_CLIENT_KEY_EXCHANGE,
|
||||
|
||||
+2
-18
@@ -65,11 +65,6 @@ static const ssl_trace_tbl ssl_version_tbl[] = {
|
||||
{TLS1_1_VERSION, "TLS 1.1"},
|
||||
{TLS1_2_VERSION, "TLS 1.2"},
|
||||
{TLS1_3_VERSION, "TLS 1.3"},
|
||||
/* TODO(TLS1.3): Remove these lines before release */
|
||||
{TLS1_3_VERSION_DRAFT_23, TLS1_3_VERSION_DRAFT_TXT_23},
|
||||
{TLS1_3_VERSION_DRAFT_26, TLS1_3_VERSION_DRAFT_TXT_26},
|
||||
{TLS1_3_VERSION_DRAFT_27, TLS1_3_VERSION_DRAFT_TXT_27},
|
||||
{TLS1_3_VERSION_DRAFT, TLS1_3_VERSION_DRAFT_TXT},
|
||||
{DTLS1_VERSION, "DTLS 1.0"},
|
||||
{DTLS1_2_VERSION, "DTLS 1.2"},
|
||||
{DTLS1_BAD_VER, "DTLS 1.0 (bad)"}
|
||||
@@ -643,19 +638,8 @@ static int ssl_print_version(BIO *bio, int indent, const char *name,
|
||||
if (*pmsglen < 2)
|
||||
return 0;
|
||||
vers = ((*pmsg)[0] << 8) | (*pmsg)[1];
|
||||
if (version != NULL) {
|
||||
/* TODO(TLS1.3): Remove the draft conditional here before release */
|
||||
switch(vers) {
|
||||
case TLS1_3_VERSION_DRAFT_23:
|
||||
case TLS1_3_VERSION_DRAFT_26:
|
||||
case TLS1_3_VERSION_DRAFT_27:
|
||||
case TLS1_3_VERSION_DRAFT:
|
||||
*version = TLS1_3_VERSION;
|
||||
break;
|
||||
default:
|
||||
*version = vers;
|
||||
}
|
||||
}
|
||||
if (version != NULL)
|
||||
*version = vers;
|
||||
BIO_indent(bio, indent, 80);
|
||||
BIO_printf(bio, "%s=0x%x (%s)\n",
|
||||
name, vers, ssl_trace_str(vers, ssl_version_tbl));
|
||||
|
||||
Reference in New Issue
Block a user