shared/dissect-image: adapt to LUKS2 format
authorOndrej Kozina <okozina@redhat.com>
Fri, 13 Oct 2017 13:27:30 +0000 (15:27 +0200)
committerOndrej Kozina <okozina@redhat.com>
Fri, 13 Oct 2017 13:30:05 +0000 (15:30 +0200)
Load any LUKS format available (and recognized) by libcryptsetup

src/shared/dissect-image.c

index 4b59f2c..258e8ca 100644 (file)
@@ -19,6 +19,9 @@
 
 #if HAVE_LIBCRYPTSETUP
 #include <libcryptsetup.h>
+#ifndef CRYPT_LUKS
+#define CRYPT_LUKS NULL
+#endif
 #endif
 #include <sys/mount.h>
 
@@ -843,7 +846,7 @@ static int decrypt_partition(
         if (r < 0)
                 return log_debug_errno(r, "Failed to initialize dm-crypt: %m");
 
-        r = crypt_load(cd, CRYPT_LUKS1, NULL);
+        r = crypt_load(cd, CRYPT_LUKS, NULL);
         if (r < 0) {
                 log_debug_errno(r, "Failed to load LUKS metadata: %m");
                 goto fail;