[Privoxy-commits] [privoxy] 02/10: MbedTLS: Use mbedtls_md5_ret() instead of mbedtls_md5()

User Git git at git.privoxy.org
Fri Jan 22 13:31:17 UTC 2021


This is an automated email from the git hooks/post-receive script.

git pushed a commit to branch master
in repository privoxy.

commit a473a2a85dbf5325b270a906e85785ba4b032503
Author: Fabian Keil <fk at fabiankeil.de>
AuthorDate: Fri Jan 22 09:13:14 2021 +0100

    MbedTLS: Use mbedtls_md5_ret() instead of mbedtls_md5()
    
    As Roland pointed out the latter has been deprecated
    years ago and causes a warning on Debian GNU/Linux.
---
 ssl.c | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/ssl.c b/ssl.c
index 58bd222c..f74f585c 100644
--- a/ssl.c
+++ b/ssl.c
@@ -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;

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Privoxy-commits mailing list