X-Git-Url: http://www.privoxy.org/gitweb/?a=blobdiff_plain;f=ssl.c;h=cf1e8a0d494c5e7221b1a6f99b1166de9cddb710;hb=b14150078393effcdaf37c436b789919e2ea12af;hp=abc7df68f71e9e33b726f2a69b17a12f487d7d35;hpb=08a9e6314693f8137b1163e2c56b41904d4b3da7;p=privoxy.git diff --git a/ssl.c b/ssl.c index abc7df68..cf1e8a0d 100644 --- a/ssl.c +++ b/ssl.c @@ -1740,6 +1740,7 @@ static int ssl_verify_callback(void *csp_void, mbedtls_x509_crt *crt, { char buf[CERT_INFO_BUF_SIZE]; char *encoded_text; +#define CERT_INFO_PREFIX "" mbedtls_x509_crt_info(buf, sizeof(buf), CERT_INFO_PREFIX, crt); encoded_text = html_encode(buf); @@ -1767,7 +1768,7 @@ static int ssl_verify_callback(void *csp_void, mbedtls_x509_crt *crt, * Parameters : * 1 : csp = Current client state (buffers, headers, etc...) * - * Returns : 1 => Error while creating hash + * Returns : -1 => Error while creating hash * 0 => Hash created successfully * *********************************************************************/ @@ -1779,8 +1780,15 @@ static int host_to_hash(struct client_state *csp) #error mbedTLS needs to be compiled with md5 support #else memset(csp->http->hash_of_host, 0, sizeof(csp->http->hash_of_host)); - mbedtls_md5((unsigned char *)csp->http->host, strlen(csp->http->host), - csp->http->hash_of_host); + ret = mbedtls_md5_ret((unsigned char *)csp->http->host, + strlen(csp->http->host), csp->http->hash_of_host); + if (ret != 0) + { + log_error(LOG_LEVEL_ERROR, + "Failed to generate md5 hash of host %s: %d", + csp->http->host, ret); + return -1; + } /* Converting hash into string with hex */ size_t i = 0; @@ -1894,6 +1902,7 @@ extern void ssl_crt_verify_info(char *buf, size_t size, struct client_state *csp } +#ifdef FEATURE_GRACEFUL_TERMINATION /********************************************************************* * * Function : ssl_release @@ -1913,6 +1922,7 @@ extern void ssl_release(void) mbedtls_entropy_free(&entropy); } } +#endif /* def FEATURE_GRACEFUL_TERMINATION */ /*********************************************************************