aboutsummaryrefslogtreecommitdiffstats
path: root/testing/dislocker
diff options
context:
space:
mode:
Diffstat (limited to 'testing/dislocker')
-rw-r--r--testing/dislocker/APKBUILD31
-rw-r--r--testing/dislocker/fix-build.patch147
-rw-r--r--testing/dislocker/mbedtls-3.patch23
3 files changed, 194 insertions, 7 deletions
diff --git a/testing/dislocker/APKBUILD b/testing/dislocker/APKBUILD
index 19fbde167c7..4d9f6aa0eac 100644
--- a/testing/dislocker/APKBUILD
+++ b/testing/dislocker/APKBUILD
@@ -2,23 +2,40 @@
# Maintainer: TBK <alpine@jjtc.eu>
pkgname=dislocker
pkgver=0.7.3
-pkgrel=0
+pkgrel=5
pkgdesc="Read/write Windows BitLocker-ed volumes"
url="https://github.com/Aorimn/dislocker"
arch="all"
license="GPL-2.0-or-later"
options="!check" # No test suite
-makedepends="cmake fuse-dev mbedtls-dev ruby-dev"
+depends="ruby"
+makedepends="
+ cmake
+ fuse-dev
+ mbedtls-dev
+ ruby-dev
+ samurai
+ "
subpackages="$pkgname-doc $pkgname-libs"
-source="$pkgname-$pkgver.tar.gz::https://github.com/Aorimn/dislocker/archive/v$pkgver.tar.gz"
+source="$pkgname-$pkgver.tar.gz::https://github.com/Aorimn/dislocker/archive/v$pkgver.tar.gz
+ fix-build.patch
+ mbedtls-3.patch
+ "
build() {
- cmake -DCMAKE_INSTALL_PREFIX=/usr .
- make
+ cmake -B build -G Ninja \
+ -DCMAKE_INSTALL_PREFIX=/usr \
+ -DCMAKE_BUILD_TYPE=MinSizeRel
+
+ cmake --build build
}
package() {
- make DESTDIR="$pkgdir" install
+ DESTDIR="$pkgdir" cmake --install build
}
-sha512sums="c62241d70d51f6445a2f6d0f08e099bbc1a4257ca98232471fc43ec63e69d62ae5f702c995ec00b7e1db7d33f4bb3a31ea05bc13862bf3b539feb301a0e034ff dislocker-0.7.3.tar.gz"
+sha512sums="
+c62241d70d51f6445a2f6d0f08e099bbc1a4257ca98232471fc43ec63e69d62ae5f702c995ec00b7e1db7d33f4bb3a31ea05bc13862bf3b539feb301a0e034ff dislocker-0.7.3.tar.gz
+7041559becbb5136d52b9494898ab3e315bdd7eddef7276e5f3f3cacd8a585718407d9fbcb9c589cc8702519d95cc4a37b6442358a5e8a3281ef5b05591295e6 fix-build.patch
+4b89b8357799fb1de5421d2b3d0390b3d39e6dda13b606120f52b6fda83a75c3d199c8cdea43cff7abb8b68d1fcb71314c108ff80b092c6f949d5564f67cd6f5 mbedtls-3.patch
+"
diff --git a/testing/dislocker/fix-build.patch b/testing/dislocker/fix-build.patch
new file mode 100644
index 00000000000..d9ba5609eac
--- /dev/null
+++ b/testing/dislocker/fix-build.patch
@@ -0,0 +1,147 @@
+diff -U3 -r a/src/config.c b/src/config.c
+--- a/src/config.c 2022-04-25 20:41:04.627290032 +0200
++++ b/src/config.c 2022-04-25 20:44:19.075583833 +0200
+@@ -56,13 +56,13 @@
+ static void setclearkey(dis_context_t dis_ctx, char* optarg)
+ {
+ (void) optarg;
+- int true = TRUE;
+- dis_setopt(dis_ctx, DIS_OPT_USE_CLEAR_KEY, &true);
++ int flag = TRUE;
++ dis_setopt(dis_ctx, DIS_OPT_USE_CLEAR_KEY, &flag);
+ }
+ static void setbekfile(dis_context_t dis_ctx, char* optarg)
+ {
+- int true = TRUE;
+- dis_setopt(dis_ctx, DIS_OPT_USE_BEK_FILE, &true);
++ int flag = TRUE;
++ dis_setopt(dis_ctx, DIS_OPT_USE_BEK_FILE, &flag);
+ dis_setopt(dis_ctx, DIS_OPT_SET_BEK_FILE_PATH, optarg);
+ }
+ static void setforceblock(dis_context_t dis_ctx, char* optarg)
+@@ -76,14 +76,14 @@
+ }
+ static void setfvek(dis_context_t dis_ctx, char* optarg)
+ {
+- int true = TRUE;
+- dis_setopt(dis_ctx, DIS_OPT_USE_FVEK_FILE, &true);
++ int flag = TRUE;
++ dis_setopt(dis_ctx, DIS_OPT_USE_FVEK_FILE, &flag);
+ dis_setopt(dis_ctx, DIS_OPT_SET_FVEK_FILE_PATH, optarg);
+ }
+ static void setvmk(dis_context_t dis_ctx, char* optarg)
+ {
+- int true = TRUE;
+- dis_setopt(dis_ctx, DIS_OPT_USE_VMK_FILE, &true);
++ int flag = TRUE;
++ dis_setopt(dis_ctx, DIS_OPT_USE_VMK_FILE, &flag);
+ dis_setopt(dis_ctx, DIS_OPT_SET_VMK_FILE_PATH, optarg);
+ }
+ static void setlogfile(dis_context_t dis_ctx, char* optarg)
+@@ -97,8 +97,8 @@
+ }
+ static void setrecoverypwd(dis_context_t dis_ctx, char* optarg)
+ {
+- int true = TRUE;
+- dis_setopt(dis_ctx, DIS_OPT_USE_RECOVERY_PASSWORD, &true);
++ int flag = TRUE;
++ dis_setopt(dis_ctx, DIS_OPT_USE_RECOVERY_PASSWORD, &flag);
+ dis_setopt(dis_ctx, DIS_OPT_SET_RECOVERY_PASSWORD, optarg);
+ hide_opt(optarg);
+ }
+@@ -111,19 +111,19 @@
+ static void setro(dis_context_t dis_ctx, char* optarg)
+ {
+ (void) optarg;
+- int true = TRUE;
+- dis_setopt(dis_ctx, DIS_OPT_READ_ONLY, &true);
++ int flag = TRUE;
++ dis_setopt(dis_ctx, DIS_OPT_READ_ONLY, &flag);
+ }
+ static void setstateok(dis_context_t dis_ctx, char* optarg)
+ {
+ (void) optarg;
+- int true = TRUE;
+- dis_setopt(dis_ctx, DIS_OPT_DONT_CHECK_VOLUME_STATE, &true);
++ int flag = TRUE;
++ dis_setopt(dis_ctx, DIS_OPT_DONT_CHECK_VOLUME_STATE, &flag);
+ }
+ static void setuserpassword(dis_context_t dis_ctx, char* optarg)
+ {
+- int true = TRUE;
+- dis_setopt(dis_ctx, DIS_OPT_USE_USER_PASSWORD, &true);
++ int flag = TRUE;
++ dis_setopt(dis_ctx, DIS_OPT_USE_USER_PASSWORD, &flag);
+ dis_setopt(dis_ctx, DIS_OPT_SET_USER_PASSWORD, optarg);
+ hide_opt(optarg);
+ }
+@@ -266,7 +266,7 @@
+ return -1;
+
+ dis_config_t* cfg = &dis_ctx->cfg;
+- int true = TRUE;
++ int flag = TRUE;
+
+
+ long_opts = malloc(nb_options * sizeof(struct option));
+@@ -285,12 +285,12 @@
+ {
+ case 'c':
+ {
+- dis_setopt(dis_ctx, DIS_OPT_USE_CLEAR_KEY, &true);
++ dis_setopt(dis_ctx, DIS_OPT_USE_CLEAR_KEY, &flag);
+ break;
+ }
+ case 'f':
+ {
+- dis_setopt(dis_ctx, DIS_OPT_USE_BEK_FILE, &true);
++ dis_setopt(dis_ctx, DIS_OPT_USE_BEK_FILE, &flag);
+ dis_setopt(dis_ctx, DIS_OPT_SET_BEK_FILE_PATH, optarg);
+ break;
+ }
+@@ -312,13 +312,13 @@
+ }
+ case 'k':
+ {
+- dis_setopt(dis_ctx, DIS_OPT_USE_FVEK_FILE, &true);
++ dis_setopt(dis_ctx, DIS_OPT_USE_FVEK_FILE, &flag);
+ dis_setopt(dis_ctx, DIS_OPT_SET_FVEK_FILE_PATH, optarg);
+ break;
+ }
+ case 'K':
+ {
+- dis_setopt(dis_ctx, DIS_OPT_USE_VMK_FILE, &true);
++ dis_setopt(dis_ctx, DIS_OPT_USE_VMK_FILE, &flag);
+ dis_setopt(dis_ctx, DIS_OPT_SET_VMK_FILE_PATH, optarg);
+ break;
+ }
+@@ -340,7 +340,7 @@
+ }
+ case 'p':
+ {
+- dis_setopt(dis_ctx, DIS_OPT_USE_RECOVERY_PASSWORD, &true);
++ dis_setopt(dis_ctx, DIS_OPT_USE_RECOVERY_PASSWORD, &flag);
+ dis_setopt(dis_ctx, DIS_OPT_SET_RECOVERY_PASSWORD, optarg);
+ hide_opt(optarg);
+ break;
+@@ -353,17 +353,17 @@
+ }
+ case 'r':
+ {
+- dis_setopt(dis_ctx, DIS_OPT_READ_ONLY, &true);
++ dis_setopt(dis_ctx, DIS_OPT_READ_ONLY, &flag);
+ break;
+ }
+ case 's':
+ {
+- dis_setopt(dis_ctx, DIS_OPT_DONT_CHECK_VOLUME_STATE, &true);
++ dis_setopt(dis_ctx, DIS_OPT_DONT_CHECK_VOLUME_STATE, &flag);
+ break;
+ }
+ case 'u':
+ {
+- dis_setopt(dis_ctx, DIS_OPT_USE_USER_PASSWORD, &true);
++ dis_setopt(dis_ctx, DIS_OPT_USE_USER_PASSWORD, &flag);
+ dis_setopt(dis_ctx, DIS_OPT_SET_USER_PASSWORD, optarg);
+ hide_opt(optarg);
+ break;
diff --git a/testing/dislocker/mbedtls-3.patch b/testing/dislocker/mbedtls-3.patch
new file mode 100644
index 00000000000..21175456ed7
--- /dev/null
+++ b/testing/dislocker/mbedtls-3.patch
@@ -0,0 +1,23 @@
+--- a/include/dislocker/ssl_bindings.h.in
++++ b/include/dislocker/ssl_bindings.h.in
+@@ -26,18 +26,14 @@
+ /*
+ * Here stand the bindings for polarssl SHA256/SHA2/SHA-2 function for dislocker
+ */
+-#include "@POLARSSL_INC_FOLDER@/config.h"
++#include "@POLARSSL_INC_FOLDER@/mbedtls_config.h"
+ #include "@POLARSSL_INC_FOLDER@/version.h"
+ #include "@POLARSSL_INC_FOLDER@/aes.h"
+
+ // Function's name changed
+ #if defined(MBEDTLS_SHA256_C)
+ # include "mbedtls/sha256.h"
+-# if MBEDTLS_VERSION_NUMBER >= 0x02070000
+-# define SHA256(input, len, output) mbedtls_sha256_ret(input, len, output, 0)
+-# else
+-# define SHA256(input, len, output) mbedtls_sha256(input, len, output, 0)
+-# endif /* POLARSSL_VERSION_NUMBER >= 0x02070000 */
++# define SHA256(input, len, output) mbedtls_sha256(input, len, output, 0)
+ #else /* defined(MBEDTLS_SHA256_C) */
+
+ # if defined(POLARSSL_SHA256_C)