From 307e5f3bff355bf1046f29fabdfa2506e7285973 Mon Sep 17 00:00:00 2001 From: John Safranek Date: Wed, 16 Jul 2014 14:40:41 -0700 Subject: [PATCH] fix build warnings with lean-psk mode --- ctaocrypt/benchmark/benchmark.c | 14 +++++++++++--- src/internal.c | 4 ++++ 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/ctaocrypt/benchmark/benchmark.c b/ctaocrypt/benchmark/benchmark.c index b2517f084..6220f4eeb 100644 --- a/ctaocrypt/benchmark/benchmark.c +++ b/ctaocrypt/benchmark/benchmark.c @@ -259,6 +259,17 @@ enum BenchmarkBounds { static const char blockType[] = "megs"; /* used in printf output */ #endif + +/* use kB instead of mB for embedded benchmarking */ +#ifdef BENCH_EMBEDDED +static byte plain [1024]; +#else +static byte plain [1024*1024]; +#endif + + +#ifndef NO_AES + static const byte key[] = { 0x01,0x23,0x45,0x67,0x89,0xab,0xcd,0xef, @@ -277,15 +288,12 @@ static const byte iv[] = /* use kB instead of mB for embedded benchmarking */ #ifdef BENCH_EMBEDDED -static byte plain [1024]; static byte cipher[1024]; #else -static byte plain [1024*1024]; static byte cipher[1024*1024]; #endif -#ifndef NO_AES void bench_aes(int show) { Aes enc; diff --git a/src/internal.c b/src/internal.c index a8b31df26..f94712cfb 100644 --- a/src/internal.c +++ b/src/internal.c @@ -203,6 +203,7 @@ static INLINE void c16toa(word16 u16, byte* c) } +#if !defined(NO_OLD_TLS) || defined(HAVE_AESCCM) || defined(HAVE_AESGCM) /* convert 32 bit integer to opaque */ static INLINE void c32toa(word32 u32, byte* c) { @@ -211,6 +212,7 @@ static INLINE void c32toa(word32 u32, byte* c) c[2] = (u32 >> 8) & 0xff; c[3] = u32 & 0xff; } +#endif /* convert a 24 bit integer into a 32 bit one */ @@ -4669,6 +4671,7 @@ static int DoDtlsHandShakeMsg(CYASSL* ssl, byte* input, word32* inOutIdx, #endif +#if !defined(NO_OLD_TLS) || defined(HAVE_AESCCM) || defined(HAVE_AESGCM) static INLINE word32 GetSEQIncrement(CYASSL* ssl, int verify) { if (verify) @@ -4676,6 +4679,7 @@ static INLINE word32 GetSEQIncrement(CYASSL* ssl, int verify) else return ssl->keys.sequence_number++; } +#endif #ifdef HAVE_AEAD