Merge pull request #381 from kaleb-himes/scan-build-psk

scan-build warnings related to enable-psk, disable-asn,rsa,ecc
This commit is contained in:
JacobBarthelmeh
2016-04-11 14:52:38 -06:00
3 changed files with 40 additions and 6 deletions

View File

@@ -917,11 +917,15 @@ THREAD_RETURN WOLFSSL_THREAD client_test(void* args)
}
#ifdef WOLFSSL_LEANPSK
usePsk = 1;
if (!usePsk) {
usePsk = 1;
}
#endif
#if defined(NO_RSA) && !defined(HAVE_ECC)
usePsk = 1;
if (!usePsk) {
usePsk = 1;
}
#endif
if (fewerPackets)
@@ -948,7 +952,9 @@ THREAD_RETURN WOLFSSL_THREAD client_test(void* args)
err_sys("client can't set cipher list 2");
}
#endif
useClientCert = 0;
if (useClientCert) {
useClientCert = 0;
}
}
if (useAnon) {
@@ -959,7 +965,9 @@ THREAD_RETURN WOLFSSL_THREAD client_test(void* args)
err_sys("client can't set cipher list 4");
}
#endif
useClientCert = 0;
if (useClientCert) {
useClientCert = 0;
}
}
#if defined(OPENSSL_EXTRA) || defined(HAVE_WEBSERVER)
@@ -1436,6 +1444,15 @@ THREAD_RETURN WOLFSSL_THREAD client_test(void* args)
ShowMemoryTracker();
#endif /* USE_WOLFSSL_MEMORY */
/* There are use cases when these assignments are not read. To avoid
* potential confusion those warnings have been handled here.
*/
(void) overrideDateErrors;
(void) useClientCert;
(void) verifyCert;
(void) ourCert;
(void) ourKey;
#if !defined(WOLFSSL_TIRTOS)
return 0;
#endif

View File

@@ -614,11 +614,15 @@ THREAD_RETURN CYASSL_THREAD server_test(void* args)
err_sys("server can't set cipher list 1");
#ifdef CYASSL_LEANPSK
usePsk = 1;
if (!usePsk) {
usePsk = 1;
}
#endif
#if defined(NO_RSA) && !defined(HAVE_ECC)
usePsk = 1;
if (!usePsk) {
usePsk = 1;
}
#endif
if (fewerPackets)
@@ -971,6 +975,15 @@ THREAD_RETURN CYASSL_THREAD server_test(void* args)
TicketCleanup();
#endif
/* There are use cases when these assignments are not read. To avoid
* potential confusion those warnings have been handled here.
*/
(void) ourKey;
(void) verifyCert;
(void) doCliCertCheck;
(void) useNtruKey;
(void) ourDhParam;
(void) ourCert;
#ifndef CYASSL_TIRTOS
return 0;
#endif

View File

@@ -8549,6 +8549,10 @@ static int BuildMessage(WOLFSSL* ssl, byte* output, int outSz,
int ret = 0;
int atomicUser = 0;
if (ssl == NULL || output == NULL || input == NULL) {
return BAD_FUNC_ARG;
}
#ifdef WOLFSSL_DTLS
if (ssl->options.dtls) {
sz += DTLS_RECORD_EXTRA;