X-Git-Url: http://www.privoxy.org/gitweb/installation.html?a=blobdiff_plain;f=wolfssl.c;h=bdbf8e9b33882d11444ab84cf683512cccdfd54f;hb=HEAD;hp=08f3d71553538b705a1534809c70c181948179c2;hpb=34dbb5e07a859c5d1f14de8dfbf688ce7bf0e6f0;p=privoxy.git diff --git a/wolfssl.c b/wolfssl.c index 08f3d715..7f6c9646 100644 --- 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 + * Copyright : Copyright (C) 2018-2024 by Fabian Keil * Copyright (C) 2020 Maxim Antonov * Copyright (C) 2017 Vaclav Svec. FIT CVUT. * @@ -66,7 +66,7 @@ static int wolfssl_initialized = 0; * doesn't matter because we only use it with * the certificate_mutex locked. */ -static RNG wolfssl_rng; +static WC_RNG wolfssl_rng; #ifndef WOLFSSL_ALT_CERT_CHAINS /* @@ -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;