void-packages/srcpkgs/dislocker/patches/mbedtls3.patch

29 lines
942 B
Diff

From 2cfbba2c8cc07e529622ba134d0a6982815d2b30 Mon Sep 17 00:00:00 2001
From: "Julio C. Rocha" <dev@rocha.red>
Date: Wed, 13 Sep 2023 19:07:27 -0700
Subject: [PATCH] Support mbedtls 3
---
include/dislocker/ssl_bindings.h.in | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/include/dislocker/ssl_bindings.h.in b/include/dislocker/ssl_bindings.h.in
index c1990b2..34e05df 100644
--- a/include/dislocker/ssl_bindings.h.in
+++ b/include/dislocker/ssl_bindings.h.in
@@ -26,8 +26,13 @@
/*
* Here stand the bindings for polarssl SHA256/SHA2/SHA-2 function for dislocker
*/
-#include "@POLARSSL_INC_FOLDER@/config.h"
#include "@POLARSSL_INC_FOLDER@/version.h"
+#if MBEDTLS_VERSION_MAJOR >= 3
+#include "@POLARSSL_INC_FOLDER@/mbedtls_config.h"
+#include "@POLARSSL_INC_FOLDER@/compat-2.x.h"
+#else
+#include "@POLARSSL_INC_FOLDER@/config.h"
+#endif
#include "@POLARSSL_INC_FOLDER@/aes.h"
// Function's name changed