wolfSSL: Use X509_V_OK if it's available
[privoxy.git] / wolfssl.c
index 08f3d71..a13fbb1 100644 (file)
--- a/wolfssl.c
+++ b/wolfssl.c
@@ -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;
 
@@ -1201,7 +1201,11 @@ extern int create_server_ssl_connection(struct client_state *csp)
    {
       long verify_result = wolfSSL_get_error(ssl, connect_ret);
 
+#ifdef X509_V_OK
+      if (verify_result == X509_V_OK)
+#else
       if (verify_result == WOLFSSL_X509_V_OK)
+#endif
       {
          ret = 0;
          csp->server_cert_verification_result = SSL_CERT_VALID;