diff options
author | Matt Caswell <matt@openssl.org> | 2015-04-16 10:06:25 +0100 |
---|---|---|
committer | Matt Caswell <matt@openssl.org> | 2015-08-03 11:01:42 +0100 |
commit | 9ceb2426b0a7972434a49a34e78bdcc6437e04ad (patch) | |
tree | 6d1cd08357d6108473f14d4a0d60df128eab2262 /ssl/t1_reneg.c | |
parent | 6fc2ef20a92a318aa5aacf9c907fa70df98f6a41 (diff) |
PACKETise ClientHello processing
Uses the new PACKET code to process the incoming ClientHello including all
extensions etc.
Reviewed-by: Tim Hudson <tjh@openssl.org>
Diffstat (limited to 'ssl/t1_reneg.c')
-rw-r--r-- | ssl/t1_reneg.c | 19 |
1 files changed, 5 insertions, 14 deletions
diff --git a/ssl/t1_reneg.c b/ssl/t1_reneg.c index b9a35c7fc2..22a71fed49 100644 --- a/ssl/t1_reneg.c +++ b/ssl/t1_reneg.c @@ -143,23 +143,14 @@ int ssl_add_clienthello_renegotiate_ext(SSL *s, unsigned char *p, int *len, /* * Parse the client's renegotiation binding and abort if it's not right */ -int ssl_parse_clienthello_renegotiate_ext(SSL *s, unsigned char *d, int len, - int *al) +int ssl_parse_clienthello_renegotiate_ext(SSL *s, PACKET *pkt, int *al) { - int ilen; + unsigned int ilen; + unsigned char *d; /* Parse the length byte */ - if (len < 1) { - SSLerr(SSL_F_SSL_PARSE_CLIENTHELLO_RENEGOTIATE_EXT, - SSL_R_RENEGOTIATION_ENCODING_ERR); - *al = SSL_AD_ILLEGAL_PARAMETER; - return 0; - } - ilen = *d; - d++; - - /* Consistency check */ - if ((ilen + 1) != len) { + if (!PACKET_get_1(pkt, &ilen) + || !PACKET_get_bytes(pkt, &d, ilen)) { SSLerr(SSL_F_SSL_PARSE_CLIENTHELLO_RENEGOTIATE_EXT, SSL_R_RENEGOTIATION_ENCODING_ERR); *al = SSL_AD_ILLEGAL_PARAMETER; |