From b3e2272c59a5720467045e2ae62940fdb708ce76 Mon Sep 17 00:00:00 2001 From: Emilia Kasper Date: Wed, 30 Sep 2015 15:33:12 +0200 Subject: ssl3_get_client_hello: rearrange logic Move all packet parsing to the beginning of the method. This limits the SSLv2 compatibility soup to the parsing, and makes the rest of the processing uniform. This is also needed for simpler EMS support: EMS servers need to do an early scan for EMS to make resumption decisions. This'll be easier when the entire ClientHello is parsed in the beginning. As a side effect, 1) PACKETize ssl_get_prev_session and tls1_process_ticket; and 2) Delete dead code for SSL_OP_NETSCAPE_REUSE_CIPHER_CHANGE_BUG. Reviewed-by: Matt Caswell --- ssl/packet_locl.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'ssl/packet_locl.h') diff --git a/ssl/packet_locl.h b/ssl/packet_locl.h index 88cd202c9b..b13aa5a5c0 100644 --- a/ssl/packet_locl.h +++ b/ssl/packet_locl.h @@ -117,6 +117,13 @@ static inline int PACKET_buf_init(PACKET *pkt, unsigned char *buf, size_t len) return 1; } +/* Initialize a PACKET to hold zero bytes. */ +static inline void PACKET_null_init(PACKET *pkt) +{ + pkt->curr = NULL; + pkt->remaining = 0; +} + /* * Peek ahead and initialize |subpkt| with the next |len| bytes read from |pkt|. * Data is not copied: the |subpkt| packet will share its underlying buffer with -- cgit v1.2.3