Skip to content

Commit

Permalink
Addressing PR comment
Browse files Browse the repository at this point in the history
  • Loading branch information
Andras Fekete committed May 1, 2024
1 parent 077ac68 commit 21b7c8e
Show file tree
Hide file tree
Showing 13 changed files with 39 additions and 26 deletions.
5 changes: 3 additions & 2 deletions tls/client-tls-bio.c
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,11 @@ int main(int argc, char** argv)

/* Create and initialize WOLFSSL_CTX */
#ifdef USE_TLSV13
if ((ctx = wolfSSL_CTX_new(wolfTLSv1_3_client_method())) == NULL) {
ctx = wolfSSL_CTX_new(wolfTLSv1_3_client_method());
#else
if ((ctx = wolfSSL_CTX_new(wolfTLSv1_2_client_method())) == NULL) {
ctx = wolfSSL_CTX_new(wolfTLSv1_2_client_method());
#endif
if (ctx == NULL) {
fprintf(stderr, "ERROR: failed to create WOLFSSL_CTX\n");
ret = -1;
goto exit;
Expand Down
5 changes: 3 additions & 2 deletions tls/client-tls-cacb.c
Original file line number Diff line number Diff line change
Expand Up @@ -133,10 +133,11 @@ int Security(int sock)

/* create and initialize WOLFSSL_CTX structure */
#ifdef USE_TLSV13
if ((ctx = wolfSSL_CTX_new(wolfTLSv1_3_client_method())) == NULL) {
ctx = wolfSSL_CTX_new(wolfTLSv1_3_client_method());
#else
if ((ctx = wolfSSL_CTX_new(wolfTLSv1_2_client_method())) == NULL) {
ctx = wolfSSL_CTX_new(wolfTLSv1_2_client_method());
#endif
if (ctx == NULL) {
printf("SSL_CTX_new error.\n");
ret = EXIT_FAILURE;
goto exit;
Expand Down
5 changes: 3 additions & 2 deletions tls/client-tls-callback.c
Original file line number Diff line number Diff line change
Expand Up @@ -180,10 +180,11 @@ int main(int argc, char** argv)

/* Create and initialize WOLFSSL_CTX */
#ifdef USE_TLSV13
if ((ctx = wolfSSL_CTX_new(wolfTLSv1_3_client_method())) == NULL) {
ctx = wolfSSL_CTX_new(wolfTLSv1_3_client_method());
#else
if ((ctx = wolfSSL_CTX_new(wolfTLSv1_2_client_method())) == NULL) {
ctx = wolfSSL_CTX_new(wolfTLSv1_2_client_method());
#endif
if (ctx == NULL) {
fprintf(stderr, "ERROR: failed to create WOLFSSL_CTX\n");
ret = -1;
goto exit;
Expand Down
5 changes: 3 additions & 2 deletions tls/client-tls-cryptocb.c
Original file line number Diff line number Diff line change
Expand Up @@ -138,10 +138,11 @@ int main(int argc, char** argv)

/* Create and initialize WOLFSSL_CTX */
#ifdef USE_TLSV13
if ((ctx = wolfSSL_CTX_new(wolfTLSv1_3_client_method())) == NULL) {
ctx = wolfSSL_CTX_new(wolfTLSv1_3_client_method());
#else
if ((ctx = wolfSSL_CTX_new(wolfTLSv1_2_client_method())) == NULL) {
ctx = wolfSSL_CTX_new(wolfTLSv1_2_client_method());
#endif
if (ctx == NULL) {
fprintf(stderr, "ERROR: failed to create WOLFSSL_CTX\n");
ret = -1;
goto exit;
Expand Down
5 changes: 3 additions & 2 deletions tls/client-tls-ecdhe.c
Original file line number Diff line number Diff line change
Expand Up @@ -84,10 +84,11 @@ int main(int argc, char** argv)

/* Create and initialize WOLFSSL_CTX */
#ifdef USE_TLSV13
if ((ctx = wolfSSL_CTX_new(wolfTLSv1_3_client_method())) == NULL) {
ctx = wolfSSL_CTX_new(wolfTLSv1_3_client_method());
#else
if ((ctx = wolfSSL_CTX_new(wolfTLSv1_2_client_method())) == NULL) {
ctx = wolfSSL_CTX_new(wolfTLSv1_2_client_method());
#endif
if (ctx == NULL) {
fprintf(stderr, "ERROR: failed to create WOLFSSL_CTX\n");
ret = -1;
goto exit;
Expand Down
5 changes: 3 additions & 2 deletions tls/client-tls-nonblocking.c
Original file line number Diff line number Diff line change
Expand Up @@ -132,10 +132,11 @@ int main(int argc, char** argv)

/* Create and initialize WOLFSSL_CTX */
#ifdef USE_TLSV13
if ((ctx = wolfSSL_CTX_new(wolfTLSv1_3_client_method())) == NULL) {
ctx = wolfSSL_CTX_new(wolfTLSv1_3_client_method());
#else
if ((ctx = wolfSSL_CTX_new(wolfTLSv1_2_client_method())) == NULL) {
ctx = wolfSSL_CTX_new(wolfTLSv1_2_client_method());
#endif
if (ctx == NULL) {
fprintf(stderr, "ERROR: failed to create WOLFSSL_CTX\n");
ret = -1;
goto exit;
Expand Down
5 changes: 3 additions & 2 deletions tls/client-tls-pkcs12.c
Original file line number Diff line number Diff line change
Expand Up @@ -134,10 +134,11 @@ int main(int argc, char** argv)

/* Create and initialize WOLFSSL_CTX */
#ifdef USE_TLSV13
if ((ctx = wolfSSL_CTX_new(wolfTLSv1_3_client_method())) == NULL) {
ctx = wolfSSL_CTX_new(wolfTLSv1_3_client_method());
#else
if ((ctx = wolfSSL_CTX_new(wolfTLSv1_2_client_method())) == NULL) {
ctx = wolfSSL_CTX_new(wolfTLSv1_2_client_method());
#endif
if (ctx == NULL) {
fprintf(stderr, "ERROR: failed to create WOLFSSL_CTX\n");
return -1;
}
Expand Down
5 changes: 3 additions & 2 deletions tls/client-tls.c
Original file line number Diff line number Diff line change
Expand Up @@ -101,10 +101,11 @@ int main(int argc, char** argv)

/* Create and initialize WOLFSSL_CTX */
#ifdef USE_TLSV13
if ((ctx = wolfSSL_CTX_new(wolfTLSv1_3_client_method())) == NULL) {
ctx = wolfSSL_CTX_new(wolfTLSv1_3_client_method());
#else
if ((ctx = wolfSSL_CTX_new(wolfTLSv1_2_client_method())) == NULL) {
ctx = wolfSSL_CTX_new(wolfTLSv1_2_client_method());
#endif
if (ctx == NULL) {
fprintf(stderr, "ERROR: failed to create WOLFSSL_CTX\n");
ret = -1;
goto socket_cleanup;
Expand Down
5 changes: 3 additions & 2 deletions tls/server-tls-callback.c
Original file line number Diff line number Diff line change
Expand Up @@ -178,10 +178,11 @@ int main()

/* Create and initialize WOLFSSL_CTX */
#ifdef USE_TLSV13
if ((ctx = wolfSSL_CTX_new(wolfTLSv1_3_server_method())) == NULL) {
ctx = wolfSSL_CTX_new(wolfTLSv1_3_server_method());
#else
if ((ctx = wolfSSL_CTX_new(wolfTLSv1_2_server_method())) == NULL) {
ctx = wolfSSL_CTX_new(wolfTLSv1_2_server_method());
#endif
if (ctx == NULL) {
fprintf(stderr, "ERROR: failed to create WOLFSSL_CTX\n");
ret = -1;
goto exit;
Expand Down
5 changes: 3 additions & 2 deletions tls/server-tls-ecdhe.c
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,11 @@ int main()

/* Create and initialize WOLFSSL_CTX */
#ifdef USE_TLSV13
if ((ctx = wolfSSL_CTX_new(wolfTLSv1_3_server_method())) == NULL) {
ctx = wolfSSL_CTX_new(wolfTLSv1_3_server_method());
#else
if ((ctx = wolfSSL_CTX_new(wolfTLSv1_2_server_method())) == NULL) {
ctx = wolfSSL_CTX_new(wolfTLSv1_2_server_method());
#endif
if (ctx == NULL) {
fprintf(stderr, "ERROR: failed to create WOLFSSL_CTX\n");
ret = -1;
goto exit;
Expand Down
5 changes: 3 additions & 2 deletions tls/server-tls-nonblocking.c
Original file line number Diff line number Diff line change
Expand Up @@ -132,10 +132,11 @@ int main()

/* Create and initialize WOLFSSL_CTX */
#ifdef USE_TLSV13
if ((ctx = wolfSSL_CTX_new(wolfTLSv1_3_server_method())) == NULL) {
ctx = wolfSSL_CTX_new(wolfTLSv1_3_server_method());
#else
if ((ctx = wolfSSL_CTX_new(wolfTLSv1_2_server_method())) == NULL) {
ctx = wolfSSL_CTX_new(wolfTLSv1_2_server_method());
#endif
if (ctx == NULL) {
fprintf(stderr, "ERROR: failed to create WOLFSSL_CTX\n");
ret = -1;
goto exit;
Expand Down
5 changes: 3 additions & 2 deletions tls/server-tls-threaded.c
Original file line number Diff line number Diff line change
Expand Up @@ -201,10 +201,11 @@ int main()

/* Create and initialize WOLFSSL_CTX */
#ifdef USE_TLSV13
if ((ctx = wolfSSL_CTX_new(wolfTLSv1_3_server_method())) == NULL) {
ctx = wolfSSL_CTX_new(wolfTLSv1_3_server_method());
#else
if ((ctx = wolfSSL_CTX_new(wolfTLSv1_2_server_method())) == NULL) {
ctx = wolfSSL_CTX_new(wolfTLSv1_2_server_method());
#endif
if (ctx == NULL) {
fprintf(stderr, "ERROR: failed to create WOLFSSL_CTX\n");
ret = -1;
goto exit;
Expand Down
5 changes: 3 additions & 2 deletions tls/server-tls.c
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,11 @@ int main()

/* Create and initialize WOLFSSL_CTX */
#ifdef USE_TLSV13
if ((ctx = wolfSSL_CTX_new(wolfTLSv1_3_server_method())) == NULL) {
ctx = wolfSSL_CTX_new(wolfTLSv1_3_server_method());
#else
if ((ctx = wolfSSL_CTX_new(wolfTLSv1_2_server_method())) == NULL) {
ctx = wolfSSL_CTX_new(wolfTLSv1_2_server_method());
#endif
if (ctx == NULL) {
fprintf(stderr, "ERROR: failed to create WOLFSSL_CTX\n");
ret = -1;
goto exit;
Expand Down

0 comments on commit 21b7c8e

Please sign in to comment.