forked from wolfSSL/wolfssl
scan-build warnings related to enable-psk, disable-asn,rsa,ecc
This commit is contained in:
@@ -917,11 +917,15 @@ THREAD_RETURN WOLFSSL_THREAD client_test(void* args)
|
|||||||
}
|
}
|
||||||
|
|
||||||
#ifdef WOLFSSL_LEANPSK
|
#ifdef WOLFSSL_LEANPSK
|
||||||
|
if (!usePsk) {
|
||||||
usePsk = 1;
|
usePsk = 1;
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(NO_RSA) && !defined(HAVE_ECC)
|
#if defined(NO_RSA) && !defined(HAVE_ECC)
|
||||||
|
if (!usePsk) {
|
||||||
usePsk = 1;
|
usePsk = 1;
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (fewerPackets)
|
if (fewerPackets)
|
||||||
@@ -948,8 +952,10 @@ THREAD_RETURN WOLFSSL_THREAD client_test(void* args)
|
|||||||
err_sys("client can't set cipher list 2");
|
err_sys("client can't set cipher list 2");
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
if (useClientCert) {
|
||||||
useClientCert = 0;
|
useClientCert = 0;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (useAnon) {
|
if (useAnon) {
|
||||||
#ifdef HAVE_ANON
|
#ifdef HAVE_ANON
|
||||||
@@ -959,8 +965,10 @@ THREAD_RETURN WOLFSSL_THREAD client_test(void* args)
|
|||||||
err_sys("client can't set cipher list 4");
|
err_sys("client can't set cipher list 4");
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
if (useClientCert) {
|
||||||
useClientCert = 0;
|
useClientCert = 0;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#if defined(OPENSSL_EXTRA) || defined(HAVE_WEBSERVER)
|
#if defined(OPENSSL_EXTRA) || defined(HAVE_WEBSERVER)
|
||||||
wolfSSL_CTX_set_default_passwd_cb(ctx, PasswordCallBack);
|
wolfSSL_CTX_set_default_passwd_cb(ctx, PasswordCallBack);
|
||||||
@@ -1023,12 +1031,19 @@ THREAD_RETURN WOLFSSL_THREAD client_test(void* args)
|
|||||||
}
|
}
|
||||||
#endif /* WOLFSSL_TRUST_PEER_CERT */
|
#endif /* WOLFSSL_TRUST_PEER_CERT */
|
||||||
}
|
}
|
||||||
|
#else /* !NO_FILESYSTEM && !NO_CERTS */
|
||||||
|
(void) useClientCert;
|
||||||
|
(void) verifyCert;
|
||||||
|
(void) ourCert;
|
||||||
|
(void) ourKey;
|
||||||
#endif /* !NO_FILESYSTEM && !NO_CERTS */
|
#endif /* !NO_FILESYSTEM && !NO_CERTS */
|
||||||
#if !defined(NO_CERTS)
|
#if !defined(NO_CERTS)
|
||||||
if (!usePsk && !useAnon && doPeerCheck == 0)
|
if (!usePsk && !useAnon && doPeerCheck == 0)
|
||||||
wolfSSL_CTX_set_verify(ctx, SSL_VERIFY_NONE, 0);
|
wolfSSL_CTX_set_verify(ctx, SSL_VERIFY_NONE, 0);
|
||||||
if (!usePsk && !useAnon && overrideDateErrors == 1)
|
if (!usePsk && !useAnon && overrideDateErrors == 1)
|
||||||
wolfSSL_CTX_set_verify(ctx, SSL_VERIFY_PEER, myDateCb);
|
wolfSSL_CTX_set_verify(ctx, SSL_VERIFY_PEER, myDateCb);
|
||||||
|
#else
|
||||||
|
(void) overrideDateErrors;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef HAVE_CAVIUM
|
#ifdef HAVE_CAVIUM
|
||||||
|
@@ -614,11 +614,15 @@ THREAD_RETURN CYASSL_THREAD server_test(void* args)
|
|||||||
err_sys("server can't set cipher list 1");
|
err_sys("server can't set cipher list 1");
|
||||||
|
|
||||||
#ifdef CYASSL_LEANPSK
|
#ifdef CYASSL_LEANPSK
|
||||||
|
if (!usePsk) {
|
||||||
usePsk = 1;
|
usePsk = 1;
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(NO_RSA) && !defined(HAVE_ECC)
|
#if defined(NO_RSA) && !defined(HAVE_ECC)
|
||||||
|
if (!usePsk) {
|
||||||
usePsk = 1;
|
usePsk = 1;
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (fewerPackets)
|
if (fewerPackets)
|
||||||
@@ -635,6 +639,8 @@ THREAD_RETURN CYASSL_THREAD server_test(void* args)
|
|||||||
err_sys("can't load server cert file, check file and run from"
|
err_sys("can't load server cert file, check file and run from"
|
||||||
" wolfSSL home dir");
|
" wolfSSL home dir");
|
||||||
}
|
}
|
||||||
|
#else
|
||||||
|
(void) ourCert;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef NO_DH
|
#ifndef NO_DH
|
||||||
@@ -656,6 +662,9 @@ THREAD_RETURN CYASSL_THREAD server_test(void* args)
|
|||||||
err_sys("can't load server private key file, check file and run "
|
err_sys("can't load server private key file, check file and run "
|
||||||
"from wolfSSL home dir");
|
"from wolfSSL home dir");
|
||||||
}
|
}
|
||||||
|
#else
|
||||||
|
(void) ourKey;
|
||||||
|
(void) useNtruKey;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (usePsk || usePskPlus) {
|
if (usePsk || usePskPlus) {
|
||||||
@@ -709,6 +718,9 @@ THREAD_RETURN CYASSL_THREAD server_test(void* args)
|
|||||||
}
|
}
|
||||||
#endif /* WOLFSSL_TRUST_PEER_CERT */
|
#endif /* WOLFSSL_TRUST_PEER_CERT */
|
||||||
}
|
}
|
||||||
|
#else
|
||||||
|
(void) verifyCert;
|
||||||
|
(void) doCliCertCheck;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(CYASSL_SNIFFER)
|
#if defined(CYASSL_SNIFFER)
|
||||||
@@ -832,7 +844,10 @@ THREAD_RETURN CYASSL_THREAD server_test(void* args)
|
|||||||
#if !defined(NO_FILESYSTEM) && !defined(NO_DH) && !defined(NO_ASN)
|
#if !defined(NO_FILESYSTEM) && !defined(NO_DH) && !defined(NO_ASN)
|
||||||
CyaSSL_SetTmpDH_file(ssl, ourDhParam, SSL_FILETYPE_PEM);
|
CyaSSL_SetTmpDH_file(ssl, ourDhParam, SSL_FILETYPE_PEM);
|
||||||
#elif !defined(NO_DH)
|
#elif !defined(NO_DH)
|
||||||
|
(void) ourDhParam;
|
||||||
SetDH(ssl); /* repick suites with DHE, higher priority than PSK */
|
SetDH(ssl); /* repick suites with DHE, higher priority than PSK */
|
||||||
|
#else
|
||||||
|
(void) ourDhParam;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -8549,6 +8549,10 @@ static int BuildMessage(WOLFSSL* ssl, byte* output, int outSz,
|
|||||||
int ret = 0;
|
int ret = 0;
|
||||||
int atomicUser = 0;
|
int atomicUser = 0;
|
||||||
|
|
||||||
|
if (ssl == NULL || output == NULL || input == NULL) {
|
||||||
|
return BAD_FUNC_ARG;
|
||||||
|
}
|
||||||
|
|
||||||
#ifdef WOLFSSL_DTLS
|
#ifdef WOLFSSL_DTLS
|
||||||
if (ssl->options.dtls) {
|
if (ssl->options.dtls) {
|
||||||
sz += DTLS_RECORD_EXTRA;
|
sz += DTLS_RECORD_EXTRA;
|
||||||
|
Reference in New Issue
Block a user