Commit Graph

155 Commits

Author SHA1 Message Date
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 000484f882 Remove default values in parse_args 2014-08-14 21:38:22 +02:00
Aorimn 8932fa2caa Change printing configuration to L_DEBUG level 2014-08-14 21:26:14 +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 726784344f Put /usr in DESTDIR variable 2014-08-11 19:38:43 +02:00
Aorimn 24faa3f244 Play with travis
Let's play with travis again!
2014-08-09 13:52:23 +02:00
Aorimn e925d644f7 Whoopsy, hugsy was kinda right no?
Yes.
2014-08-09 13:39:48 +02:00
Aorimn 4b1dbce1c6 Tyr to fix travis build 2014-08-09 13:35:07 +02:00
Aorimn df963869ab Test travis multi-OS builds 2014-08-09 13:28:46 +02:00
Aorimn 7469a5dcaa Improve a comment
Wow, such commit, very change.
2014-08-09 13:17:08 +02:00
Aorimn 816934a0e7 Improve an error case of dislocker-metadata 2014-08-09 04:00:53 +02:00
Aorimn 0f6c6f6343 Change to way VMK are gathered
Accesses get the VMK, so put the code to get the VMK in these units. The
metadata/vmk unit still has some helper functions though.
2014-08-09 03:58:17 +02:00
Aorimn 088577c05e Update doc according to the compil changes
This doc update covers the first part of the change for the new way
dislocker is being compiled.
2014-08-09 03:52:35 +02:00
Aorimn e5d4cb8905 Wtf?
This is a fairly standard commit, with a standard commit message.
2014-08-09 03:45:12 +02:00
Aorimn ed8155e15e Fix travis build
Not sure this is the way to go though.
2014-08-09 03:38:36 +02:00
Aorimn b4c71616bc Fix broken build
make install requires root, adding sudo before should fix travis build.
2014-08-09 03:17:48 +02:00
Aorimn ae0790ed80 Improve travis config file readability 2014-08-09 03:12:56 +02:00
Aorimn e6c6fed48e Change travis spec file
Put the after_script into the script part.
2014-08-08 18:54:07 +02:00
Aorimn 35d4aef787 Fix travis build
Use $CC env variable provided by travis.
Place libraries in the right order.
2014-08-08 18:26:27 +02:00
Aorimn 16e523b665 Make dislocker a library
This helps to build standalone binaries, which where often broken.
2014-08-08 17:48:24 +02:00
Aorimn 2e214049e7 Add debug for EOW volumes
Get the EOW Information, print them and check they pass some tests. This
doesn't enable in any sort reading or writing onto EOW volumes.
2014-08-08 14:10:51 +02:00
Aorimn cd1b2afaa2 Clean build system
Build dislocker using only the main Makefile.
2014-08-08 13:52:38 +02:00
Aorimn 25d90e388f Darwin isn't responsible, clang is.
On some clang versions, it errors with "argument unused during
compilation: 'blablah'". Just ignore this error.
2014-08-08 13:24:12 +02:00
Aorimn 73065c44f5 Try to make travis happy (& fix potential UB)
We need to check that 0 < in < FD_SETSIZE, otherwise this won't work as
expected.
2014-08-08 13:01:31 +02:00
Aorimn 2540292f81 Try to make travis work (1) 2014-08-08 12:19:27 +02:00
Aorimn f97325ce61 Add travis file with basic compilation & test 2014-08-08 11:31:56 +02:00
Aorimn ab4abb2716 Seems ld doesn't play well with -z option on OSX
This should fix issue #11 (partially, at least). Error is:
    [...]
    cc -Wall -Werror -Wextra -Qunused-arguments -DPROGNAME=\"dislocker\"
    -DVERSION=\"0.3.1\" -D_FILE_OFFSET_BITS=64 -DAUTHOR="\"Romain
    Coltel\"" -D__OS=\"Darwin\" -D__ARCH=\"x86_64\" -D__ARCH_X86_64
    -D__DARWIN -I. -I/usr/local/include -fstack-protector -fPIC
    -D_FORTIFY_SOURCE=2 -O1 -D__RUN_FUSE -DFUSE_USE_VERSION=26 -o
    dislocker dislocker.o common.o sectors.o config.o xstd/xstdio.o
    xstd/xstdlib.o outputs/prepare.o outputs/fuse/fuse.o
    metadata/datums.o metadata/metadata.o metadata/print_metadata.o
    metadata/vmk.o metadata/fvek.o metadata/extended_info.o
    metadata/guid.o accesses/rp/recovery_password.o
    accesses/bek/read_bekfile.o accesses/user_pass/user_pass.o
    accesses/stretch_key.o encryption/decrypt.o encryption/encrypt.o
    encryption/diffuser.o encryption/crc32.o ntfs/clock.o
    ntfs/encoding.o  -pie -fPIE -Wl,-z,relro -Wl,-z,now -lpthread
    -lpolarssl -losxfuse_i64
    ld: unknown option: -z
The commit removes -Wl,-z,* from command under Darwin.
2014-08-07 23:56:57 +02:00
Aorimn 24aa3904c4 Try to make it compile on OSX Mavericks 10.9.4
-pie doesn't seem to be recognized by clang on Mavericks, try to make
clang ignores it.
2014-08-07 23:21:44 +02:00
Aorimn 3fd3f45d96 Fix issue #12
Sizeof(char*) != sizeof(char). This should suffice to understand the
commit.
2014-08-07 20:48:08 +02:00
Aorimn 486caedbb3 Add checks around getting the EOW Information
New function has been added for that job. This function uses some checks
found done by the W$ driver (not all of them).
2014-08-07 00:24:56 +02:00
Aorimn 2f03841314 Bugfix: memory leak when the 1st metadata wasn't good
Well, that wasn't not a big deal of a leak.
2014-08-06 21:47:51 +02:00
Aorimn b3dc70a1e0 Add more argument check 2014-08-06 21:09:14 +02:00
Aorimn 5c09e22a1c Add function to read EOW information structure on disk
This is needed for further development.
2014-08-06 20:37:51 +02:00
Aorimn a436af81e0 Bugfix: Remove stack leak & add check for NULL variable
A printf(3) with 2 %d in the format part didn't have any further
parameters.
A parameter pointer wasn't check for NULL.
2014-08-06 20:17:40 +02:00
Aorimn 0d06aeb1dd Add eow information structure
This structure is used when eow mode is activated, i.e. : when
EOW_INFORMATION_OFFSET_GUID is the volume's GUID.
The content of this structure's payload is still unknown, but there is a
payload.
2014-08-04 23:47:14 +02:00
Aorimn 605baa893e Add more debug print 2014-08-04 21:07:07 +02:00
Aorimn fc4132c66d Change unsupported check
We now authorize Windows 8 writes, partially. When in EOW (encrypt on
write?) mode, there's more metadata to check (EOW_INFORMATION they name
it, maybe some kind of "eow bitmap" too).
2014-08-04 20:31:43 +02:00
Aorimn efce430344 Better check of child errors in user_pass
ck_* don't play well when invoked into a child process during a test
preparation.
The child now returns the errno status and the father wait(2)s for the
child to terminate, then check the child status.
2014-08-04 17:07:30 +02:00
Aorimn 0a44e7952d Continue tests development for user_pass 2014-08-04 13:21:11 +02:00
Aorimn 09833e0054 Remove useless condition 2014-08-04 11:41:40 +02:00
Aorimn a51afa7019 Add fields into the volume header
These fields are used when encrypting only used data and design offsets
to the both FVE_EOW_INFORMATION structures on the disk.
2014-08-03 21:56:11 +02:00
Aorimn 728f2f502b Continue moving guid
This fix compilation issue from previous commit.
2014-08-03 21:30:00 +02:00
Aorimn 7302e0d77a Move ntfs/guid.[ch] to metadata/guid.[ch]
GUIDs aren't only NTFS, future changes needs this for consistency.
2014-08-03 21:19:45 +02:00
Aorimn a97cc9a5e5 Fix small free problems. 2014-08-03 21:15:48 +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 cbf98fedcb Add missing \n 2014-08-03 16:36:49 +02:00
Aorimn 137d73f8d5 Add comment and cosmetic
Missing comment on the metadata files' size atop the NTFS layer.
2014-07-21 22:39:13 +02:00
Aorimn d68cf7c7f7 Use read_decrypt_sectors() instead of read()
The problem with read() appears when the NTFS boot sector is encrypted.
Delegate this problem to read_decrypt_sectors() as it's already
implemented in it.
2014-07-20 20:02:57 +02:00
Aorimn 76aaa52c43 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.
2014-07-20 19:54:50 +02:00
Aorimn d476d68f46 Remove a case taht never happen
Computing the volume's size is always done by looking at the volume's
header for W$ Vista volumes. It's never computed from the metadata
header.
2014-07-20 18:36:02 +02:00