diff options
author | Matt Caswell <matt@openssl.org> | 2016-09-30 10:38:32 +0100 |
---|---|---|
committer | Matt Caswell <matt@openssl.org> | 2016-10-03 16:25:48 +0100 |
commit | 4a01c59f3689db930d056c84f548d525f651cc6b (patch) | |
tree | 4675daccaca8228a76062c00a14fa9cebaff1604 /ssl/s3_lib.c | |
parent | 5923ad4bbe5d13c2fcc11f7849594db838ea57bd (diff) |
Harmonise setting the header and closing construction
Ensure all message types work the same way including CCS so that the state
machine doesn't need to know about special cases. Put all the special logic
into ssl_set_handshake_header() and ssl_close_construct_packet().
Reviewed-by: Rich Salz <rsalz@openssl.org>
Diffstat (limited to 'ssl/s3_lib.c')
-rw-r--r-- | ssl/s3_lib.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/ssl/s3_lib.c b/ssl/s3_lib.c index 630c94d383..d19b97a4d9 100644 --- a/ssl/s3_lib.c +++ b/ssl/s3_lib.c @@ -2779,6 +2779,10 @@ const SSL_CIPHER *ssl3_get_cipher(unsigned int u) int ssl3_set_handshake_header(SSL *s, WPACKET *pkt, int htype) { + /* No header in the event of a CCS */ + if (htype == SSL3_MT_CHANGE_CIPHER_SPEC) + return 1; + /* Set the content type and 3 bytes for the message len */ if (!WPACKET_put_bytes_u8(pkt, htype) || !WPACKET_start_sub_packet_u24(pkt)) |