Merge pull request #298 from kaleb-himes/master

Avoid unnecessary assignments in client example
This commit is contained in:
Kaleb Joseph Himes
2016-02-09 09:54:55 -08:00

View File

@@ -737,20 +737,19 @@ THREAD_RETURN WOLFSSL_THREAD client_test(void* args)
if (externalTest) { if (externalTest) {
/* detect build cases that wouldn't allow test against wolfssl.com */ /* detect build cases that wouldn't allow test against wolfssl.com */
int done = 0; int done = 0;
(void)done;
#ifdef NO_RSA #ifdef NO_RSA
done = 1; done += 1;
#endif #endif
/* www.globalsign.com does not respond to ipv6 ocsp requests */ /* www.globalsign.com does not respond to ipv6 ocsp requests */
#if defined(TEST_IPV6) && defined(HAVE_OCSP) #if defined(TEST_IPV6) && defined(HAVE_OCSP)
done = 1; done += 1;
#endif #endif
/* www.globalsign.com has limited supported cipher suites */ /* www.globalsign.com has limited supported cipher suites */
#if defined(NO_AES) && defined(HAVE_OCSP) #if defined(NO_AES) && defined(HAVE_OCSP)
done = 1; done += 1;
#endif #endif
/* www.globalsign.com only supports static RSA or ECDHE with AES */ /* www.globalsign.com only supports static RSA or ECDHE with AES */
@@ -758,33 +757,36 @@ THREAD_RETURN WOLFSSL_THREAD client_test(void* args)
* as some users will most likely be on 32-bit systems where ECC * as some users will most likely be on 32-bit systems where ECC
* is not enabled by default */ * is not enabled by default */
#if defined(HAVE_OCSP) && !defined(HAVE_ECC) #if defined(HAVE_OCSP) && !defined(HAVE_ECC)
done = 1; done += 1;
#endif #endif
#ifndef NO_PSK #ifndef NO_PSK
done = 1; done += 1;
#endif #endif
#ifdef NO_SHA #ifdef NO_SHA
done = 1; /* external cert chain most likely has SHA */ done += 1; /* external cert chain most likely has SHA */
#endif #endif
#if !defined(HAVE_ECC) && !defined(WOLFSSL_STATIC_RSA) #if !defined(HAVE_ECC) && !defined(WOLFSSL_STATIC_RSA)
if (!XSTRNCMP(domain, "www.google.com", 14) || if (!XSTRNCMP(domain, "www.google.com", 14) ||
!XSTRNCMP(domain, "www.wolfssl.com", 15)) { !XSTRNCMP(domain, "www.wolfssl.com", 15)) {
done = 1; /* google/wolfssl need ECDHE or static RSA */ /* google/wolfssl need ECDHE or static RSA */
done += 1;
} }
#endif #endif
#if !defined(WOLFSSL_SHA384) #if !defined(WOLFSSL_SHA384)
if (!XSTRNCMP(domain, "www.wolfssl.com", 15)) { if (!XSTRNCMP(domain, "www.wolfssl.com", 15)) {
done = 1; /* wolfssl need sha384 for cert chain verify */ /* wolfssl need sha384 for cert chain verify */
done += 1;
} }
#endif #endif
#if !defined(HAVE_AESGCM) && defined(NO_AES) && \ #if !defined(HAVE_AESGCM) && defined(NO_AES) && \
!(defined(HAVE_CHACHA) && defined(HAVE_POLY1305)) !(defined(HAVE_CHACHA) && defined(HAVE_POLY1305))
done = 1; /* need at least on of these for external tests */ /* need at least on of these for external tests */
done += 1;
#endif #endif
if (done) { if (done) {