[openssl-commits] [openssl] master update
Andy Polyakov
appro at openssl.org
Tue Mar 27 18:05:05 UTC 2018
The branch master has been updated
via dee0cc108fa92952df1f0a246e9e86bb660f1211 (commit)
from 242fcd695db6225ef98c5ad084e6f15ec5953158 (commit)
- Log -----------------------------------------------------------------
commit dee0cc108fa92952df1f0a246e9e86bb660f1211
Author: Philippe Antoine <p.antoine at catenacyber.fr>
Date: Mon Mar 26 10:29:56 2018 +0200
statem/statem_clnt.c: omit redundant check in tls_construct_client_hello.
Reviewed-by: Andy Polyakov <appro at openssl.org>
Reviewed-by: Rich Salz <rsalz at openssl.org>
(Merged from https://github.com/openssl/openssl/pull/5729)
-----------------------------------------------------------------------
Summary of changes:
ssl/statem/statem_clnt.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/ssl/statem/statem_clnt.c b/ssl/statem/statem_clnt.c
index 86cf5b6..e940fc8 100644
--- a/ssl/statem/statem_clnt.c
+++ b/ssl/statem/statem_clnt.c
@@ -11,6 +11,7 @@
#include <stdio.h>
#include <time.h>
+#include <assert.h>
#include "../ssl_locl.h"
#include "statem_locl.h"
#include <openssl/buffer.h>
@@ -1198,14 +1199,14 @@ int tls_construct_client_hello(SSL *s, WPACKET *pkt)
sess_id_len = 0;
}
} else {
+ assert(s->session->session_id_length <= sizeof(s->session->session_id));
sess_id_len = s->session->session_id_length;
if (s->version == TLS1_3_VERSION) {
s->tmp_session_id_len = sess_id_len;
memcpy(s->tmp_session_id, s->session->session_id, sess_id_len);
}
}
- if (sess_id_len > sizeof(s->session->session_id)
- || !WPACKET_start_sub_packet_u8(pkt)
+ if (!WPACKET_start_sub_packet_u8(pkt)
|| (sess_id_len != 0 && !WPACKET_memcpy(pkt, session_id,
sess_id_len))
|| !WPACKET_close(pkt)) {
More information about the openssl-commits
mailing list