Blob Blame History Raw
From d0aa966c014d8301371e693966dcac3d9e9c0ccd Mon Sep 17 00:00:00 2001
From: Vojtech Trefny <vtrefny@redhat.com>
Date: Mon, 10 Sep 2018 13:07:41 +0200
Subject: [PATCH] Add suppport for opening LUKS2 devices

---
 lib/volume_luks.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/lib/volume_luks.c b/lib/volume_luks.c
index f4bf2c8..d1c5d47 100644
--- a/lib/volume_luks.c
+++ b/lib/volume_luks.c
@@ -30,6 +30,10 @@ Author: Miloslav Trmač <mitr@redhat.com> */
 #include "volume.h"
 #include "volume_luks.h"
 
+#ifndef CRYPT_LUKS
+#define CRYPT_LUKS NULL
+#endif
+
 /* LUKS - specific code */
 
 /* Return an error message for ERR_NO, for g_free (). */
@@ -105,7 +109,7 @@ open_crypt_device (const char *path, char **last_log_entry, GError **error)
   if (r < 0)
     goto err;
   crypt_set_log_callback(cd, record_cryptsetup_log_entry, last_log_entry);
-  r = crypt_load (cd, CRYPT_LUKS1, NULL);
+  r = crypt_load (cd, CRYPT_LUKS, NULL);
   if (r < 0)
     goto err_cd;
   return cd;
-- 
2.17.1