From 76aaa52c43f388169a244bb62b102a196d288e8a Mon Sep 17 00:00:00 2001 From: Aorimn Date: Sun, 20 Jul 2014 19:54:50 +0200 Subject: [PATCH] Support for decrypted volumes Wow! Such support! Many amaze decrypted! ... Seriously, when the volume is in the `decrypted' state, there's no key yet, but the metadata already are present so an NTFS reader can't mount the volume. --- src/dislocker.c | 7 +++++++ src/metadata/metadata.c | 5 +++++ 2 files changed, 12 insertions(+) diff --git a/src/dislocker.c b/src/dislocker.c index db68cc9..0038c6a 100644 --- a/src/dislocker.c +++ b/src/dislocker.c @@ -228,9 +228,16 @@ int main(int argc, char** argv) if(get_dataset(bl_metadata, &dataset) != TRUE) { xprintf(L_CRITICAL, "Unable to find a valid dataset. Abort.\n"); + ret = EXIT_FAILURE; goto FIRST_CLEAN; } + /* + * If the state of the volume is currently decrypted, there's no key to grab + */ + if(((bitlocker_header_t*)bl_metadata)->curr_state == DECRYPTED) + goto FIRST_CLEAN; + /* * First, get the VMK datum using either a clear key, a recovery password * or a bek file diff --git a/src/metadata/metadata.c b/src/metadata/metadata.c index d45836d..020313a 100644 --- a/src/metadata/metadata.c +++ b/src/metadata/metadata.c @@ -368,6 +368,11 @@ int check_state(bitlocker_header_t* metadata) next_state ); break; + case DECRYPTED: + xprintf(L_WARNING, + "The disk is about to get encrypted. Don't use " PROGNAME " if " + "you're willing to do so, this may corrupt your data." + ); } return TRUE;