From b25061844c7619b98ba1dd8586e9db984bd25783 Mon Sep 17 00:00:00 2001 From: toddouska Date: Fri, 14 Dec 2012 16:47:03 -0800 Subject: [PATCH] remove hmac array initializers to 0 when non full because of reported compiler weirdness from user --- src/internal.c | 3 ++- src/tls.c | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/internal.c b/src/internal.c index 181b90d9c..62d881740 100644 --- a/src/internal.c +++ b/src/internal.c @@ -3581,10 +3581,11 @@ static void Hmac(CYASSL* ssl, byte* digest, const byte* in, word32 sz, Sha sha; /* data */ - byte seq[SEQ_SZ] = { 0x00, 0x00, 0x00, 0x00 }; + byte seq[SEQ_SZ]; byte conLen[ENUM_LEN + LENGTH_SZ]; /* content & length */ const byte* macSecret = GetMacSecret(ssl, verify); + XMEMSET(seq, 0, SEQ_SZ); conLen[0] = (byte)content; c16toa((word16)sz, &conLen[ENUM_LEN]); c32toa(GetSEQIncrement(ssl, verify), &seq[sizeof(word32)]); diff --git a/src/tls.c b/src/tls.c index 48ee867ea..db19785f6 100644 --- a/src/tls.c +++ b/src/tls.c @@ -401,11 +401,12 @@ void TLS_hmac(CYASSL* ssl, byte* digest, const byte* in, word32 sz, int content, int verify) { Hmac hmac; - byte seq[SEQ_SZ] = { 0x00, 0x00, 0x00, 0x00 }; + byte seq[SEQ_SZ]; byte length[LENGTH_SZ]; byte inner[ENUM_LEN + VERSION_SZ + LENGTH_SZ]; /* type + version +len */ int type; + XMEMSET(seq, 0, SEQ_SZ); c16toa((word16)sz, length); #ifdef CYASSL_DTLS if (ssl->options.dtls)