forked from wolfSSL/wolfssl
fix scan-build warnings
This commit is contained in:
@@ -9501,7 +9501,7 @@ static void PickHashSigAlgo(WOLFSSL* ssl,
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* protocol version, random and session id length check */
|
/* protocol version, random and session id length check */
|
||||||
if ((i - begin) + OPAQUE16_LEN + RAN_LEN + OPAQUE8_LEN > helloSz)
|
if (OPAQUE16_LEN + RAN_LEN + OPAQUE8_LEN > helloSz)
|
||||||
return BUFFER_ERROR;
|
return BUFFER_ERROR;
|
||||||
|
|
||||||
/* protocol version */
|
/* protocol version */
|
||||||
@@ -11069,21 +11069,17 @@ static void PickHashSigAlgo(WOLFSSL* ssl,
|
|||||||
#endif /*HAVE_PK_CALLBACKS */
|
#endif /*HAVE_PK_CALLBACKS */
|
||||||
|
|
||||||
if (IsAtLeastTLSv1_2(ssl)) {
|
if (IsAtLeastTLSv1_2(ssl)) {
|
||||||
#ifndef NO_OLD_TLS
|
byte* digest;
|
||||||
byte* digest = ssl->certHashes.sha;
|
int digestSz;
|
||||||
int digestSz = SHA_DIGEST_SIZE;
|
int typeH;
|
||||||
int typeH = SHAh;
|
int didSet = 0;
|
||||||
#else
|
|
||||||
byte* digest = ssl->certHashes.sha256;
|
|
||||||
int digestSz = SHA256_DIGEST_SIZE;
|
|
||||||
int typeH = SHA256h;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
if (ssl->suites->hashAlgo == sha_mac) {
|
if (ssl->suites->hashAlgo == sha_mac) {
|
||||||
#ifndef NO_SHA
|
#ifndef NO_SHA
|
||||||
digest = ssl->certHashes.sha;
|
digest = ssl->certHashes.sha;
|
||||||
typeH = SHAh;
|
typeH = SHAh;
|
||||||
digestSz = SHA_DIGEST_SIZE;
|
digestSz = SHA_DIGEST_SIZE;
|
||||||
|
didSet = 1;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
else if (ssl->suites->hashAlgo == sha256_mac) {
|
else if (ssl->suites->hashAlgo == sha256_mac) {
|
||||||
@@ -11091,6 +11087,7 @@ static void PickHashSigAlgo(WOLFSSL* ssl,
|
|||||||
digest = ssl->certHashes.sha256;
|
digest = ssl->certHashes.sha256;
|
||||||
typeH = SHA256h;
|
typeH = SHA256h;
|
||||||
digestSz = SHA256_DIGEST_SIZE;
|
digestSz = SHA256_DIGEST_SIZE;
|
||||||
|
didSet = 1;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
else if (ssl->suites->hashAlgo == sha384_mac) {
|
else if (ssl->suites->hashAlgo == sha384_mac) {
|
||||||
@@ -11098,6 +11095,20 @@ static void PickHashSigAlgo(WOLFSSL* ssl,
|
|||||||
digest = ssl->certHashes.sha384;
|
digest = ssl->certHashes.sha384;
|
||||||
typeH = SHA384h;
|
typeH = SHA384h;
|
||||||
digestSz = SHA384_DIGEST_SIZE;
|
digestSz = SHA384_DIGEST_SIZE;
|
||||||
|
didSet = 1;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
if (didSet == 0) {
|
||||||
|
/* defaults */
|
||||||
|
#ifndef NO_OLD_TLS
|
||||||
|
digest = ssl->certHashes.sha;
|
||||||
|
digestSz = SHA_DIGEST_SIZE;
|
||||||
|
typeH = SHAh;
|
||||||
|
#else
|
||||||
|
digest = ssl->certHashes.sha256;
|
||||||
|
digestSz = SHA256_DIGEST_SIZE;
|
||||||
|
typeH = SHA256h;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user