The previous implementation was only an AES-XEX one, without support for
not-divisible-by-16 sectors. We now support this through a real - if not
entirely complete in the test vectors point of vue - implementation.
Note that we don't support sectors not aligned on the byte limit, as
should be the case in a real AES-XTS implementation. But so far, I
didn't see it implemented anywhere, so I think we're good.
This adds functions which call the mbedtls_aes_crypt_xex function. This
function isn't available yet in mbedTLS, so this is of no use for common
users.
The bright side is, when it's available, it will be supported in
dislocker. A future commit will test for the maybe-existing function and
use our own implementation if it's not existing.
When decrypting keys (VMK or FVEK mainly), we gave 256 as of the key
size. This worked until now but I suspect that was mainly by the chance
that the current keys always are 256 bits long.
With the XTS mode, it seems the keys sizes have to be doubled, so that
would also prepare for the AES-XTS-256 mode, where keys could be 512
(I'm not sure yet).
Looking at Windows 10 (v1511) encrypted partitions with AES-XTS, both
128 and 256, shows that the new cipher numbers are 0x8004 and 0x8005
respectively.
AES-XTS is the new encryption scheme available on Windows 10 (from the
1511 version).
Moreover, this commit remove a branching case which often happens, which
should give beter performances (not tested though).
In a datum, the entry and datum_type fields are now respectively called
entry_type and value_type. So every field using the former names have
been changed and consistency has (tried to) be preserved.
The `-Wno-unknown-attributes' clang warning option wasn't supported for
all platforms so we now get through the #pragma directive of the
preprocessor to tell clang not to consider `-Wunknown-attributes' for
the Ruby headers.
As this doesn't seem to be known for all versions of clang (at least for
version 3.0-6ubuntu3 from Ubuntu 12.04), we also add a pragma for clang
not to consider `-Wunknown-pragmas'.
One can now use libdislocker to read metadata and get access to keys.
One cannot yet fully decrypt the drive.
Next commit will present some samples of the use of the API.
The previously unknown_size field in the information structure seemed to
indicate the size of a "convertlog", during conversion of the volume. We
thus renamed this field for "convert_size".
The mbedtls headers seem to change every name by prepending mbedtls_ to
functions names, MBEDTLS_ to #define-d, and so on. We thus put #define
to change the names.
Every #define-d variable in PolarSSL has been renamed with
s/POLARSSL/MBEDTLS/, so we now export POLARSSL_REAL_NAME out of the
FindPolarSSL.cmake file so that dislocker may use the correct name when
looking at the POLARSSL/MBEDTLS_VERSION_STRING or others.
Homebrew seems to have changed the polarssl/ folder into mbedtls/, so we
adapt the cmake/FindPolarSSL.cmake file to reflect this change. This
file now exports POLARSSL_INC_FOLDER, which take "polarssl" or "mbedtls"
for value according to the folder name in use on the system.
This is then used to include the correct files in dislocker.
This function used to exit(3), which is NOT good for libraries. So we
remove it and let the binaries which link with our library decide how to
deal with errors.
It seems like the state 0 is when BitLocker is getting killed, so we
call it a null state - not sure if that applies well. The state 3 is
related to the EOW mode and seems to be used when BitLocker is activated
in this mode.
This commit enables firsts ruby bindings of the library. As
dislocker-find is a ruby script, it has been used as a test subject for
these firsts bindings by relying on the library for getting guids to
look for in partition's header.
As FUSE is using threads, we protected lseek/read and lseek/write
sequances by mutexes. However, we can simplify it by using the pread and
pwrite functions, thus getting rid of the mutexes.
DIS_RET_ERROR_METADATA_FILE_OVERWRITE can be returned when given
(offset, size) pair is overwriting the NTFS-file where BitLocker
metadata are written.
The programm isn't really exiting, it's just really returning, ending
the dis_initialize call early. So we modify the log message to reflect
this.
Moreover, we change the return value in order to distinguish an error
status, a normal-success status and an early-success status.
This structure shouldn't be messed with, so we put it in a private
header - dislocker.priv.h. This is the occasion to put the config
structure in a private header too. Although there's no incomplete type
for the config structure in the public header so developers would use
the dislocker context structure only.
The crypt structure, representing an encryption object is now private.
We use the .priv.h convention for a private header. This private header
is thus named encommon.priv.h and can be used only by the encryption/
directory units.
initialization now reports its failure status in a better way, leading
to applications being able to do something appropriate -which none does
for the moment.