diff options
author | Matt Caswell <matt@openssl.org> | 2016-11-07 15:09:19 +0000 |
---|---|---|
committer | Matt Caswell <matt@openssl.org> | 2016-11-09 09:10:30 +0000 |
commit | 035b1e69d2b0ece62069aeafa47ed34bf9e707f5 (patch) | |
tree | ad2cba8c0c8a3628e639766f412d1a69f902be76 /ssl | |
parent | e2994cf09969166e9596a07eca91bcbe61524b30 (diff) |
Move setting the session_id_len until after we filled the session_id
Reviewed-by: Kurt Roeckx <kurt@openssl.org>
Reviewed-by: Rich Salz <rsalz@openssl.org>
Diffstat (limited to 'ssl')
-rw-r--r-- | ssl/statem/statem_srvr.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/ssl/statem/statem_srvr.c b/ssl/statem/statem_srvr.c index 7cc3dfac54..b09ed1dbc4 100644 --- a/ssl/statem/statem_srvr.c +++ b/ssl/statem/statem_srvr.c @@ -963,7 +963,6 @@ MSG_PROCESS_RETURN tls_process_client_hello(SSL *s, PACKET *pkt) al = SSL_AD_DECODE_ERROR; goto f_err; } - clienthello.session_id_len = session_id_len; if (session_id_len > SSL_MAX_SSL_SESSION_ID_LENGTH) { al = SSL_AD_DECODE_ERROR; @@ -973,8 +972,7 @@ MSG_PROCESS_RETURN tls_process_client_hello(SSL *s, PACKET *pkt) if (!PACKET_get_sub_packet(pkt, &clienthello.ciphersuites, ciphersuite_len) - || !PACKET_copy_bytes(pkt, clienthello.session_id, - clienthello.session_id_len) + || !PACKET_copy_bytes(pkt, clienthello.session_id, session_id_len) || !PACKET_get_sub_packet(pkt, &challenge, challenge_len) /* No extensions. */ || PACKET_remaining(pkt) != 0) { @@ -983,6 +981,7 @@ MSG_PROCESS_RETURN tls_process_client_hello(SSL *s, PACKET *pkt) al = SSL_AD_DECODE_ERROR; goto f_err; } + clienthello.session_id_len = session_id_len; /* Load the client random and compression list. */ challenge_len = challenge_len > sizeof(clienthello.random) |