[Libguestfs] [PATCH common 4/4] options: Support Windows BitLocker (RHBZ#1808977).

Richard W.M. Jones rjones at redhat.com
Mon Mar 30 14:58:49 UTC 2020


---
 mltools/tools_utils.mli | 5 ++---
 options/decrypt.c       | 9 ++++-----
 2 files changed, 6 insertions(+), 8 deletions(-)

diff --git a/mltools/tools_utils.mli b/mltools/tools_utils.mli
index ab70f58..9912a50 100644
--- a/mltools/tools_utils.mli
+++ b/mltools/tools_utils.mli
@@ -195,9 +195,8 @@ val is_btrfs_subvolume : Guestfs.guestfs -> string -> bool
 (** Checks if a filesystem is a btrfs subvolume. *)
 
 val inspect_decrypt : Guestfs.guestfs -> key_store -> unit
-(** Simple implementation of decryption: look for any [crypto_LUKS]
-    partitions and decrypt them, then rescan for VGs.  This only works
-    for Fedora whole-disk encryption. *)
+(** Simple implementation of decryption: look for any encrypted
+    partitions and decrypt them, then rescan for VGs. *)
 
 val with_timeout : string -> int -> ?sleep:int -> (unit -> 'a option) -> 'a
 (** [with_timeout op timeout ?sleep fn] implements a timeout loop.
diff --git a/options/decrypt.c b/options/decrypt.c
index 069a83f..eac21d3 100644
--- a/options/decrypt.c
+++ b/options/decrypt.c
@@ -62,10 +62,8 @@ make_mapname (const char *device)
 }
 
 /**
- * Simple implementation of decryption: look for any C<crypto_LUKS>
- * partitions and decrypt them, then rescan for VGs.  This only works
- * for Fedora whole-disk encryption.  WIP to make this work for other
- * encryption schemes.
+ * Simple implementation of decryption: look for any encrypted
+ * partitions and decrypt them, then rescan for VGs.
  */
 void
 inspect_do_decrypt (guestfs_h *g, struct key_store *ks)
@@ -79,7 +77,8 @@ inspect_do_decrypt (guestfs_h *g, struct key_store *ks)
 
   for (i = 0; partitions[i] != NULL; ++i) {
     CLEANUP_FREE char *type = guestfs_vfs_type (g, partitions[i]);
-    if (type && STREQ (type, "crypto_LUKS")) {
+    if (type &&
+        (STREQ (type, "crypto_LUKS") || STREQ (type, "BitLocker"))) {
       CLEANUP_FREE char *mapname = make_mapname (partitions[i]);
 
 #ifdef GUESTFS_HAVE_LUKS_UUID
-- 
2.25.0




More information about the Libguestfs mailing list