Add www.proxidize.com as Bronze level sponsor
[privoxy.git] / wolfssl.c
index 0ca0605..7f6c964 100644 (file)
--- a/wolfssl.c
+++ b/wolfssl.c
@@ -6,7 +6,7 @@
  *                creating, using and closing TLS/SSL connections
  *                using wolfSSL.
  *
- * Copyright   :  Copyright (C) 2018-2021 by Fabian Keil <fk@fabiankeil.de>
+ * Copyright   :  Copyright (C) 2018-2024 by Fabian Keil <fk@fabiankeil.de>
  *                Copyright (C) 2020 Maxim Antonov <mantonov@gmail.com>
  *                Copyright (C) 2017 Vaclav Svec. FIT CVUT.
  *
@@ -736,7 +736,7 @@ exit:
  *********************************************************************/
 static int host_to_hash(struct client_state *csp)
 {
-   Md5 md5;
+   wc_Md5 md5;
    int ret;
    size_t i;
 
@@ -960,7 +960,7 @@ static void shutdown_connection(WOLFSSL *ssl, const char *type)
    int shutdown_attempts = 0;
    int ret;
    int fd;
-   enum { MAX_SHUTDOWN_ATTEMPTS = 2 };
+   enum { MAX_SHUTDOWN_ATTEMPTS = 5 };
 
    fd = wolfSSL_get_fd(ssl);
 
@@ -973,9 +973,9 @@ static void shutdown_connection(WOLFSSL *ssl, const char *type)
          return;
       }
       ret = wolfSSL_shutdown(ssl);
+      shutdown_attempts++;
       if (WOLFSSL_SUCCESS != ret)
       {
-         shutdown_attempts++;
          log_error(LOG_LEVEL_CONNECT, "Failed to shutdown %s connection "
             "on socket %d. Attempts so far: %d, ret: %d", type, fd,
             shutdown_attempts, ret);
@@ -1201,7 +1201,11 @@ extern int create_server_ssl_connection(struct client_state *csp)
    {
       long verify_result = wolfSSL_get_error(ssl, connect_ret);
 
+#if LIBWOLFSSL_VERSION_HEX > 0x05005004
       if (verify_result == WOLFSSL_X509_V_OK)
+#else
+      if (verify_result == X509_V_OK)
+#endif
       {
          ret = 0;
          csp->server_cert_verification_result = SSL_CERT_VALID;