diff --git a/ctaocrypt/src/tfm.c b/ctaocrypt/src/tfm.c index 7dfb24e35..25372ded9 100644 --- a/ctaocrypt/src/tfm.c +++ b/ctaocrypt/src/tfm.c @@ -1565,10 +1565,8 @@ void fp_montgomery_reduce(fp_int *a, fp_int *m, fp_digit mp) #endif -#if defined(USE_MEMSET) /* now zero the buff */ XMEMSET(c, 0, sizeof c); -#endif pa = m->used; /* copy the input */ @@ -1576,11 +1574,6 @@ void fp_montgomery_reduce(fp_int *a, fp_int *m, fp_digit mp) for (x = 0; x < oldused; x++) { c[x] = a->dp[x]; } -#if !defined(USE_MEMSET) - for (; x < 2*pa+1; x++) { - c[x] = 0; - } -#endif MONT_START; for (x = 0; x < pa; x++) { diff --git a/src/ssl.c b/src/ssl.c index d336e44d7..496d967d1 100644 --- a/src/ssl.c +++ b/src/ssl.c @@ -1419,6 +1419,7 @@ int CyaSSL_Init(void) } } else { rsaKey = 1; + (void)rsaKey; /* for no ecc builds */ } FreeRsaKey(&key); } diff --git a/src/tls.c b/src/tls.c index 9059ce2c0..f553dfd4c 100644 --- a/src/tls.c +++ b/src/tls.c @@ -160,6 +160,9 @@ static void doPRF(byte* digest, word32 digLen, const byte* secret,word32 secLen, return; if (digLen > MAX_PRF_DIG) return; + + XMEMSET(md5_result, 0, digLen); + XMEMSET(sha_result, 0, digLen); XMEMCPY(md5_half, secret, half); XMEMCPY(sha_half, secret + half - secLen % 2, half);