[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[libvirt PATCH v2 2/4] util: detect LUKS encryption scheme in qcow2 files



Crypt method number 2 indicates LUKS format.

Signed-off-by: Daniel P. Berrangé <berrange redhat com>
---
 src/util/virstoragefile.c | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/src/util/virstoragefile.c b/src/util/virstoragefile.c
index 97a346db28..42341150e5 100644
--- a/src/util/virstoragefile.c
+++ b/src/util/virstoragefile.c
@@ -290,6 +290,22 @@ static struct FileEncryptionInfo const qcow2EncryptionInfo[] = {
 
         .payloadOffset = -1,
     },
+    {
+        .format = VIR_STORAGE_ENCRYPTION_FORMAT_LUKS,
+
+        .magicOffset = 0,
+        .magic = NULL,
+        .endian = LV_BIG_ENDIAN,
+
+        .versionOffset  = -1,
+        .versionSize = 0,
+        .versionNumbers = {},
+
+        .modeOffset = QCOW2_HDR_CRYPT,
+        .modeValue = 2,
+
+        .payloadOffset = -1,
+    },
     { 0 }
 };
 
-- 
2.26.2


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]