diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/s_client.c | 40 |
1 files changed, 11 insertions, 29 deletions
diff --git a/src/s_client.c b/src/s_client.c index b2a0f06..80570b8 100644 --- a/src/s_client.c +++ b/src/s_client.c @@ -307,14 +307,8 @@ s_client(int argc, char **argv) wolfSSL_Init(); - method = wolfTLSv1_2_client_method(); - if (method == NULL) { - fputs("Out of memory\n", stderr); - goto error; - } - - ctx = wolfSSL_CTX_new(method); - if (ctx == NULL) { + if ((method = wolfTLSv1_2_client_method()) == NULL || + (ctx = wolfSSL_CTX_new(method)) == NULL) { fputs("Out of memory\n", stderr); goto error; } @@ -326,33 +320,21 @@ s_client(int argc, char **argv) goto error; } + (void) servername; + if ( #ifdef HAVE_OCSP - if (wolfSSL_CTX_EnableOCSP(ctx, WOLFSSL_OCSP_CHECKALL) != - WOLFSSL_SUCCESS) { - fputs("Failed to enable OCSP\n", stderr); - goto error; - } + wolfSSL_CTX_EnableOCSP(ctx, WOLFSSL_OCSP_CHECKALL) != + WOLFSSL_SUCCESS || #endif #ifdef HAVE_SNI - if (servername != NULL) { - if (wolfSSL_CTX_UseSNI(ctx, WOLFSSL_SNI_HOST_NAME, servername, - strlen(servername)) != WOLFSSL_SUCCESS){ - fputs("Out of memory\n", stderr); - goto error; - } - } -#else - (void) servername; + (servername != NULL && wolfSSL_CTX_UseSNI(ctx, + WOLFSSL_SNI_HOST_NAME, servername, + strlen(servername)) != WOLFSSL_SUCCESS) || #endif #ifdef HAVE_SUPPORTED_CURVES - if (use_curves(ctx) == false) { - fputs("Out of memory\n", stderr); - goto error; - } + use_curves(ctx) == false || #endif - - ssl = wolfSSL_new(ctx); - if (ssl == NULL) { + (ssl = wolfSSL_new(ctx)) == NULL) { fputs("Out of memory\n", stderr); goto error; } |