From b41d09b1a227d7beb13faf7b69c2fc23fd74d6c3 Mon Sep 17 00:00:00 2001 From: toddouska Date: Wed, 11 Dec 2013 12:03:09 -0800 Subject: [PATCH] fix newer clang warnings --- ctaocrypt/src/asn.c | 2 ++ src/internal.c | 6 +++++- src/ssl.c | 4 +++- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/ctaocrypt/src/asn.c b/ctaocrypt/src/asn.c index f19ce79b0..d2fe3f0ad 100644 --- a/ctaocrypt/src/asn.c +++ b/ctaocrypt/src/asn.c @@ -2563,6 +2563,7 @@ static int ConfirmSignature(const byte* buf, word32 bufSz, (void)sigSz; (void)heap; (void)ret; + (void)typeH; switch (sigOID) { #ifndef NO_MD5 @@ -3339,6 +3340,7 @@ static void DecodeCertExtensions(DecodedCert* cert) } idx += length; } + (void)critical; CYASSL_LEAVE("DecodeCertExtensions", 0); return; diff --git a/src/internal.c b/src/internal.c index ffa120a2d..037ae1372 100644 --- a/src/internal.c +++ b/src/internal.c @@ -622,6 +622,7 @@ void InitSuites(Suites* suites, ProtocolVersion pv, byte haveRSA, byte havePSK, (void)tls; /* shut up compiler */ (void)tls1_2; + (void)haveRSA; (void)haveDH; (void)havePSK; (void)haveNTRU; @@ -8118,7 +8119,7 @@ static void PickHashSigAlgo(CYASSL* ssl, case ecc_diffie_hellman_kea: { ecc_key myKey; - ecc_key* peerKey = &myKey; + ecc_key* peerKey = NULL; word32 size = sizeof(encSecret); if (ssl->specs.static_ecdh) { @@ -8133,6 +8134,9 @@ static void PickHashSigAlgo(CYASSL* ssl, peerKey = ssl->peerEccKey; } + if (peerKey == NULL) + return NO_PEER_KEY; + ecc_init(&myKey); ret = ecc_make_key(ssl->rng, peerKey->dp->size, &myKey); if (ret != 0) diff --git a/src/ssl.c b/src/ssl.c index 827369fcf..8196e46db 100644 --- a/src/ssl.c +++ b/src/ssl.c @@ -1730,6 +1730,7 @@ int CyaSSL_Init(void) der.buffer = 0; (void)dynamicType; + (void)rsaKey; if (used) *used = sz; /* used bytes default to sz, PEM chain may shorten*/ @@ -1980,7 +1981,8 @@ int CyaSSL_Init(void) } ecc_free(&key); eccKey = 1; - ctx->haveStaticECC = 1; + if (ctx) + ctx->haveStaticECC = 1; if (ssl) ssl->options.haveStaticECC = 1; }