Browse Source

openvpn: fix interface with mbedtls_sha256

Between mbedtls 2.6.0 and 2.7.0, the void returning mbedtls_MODULE* functions
were deprecated in favor of functions returning an int error code.  Use
the new function mbedtls_sha256_ret().

Signed-off-by: Russell Senior <[email protected]>
Tested-by: Koen Vandeputte <[email protected]>
Russell Senior 7 years ago
parent
commit
42b94a74e9

+ 11 - 0
package/network/services/openvpn/patches/300-mbedtls_dont_use_deprecated_sha256_function.patch

@@ -0,0 +1,11 @@
+--- a/src/openvpn/ssl_mbedtls.c
++++ b/src/openvpn/ssl_mbedtls.c
+@@ -803,7 +803,7 @@ tls_ctx_personalise_random(struct tls_ro
+     {
+         mbedtls_x509_crt *cert = ctx->crt_chain;
+ 
+-        mbedtls_sha256(cert->tbs.p, cert->tbs.len, sha256_hash, false);
++        mbedtls_sha256_ret(cert->tbs.p, cert->tbs.len, sha256_hash, false);
+         if (0 != memcmp(old_sha256_hash, sha256_hash, sizeof(sha256_hash)))
+         {
+             mbedtls_ctr_drbg_update(cd_ctx, sha256_hash, 32);