fix newer clang warnings

This commit is contained in:
toddouska
2013-12-11 12:03:09 -08:00
parent 9e56ad262c
commit b41d09b1a2
3 changed files with 10 additions and 2 deletions

View File

@@ -2563,6 +2563,7 @@ static int ConfirmSignature(const byte* buf, word32 bufSz,
(void)sigSz; (void)sigSz;
(void)heap; (void)heap;
(void)ret; (void)ret;
(void)typeH;
switch (sigOID) { switch (sigOID) {
#ifndef NO_MD5 #ifndef NO_MD5
@@ -3339,6 +3340,7 @@ static void DecodeCertExtensions(DecodedCert* cert)
} }
idx += length; idx += length;
} }
(void)critical;
CYASSL_LEAVE("DecodeCertExtensions", 0); CYASSL_LEAVE("DecodeCertExtensions", 0);
return; return;

View File

@@ -622,6 +622,7 @@ void InitSuites(Suites* suites, ProtocolVersion pv, byte haveRSA, byte havePSK,
(void)tls; /* shut up compiler */ (void)tls; /* shut up compiler */
(void)tls1_2; (void)tls1_2;
(void)haveRSA;
(void)haveDH; (void)haveDH;
(void)havePSK; (void)havePSK;
(void)haveNTRU; (void)haveNTRU;
@@ -8118,7 +8119,7 @@ static void PickHashSigAlgo(CYASSL* ssl,
case ecc_diffie_hellman_kea: case ecc_diffie_hellman_kea:
{ {
ecc_key myKey; ecc_key myKey;
ecc_key* peerKey = &myKey; ecc_key* peerKey = NULL;
word32 size = sizeof(encSecret); word32 size = sizeof(encSecret);
if (ssl->specs.static_ecdh) { if (ssl->specs.static_ecdh) {
@@ -8133,6 +8134,9 @@ static void PickHashSigAlgo(CYASSL* ssl,
peerKey = ssl->peerEccKey; peerKey = ssl->peerEccKey;
} }
if (peerKey == NULL)
return NO_PEER_KEY;
ecc_init(&myKey); ecc_init(&myKey);
ret = ecc_make_key(ssl->rng, peerKey->dp->size, &myKey); ret = ecc_make_key(ssl->rng, peerKey->dp->size, &myKey);
if (ret != 0) if (ret != 0)

View File

@@ -1730,6 +1730,7 @@ int CyaSSL_Init(void)
der.buffer = 0; der.buffer = 0;
(void)dynamicType; (void)dynamicType;
(void)rsaKey;
if (used) if (used)
*used = sz; /* used bytes default to sz, PEM chain may shorten*/ *used = sz; /* used bytes default to sz, PEM chain may shorten*/
@@ -1980,7 +1981,8 @@ int CyaSSL_Init(void)
} }
ecc_free(&key); ecc_free(&key);
eccKey = 1; eccKey = 1;
ctx->haveStaticECC = 1; if (ctx)
ctx->haveStaticECC = 1;
if (ssl) if (ssl)
ssl->options.haveStaticECC = 1; ssl->options.haveStaticECC = 1;
} }