From 829754a62245df76584078011f045185218c60c4 Mon Sep 17 00:00:00 2001 From: Matt Caswell Date: Fri, 2 Dec 2016 11:10:16 +0000 Subject: [PATCH] Various style fixes from the TLSv1.3 record changes review Reviewed-by: Rich Salz --- ssl/packet.c | 2 +- ssl/record/rec_layer_s3.c | 8 ++------ 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/ssl/packet.c b/ssl/packet.c index f7b5efa400..12321e719e 100644 --- a/ssl/packet.c +++ b/ssl/packet.c @@ -63,7 +63,7 @@ int WPACKET_reserve_bytes(WPACKET *pkt, size_t len, unsigned char **allocbytes) return 0; } if (allocbytes != NULL) - *allocbytes = GETBUF(pkt) + pkt->curr; + *allocbytes = WPACKET_get_curr(pkt); return 1; } diff --git a/ssl/record/rec_layer_s3.c b/ssl/record/rec_layer_s3.c index d588e784bd..ea4951da28 100644 --- a/ssl/record/rec_layer_s3.c +++ b/ssl/record/rec_layer_s3.c @@ -638,7 +638,7 @@ int do_ssl3_write(SSL *s, int type, const unsigned char *buf, unsigned char *recordstart; int i, mac_size, clear = 0; size_t prefix_len = 0; - int eivlen; + int eivlen = 0; size_t align = 0; SSL3_BUFFER *wb; SSL_SESSION *sess; @@ -748,7 +748,7 @@ int do_ssl3_write(SSL *s, int type, const unsigned char *buf, } else { for (j = 0; j < numpipes; j++) { wb = &s->rlayer.wbuf[j]; -#if defined(SSL3_ALIGN_PAYLOAD) && SSL3_ALIGN_PAYLOAD!=0 +#if defined(SSL3_ALIGN_PAYLOAD) && SSL3_ALIGN_PAYLOAD != 0 align = (size_t)SSL3_BUFFER_get_buf(wb) + SSL3_RT_HEADER_LENGTH; align = SSL3_ALIGN_PAYLOAD - 1 - ((align - 1) % SSL3_ALIGN_PAYLOAD); #endif @@ -776,11 +776,7 @@ int do_ssl3_write(SSL *s, int type, const unsigned char *buf, eivlen = EVP_GCM_TLS_EXPLICIT_IV_LEN; } else if (mode == EVP_CIPH_CCM_MODE) { eivlen = EVP_CCM_TLS_EXPLICIT_IV_LEN; - } else { - eivlen = 0; } - } else { - eivlen = 0; } totlen = 0; -- GitLab