42 Commits

Author SHA1 Message Date
a1346054 5232009fad trim excess whitespace 2021-09-12 20:34:12 +00:00
a1346054 0f2a885e42 fix spelling 2021-09-12 20:34:12 +00:00
Romain Coltel cc4b0407b2 Remove fallthrouh warnings for GCC 2020-11-06 12:01:55 +01:00
Aorimn 99e9e1f4b5 Use AES-XTS for decryption
While the previous commit includes an implementation of AES-XTS, it
didn't "link" it with dislocker. This commit is here to do just that.
2016-03-05 12:41:01 +01:00
Aorimn 5895934107 Add real AES-XTS implementation
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.
2016-03-05 12:37:49 +01:00
Aorimn deaa10a287 Double performance for AES-XTS
From benchmark in mbedTLS, this implementation is around twice as fast
as the previous one.
2016-02-02 23:06:04 +01:00
Aorimn 0f14ed5baa Change crc32 to our own implementation
Although we use the table from the previous implementation, this enables
us to use our own license.
2016-01-31 16:42:11 +01:00
Aorimn 2eb0c610e3 Add fallback for AES-XEX calling functions
This commit binds our own AES-XEX implementation in the curent code if
the one from mbedTLS is missing (as is currently the case).
2016-01-31 16:04:52 +01:00
Aorimn 994e2bfbd6 Add AES-XEX implementation within dislocker
This is done in case the function isn't available in the mbedTLS
library.
2016-01-31 16:04:52 +01:00
Aorimn 72a9280550 Add AES-XTS enc/decryption implementation
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.
2016-01-31 16:04:52 +01:00
Aorimn 0b0e49cd15 Adding support for AES-XTS algorithms
This extends supported algorithms to AES-XTS ones.
2016-01-31 16:04:52 +01:00
Aorimn 909f4b7592 Give the real size to decrypt the keys
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).
2015-11-25 23:20:06 +01:00
Aorimn 455653e55f Begin to prepare for AES-XTS encryption
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).
2015-11-19 00:07:38 +01:00
Aorimn fd0269333a Some print level changes
Some L_INFO have to be changed into L_DEBUG in order not to pollute the
INFO level.
2015-08-24 21:04:55 +02:00
Aorimn 4997b2d416 Merge branch 'cmake' into develop 2015-08-08 19:22:11 +02:00
Aorimn f3ef396489 Add header inclusion for some platforms
Some platforms seem to need string.h in the encommon.c unit file, so we
just add it.
2015-07-15 23:17:40 +02:00
Aorimn 221eb8ad1a Add cmake toolchain
We get rid of the former Makefile in favor of the cmake toolchain. This
was currently and successfuly tested on Linux (Fedora 21).
2015-06-28 12:38:02 +02:00
Aorimn fc4011a9c5 Change xwrappers into dis_wrappers
xmalloc, for instance, seems to be used by the ruby library as a wrapper
around malloc, which doesn't fit well with dislocker.
2015-04-25 15:53:02 +02:00
Aorimn 5393864182 Remove trailing whitespaces
Now that git issues warnings when trailing whitespaces are commited, the
commit-output is not really nice. So just remove trailing whitespaces on
the overall sources and be done with it.
2015-04-25 11:19:09 +02:00
Aorimn 5ffa3978d4 Modify dis_crypt_new's prototype
A check had more sense to be in the encryption unit than in the
dislocker one.
2015-04-20 22:17:16 +02:00
Aorimn b3754e80aa Move the crypt structure to a private header
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.
2015-03-14 17:05:07 +01:00
Aorimn efb52d280d Add missing file
Whoops, forgot to add the encommon.c file...
2015-03-07 12:23:26 +01:00
Aorimn 249fa2831e Remove metadata dependency in the decrypt.c unit
This seems to make no sense to put datums specific stuff into the
decrypt.c file.
2015-03-07 01:48:45 +01:00
Aorimn 0715a3693b Begin to create an encryption object
The decrypt.c unit file shouldn't know the io_data structure, it doesn't
really make sense for it to need it.
2015-03-07 00:41:01 +01:00
Aorimn b4f2b15a8f Rename contexts_t into dis_aes_contexts_t
contexts_t was confusing, the new name will hopefully make it clearer
about its purpose.
2015-03-04 23:57:52 +01:00
Aorimn a5d85f6264 Move includes into separate directory
This adds an include/ directory from which includes files will be. Each
header is now moved to this directory, in the same sub-directory it was
in.
Each #include has been changed accordingly in order not to break
compilation.
2015-03-04 23:35:25 +01:00
Aorimn a033c9130e Lot of renaming
Things were getting a little bit out of control in the various names of
structure's members, function names and in comments.
Now, metadata refer to the entire metadata of the BitLocker volume,
information is the header of these metadata.
2015-02-21 16:54:36 +01:00
Aorimn 0ce915b479 Merge pull request #23 from JM1/develop
Makefile changes & strict aliasing compliance

Thanks @JM1 !
2015-02-02 13:18:33 +01:00
Aorimn 33cadd20cc Move some structures and definitions into unit
Some private structures and #define were used in headers files, move
them into the unit.
2015-01-27 20:42:25 +01:00
JM 646dfea22b Make code strict aliasing compliant
While trying to harden the binaries according to [1] gcc aborted compilation
with error 'dereferencing type-punned pointer will break strict-aliasing rules'
at several code fragments. To make the code strict aliasing compliant several
casts like

  uint8_t iv[16] = {0,};
  *(off_t*)iv = sector_address;

have been changed to

  union {
    uint8_t multi[16];
    off_t single;
  } iv;
  memset(iv.multi, 0, 16);
  iv.single = sector_address;

following the advises from [2] and [3].

[1] https://wiki.debian.org/Hardening
[2] http://cellperformance.beyond3d.com/articles/2006/06/understanding-strict-aliasing.html
[3] http://stackoverflow.com/a/3246340
2015-01-27 10:33:26 +01:00
Aorimn 052d7ca8a0 Big changes
Remove disk_op_data global variable in the library
Extract file & fuse outputs in two standalone binaries
Provide global stub functions for dislocker library
Add FIXMEs & TODOs everywhere...
2014-08-15 22:01:31 +02:00
Aorimn c170923b78 Change data_t structure name into dis_iodata_t
data_t was too generic a name for a library.
2014-08-13 20:56:58 +02:00
Aorimn cd1b2afaa2 Clean build system
Build dislocker using only the main Makefile.
2014-08-08 13:52:38 +02:00
Aorimn 2f18853bcb Harden resulting binary
Add stack protectors, pie, fortify source and relro "now binding".
Fortify source needs optimization, so add it too.
2014-08-03 21:08:34 +02:00
Aorimn fb5406f455 Clean some things
There's more to do
2014-06-22 17:36:19 +02:00
Aorimn 5f65f56bf3 Makefile cleaning, thanks again @hugsy 2014-01-27 00:56:38 +01:00
Aorimn a99f7fbf86 Removing the kinda test-encryption binary 2014-01-27 00:45:53 +01:00
Aorimn 916aaa0907 Remove useless -L flags (break OSX Mavericks compilation anyway) 2014-01-03 20:32:22 +01:00
Aorimn 8bec2431a4 Removing embedded polarssl library
Compilation is now possible against polarssl 1.2 and 1.3
Thanks Robert Scheck
2013-12-29 14:13:33 +01:00
Romain Coltel 56d401934d User password decryption method added
Beginning of Windows 8 support (not complete yet)
Change license year
2013-03-21 12:40:29 +01:00
Romain Coltel 01a23644bd Moving from OpenSSL to an embedded PolarSSL
This will mute the deprecated OpenSSL's warnings on recent MacOSX and
make the code more independant of system-wide installed libraries
2013-01-31 10:45:06 +01:00
Romain Coltel b02ee88b7e First commit - Beginning version: 0.2.3 2012-12-10 19:24:03 +01:00