diff options
author | Emilia Kasper <emilia@openssl.org> | 2015-09-30 15:33:12 +0200 |
---|---|---|
committer | Emilia Kasper <emilia@openssl.org> | 2015-10-05 19:03:52 +0200 |
commit | b3e2272c59a5720467045e2ae62940fdb708ce76 (patch) | |
tree | 9d61dfbedf4c9b1f7cf0e52fde863c07f8d9963c /ssl/packet_locl.h | |
parent | 2ff00bdbc4aad268e07df82541ff4a16b1f91fe8 (diff) | |
download | openssl-b3e2272c59a5720467045e2ae62940fdb708ce76.zip openssl-b3e2272c59a5720467045e2ae62940fdb708ce76.tar.gz openssl-b3e2272c59a5720467045e2ae62940fdb708ce76.tar.bz2 |
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 <matt@openssl.org>
Diffstat (limited to 'ssl/packet_locl.h')
-rw-r--r-- | ssl/packet_locl.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/ssl/packet_locl.h b/ssl/packet_locl.h index 88cd202..b13aa5a 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 |