X-Git-Url: http://www.privoxy.org/gitweb/?p=privoxy.git;a=blobdiff_plain;f=ssl.c;h=4f187c24070b94328802cfe4ef3d2b7e59883f65;hp=58bd222cd76e2d30747a893b041ecea9e718a054;hb=a2f8296e90e9bc3c4e4fa50c9b42e3f12bce24ca;hpb=f2be4cfb0e98db4cf6fcf33f3f1efadabe399887 diff --git a/ssl.c b/ssl.c index 58bd222c..4f187c24 100644 --- a/ssl.c +++ b/ssl.c @@ -1768,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 * *********************************************************************/ @@ -1780,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;