Commit Graph

642 Commits

Author SHA1 Message Date
Milan Broz
3e037b7422 Move duplicated failed message to verbose level, add some debug messages, fix resize call.
git-svn-id: https://cryptsetup.googlecode.com/svn/trunk@126 36d66b0a-2a48-0410-832c-cd162a569da5
2009-10-01 14:11:55 +00:00
Milan Broz
de95a38381 Move dm backend initialisation to library calls.
git-svn-id: https://cryptsetup.googlecode.com/svn/trunk@125 36d66b0a-2a48-0410-832c-cd162a569da5
2009-10-01 10:14:32 +00:00
Milan Broz
8bec41ab34 Properly apply versioned symbols in library and fix problems uncovered
by doing that:-)

git-svn-id: https://cryptsetup.googlecode.com/svn/trunk@124 36d66b0a-2a48-0410-832c-cd162a569da5
2009-09-30 15:07:41 +00:00
Milan Broz
e026f089be Add luksHeaderBackup and luksHeaderRestore commands and API cals.
git-svn-id: https://cryptsetup.googlecode.com/svn/trunk@114 36d66b0a-2a48-0410-832c-cd162a569da5
2009-09-28 17:45:38 +00:00
Milan Broz
935e83ebfa Initialize crypto library before LUKS header load.
git-svn-id: https://cryptsetup.googlecode.com/svn/trunk@111 36d66b0a-2a48-0410-832c-cd162a569da5
2009-09-15 15:10:23 +00:00
Milan Broz
1cc33f943e patch 1.patch
git-svn-id: https://cryptsetup.googlecode.com/svn/trunk@109 36d66b0a-2a48-0410-832c-cd162a569da5
2009-09-10 12:41:18 +00:00
Milan Broz
dfadce6d80 Try to read first sector from device to properly check that device is ready.
git-svn-id: https://cryptsetup.googlecode.com/svn/trunk@106 36d66b0a-2a48-0410-832c-cd162a569da5
2009-09-08 10:29:50 +00:00
Milan Broz
a47856ac49 Use dm-uuid for all crypt devices, contains device type and name now.
DM_UUID now contains prefix (CRYPT-), device type (LUKS1, PLAIN, TEMP),
UUID (if provided - LUKS) and device name.

Because e.g. snapshot of full LUKS device during activation must have different
name, DM-UUID is different too and we do not need --disable-uuid option.

DM-UUID is persistent during activation time.

* Revert (and solve different way): Replace not safe option --non-exclusive with --disable-uuid.

Signed-off-by: Milan Broz <mbroz@redhat.com>

git-svn-id: https://cryptsetup.googlecode.com/svn/trunk@105 36d66b0a-2a48-0410-832c-cd162a569da5
2009-09-08 06:41:44 +00:00
Milan Broz
3cea5dcc7b * Add luksSuspend (freeze device and wipe key) and luksResume (with provided passphrase).
Signed-off-by: Milan Broz <mbroz@redhat.com>

git-svn-id: https://cryptsetup.googlecode.com/svn/trunk@104 36d66b0a-2a48-0410-832c-cd162a569da5
2009-09-02 12:47:21 +00:00
Milan Broz
bcd94f6ad4 Add LUKS open and format test using new api.
Fix some error messages.

git-svn-id: https://cryptsetup.googlecode.com/svn/trunk@102 36d66b0a-2a48-0410-832c-cd162a569da5
2009-08-31 17:03:22 +00:00
Milan Broz
3deabc8e56 * Remove old API code helper functions.
Signed-off-by: Milan Broz <mbroz@redhat.com>

git-svn-id: https://cryptsetup.googlecode.com/svn/trunk@98 36d66b0a-2a48-0410-832c-cd162a569da5
2009-08-30 18:10:11 +00:00
Milan Broz
7bc5829c43 * Implement old API calls using new functions.
Signed-off-by: Milan Broz <mbroz@redhat.com>

git-svn-id: https://cryptsetup.googlecode.com/svn/trunk@97 36d66b0a-2a48-0410-832c-cd162a569da5
2009-08-30 18:10:02 +00:00
Milan Broz
d70782478e * Add new libcryptsetup API (documented in libcryptsetup.h).
Signed-off-by: Milan Broz <mbroz@redhat.com>

git-svn-id: https://cryptsetup.googlecode.com/svn/trunk@96 36d66b0a-2a48-0410-832c-cd162a569da5
2009-08-30 18:09:53 +00:00
Milan Broz
344a162a29 * Replace global options struct with separate parameters in helper functions.
Signed-off-by: Milan Broz <mbroz@redhat.com>

git-svn-id: https://cryptsetup.googlecode.com/svn/trunk@95 36d66b0a-2a48-0410-832c-cd162a569da5
2009-08-30 18:09:43 +00:00
Milan Broz
74b26c7b8a * Run performance check for PBKDF2 from LUKS code, do not mix hash algoritms results.
* Add ability to provide pre-generated master key and UUID in LUKS header format.
* Add LUKS function to verify master key digest.
* Move key slot manuipulation function into LUKS specific code.

Signed-off-by: Milan Broz <mbroz@redhat.com>

git-svn-id: https://cryptsetup.googlecode.com/svn/trunk@94 36d66b0a-2a48-0410-832c-cd162a569da5
2009-08-30 18:09:34 +00:00
Milan Broz
cee0f0b49f * Move device utils code and provide context parameter (for log).
* Keyfile now must be provided by path, only stdin file descriptor is used (api only).
* Do not call isatty() on closed keyfile descriptor.

Signed-off-by: Milan Broz <mbroz@redhat.com>

git-svn-id: https://cryptsetup.googlecode.com/svn/trunk@93 36d66b0a-2a48-0410-832c-cd162a569da5
2009-08-30 18:09:21 +00:00
Milan Broz
bf7819ccef * Add log macros and make logging modre consitent.
* Move command successful messages to verbose level.
* Introduce --debug parameter.

Signed-off-by: Milan Broz <mbroz@redhat.com>

git-svn-id: https://cryptsetup.googlecode.com/svn/trunk@92 36d66b0a-2a48-0410-832c-cd162a569da5
2009-08-30 18:07:17 +00:00
Milan Broz
4e471a9b03 * Move memory locking and dm initialization to command layer.
* Increase priority of process if memory is locked.

Signed-off-by: Milan Broz <mbroz@redhat.com>

git-svn-id: https://cryptsetup.googlecode.com/svn/trunk@91 36d66b0a-2a48-0410-832c-cd162a569da5
2009-08-30 18:07:00 +00:00
Milan Broz
ab953b3ff6 Require device device-mapper to build and do not use backend wrapper for dm calls.
Signed-off-by: Milan Broz <mbroz@redhat.com>

git-svn-id: https://cryptsetup.googlecode.com/svn/trunk@90 36d66b0a-2a48-0410-832c-cd162a569da5
2009-08-30 17:56:33 +00:00
Milan Broz
d980dbb300 Allow restrict keys size in LuksOpen (thanks to Stefan Assmann)
git-svn-id: https://cryptsetup.googlecode.com/svn/trunk@86 36d66b0a-2a48-0410-832c-cd162a569da5
2009-08-17 11:04:36 +00:00
Milan Broz
02707608db Allow using passphrase provided in options struct for LuksOpen (thanks to Waldemar Brodkorb).
git-svn-id: https://cryptsetup.googlecode.com/svn/trunk@85 36d66b0a-2a48-0410-832c-cd162a569da5
2009-08-17 11:03:29 +00:00
Milan Broz
ed9e146cb6 Add required parameters for changing hash used in LUKS key setup scheme.
git-svn-id: https://cryptsetup.googlecode.com/svn/trunk@80 36d66b0a-2a48-0410-832c-cd162a569da5
2009-07-30 14:57:52 +00:00
Milan Broz
f60475e293 Fix DEBUG output (thanks to Ivan Stankovic)
git-svn-id: https://cryptsetup.googlecode.com/svn/trunk@75 36d66b0a-2a48-0410-832c-cd162a569da5
2009-07-30 14:46:20 +00:00
Milan Broz
a3c8571df0 Fix segfault if provided slot in luksKillslot is invalid.
git-svn-id: https://cryptsetup.googlecode.com/svn/trunk@73 36d66b0a-2a48-0410-832c-cd162a569da5
2009-07-23 11:04:46 +00:00
Milan Broz
fc2cfe7a32 Allow removal of last slot in luksRemoveKey and luksKillSlot.
git-svn-id: https://cryptsetup.googlecode.com/svn/trunk@65 36d66b0a-2a48-0410-832c-cd162a569da5
2009-07-16 12:59:00 +00:00
Milan Broz
78cd6786fb Add some checks for error codes.
(fixes warning: ignoring return value ...)



git-svn-id: https://cryptsetup.googlecode.com/svn/trunk@59 36d66b0a-2a48-0410-832c-cd162a569da5
2009-06-22 12:40:31 +00:00
Milan Broz
3691b36caa Fix device prompt quistion.
(fixes missing patch chunk in previous commit)



git-svn-id: https://cryptsetup.googlecode.com/svn/trunk@58 36d66b0a-2a48-0410-832c-cd162a569da5
2009-06-22 12:38:08 +00:00
Milan Broz
dca5a38513 Set UUID in device-mapper for LUKS devices.
Device mapper device should use UUID string if possible.
UDEV can then easily distinguish the device type etc.

cryptsetup now uses CRYPT prefix for uuid.



git-svn-id: https://cryptsetup.googlecode.com/svn/trunk@55 36d66b0a-2a48-0410-832c-cd162a569da5
2009-06-20 20:24:56 +00:00
Milan Broz
8ce294ae3e Display device name when asking for password.
git-svn-id: https://cryptsetup.googlecode.com/svn/trunk@53 36d66b0a-2a48-0410-832c-cd162a569da5
2009-06-20 20:20:41 +00:00
Milan Broz
91f1e7b59a Use better error messages if device doesn't exist
or is already used by other mapping.



git-svn-id: https://cryptsetup.googlecode.com/svn/trunk@51 36d66b0a-2a48-0410-832c-cd162a569da5
2009-06-19 17:03:22 +00:00
Clemens Fruhwirth
04fd9b3208 Should fix Issue 5.
git-svn-id: https://cryptsetup.googlecode.com/svn/trunk@49 36d66b0a-2a48-0410-832c-cd162a569da5
2009-04-05 17:21:03 +00:00
Clemens Fruhwirth
c2813c5d7e Remove precompiled pot files.
Fix uninitialized return value variable in setup.c.



git-svn-id: https://cryptsetup.googlecode.com/svn/trunk@47 36d66b0a-2a48-0410-832c-cd162a569da5
2009-01-16 17:06:31 +00:00
Clemens Fruhwirth
12974a1dd3 * Fix wrong output for remaining key at key deletion.
* Allow deletion of key slot while other keys have the same key
  information (that implied rewritting verification logic).



git-svn-id: https://cryptsetup.googlecode.com/svn/trunk@41 36d66b0a-2a48-0410-832c-cd162a569da5
2008-12-19 19:39:42 +00:00
Milan Broz
29640eec72 Wipe start of device before LUKS-formatting.
Cryptsetup keeps some sectors (between the physical LUKS header
and keyslot data) on disk untouched, unfortunatelly ext2/3/4 signature can
be there and blkid detects filesystem here instead of LUKS.

This patch wipes the first eight sectors on disk with zero during luksFormat.
This should be probably solved by physical header padding in next version.



git-svn-id: https://cryptsetup.googlecode.com/svn/trunk@38 36d66b0a-2a48-0410-832c-cd162a569da5
2008-11-05 11:23:24 +00:00
Milan Broz
67147322b3 Return preset error description in case of IO or header format error.
(All password related errors still return -EPERM - "No key available with this passphrase.")



git-svn-id: https://cryptsetup.googlecode.com/svn/trunk@33 36d66b0a-2a48-0410-832c-cd162a569da5
2008-09-22 12:07:31 +00:00
Milan Broz
c0aeac6a34 Use remapping to error target instead of calling udevsettle for temporary crypt device.
git-svn-id: https://cryptsetup.googlecode.com/svn/trunk@32 36d66b0a-2a48-0410-832c-cd162a569da5
2008-09-16 15:35:50 +00:00
Clemens Fruhwirth
0ac25b6c83 Check device mapper communication and warn user in case the communication fails. Thanks to Milan Broz.
git-svn-id: https://cryptsetup.googlecode.com/svn/trunk@31 36d66b0a-2a48-0410-832c-cd162a569da5
2008-09-11 09:10:55 +00:00
Clemens Fruhwirth
98cf0aedf8 Thanks to Ivan Stankovic
* write_lseek_blockwise: declare innerCount outside the if block
* add -Wall to the default CFLAGS
* fix some signedness issues



git-svn-id: https://cryptsetup.googlecode.com/svn/trunk@29 36d66b0a-2a48-0410-832c-cd162a569da5
2008-09-01 08:54:05 +00:00
Clemens Fruhwirth
4884064723 Error handling improvement thanks to Erik Edin.
git-svn-id: https://cryptsetup.googlecode.com/svn/trunk@28 36d66b0a-2a48-0410-832c-cd162a569da5
2008-08-20 10:40:45 +00:00
Clemens Fruhwirth
7fbbc21a07 Add non-exclusive override via --non-exclusive.
git-svn-id: https://cryptsetup.googlecode.com/svn/trunk@25 36d66b0a-2a48-0410-832c-cd162a569da5
2008-06-30 12:20:24 +00:00
Clemens Fruhwirth
f7803083d0 Refactor key slot selection into keyslot_from_option. Either autoselect next
free keyslot or honor user choice (after checking).



git-svn-id: https://cryptsetup.googlecode.com/svn/trunk@24 36d66b0a-2a48-0410-832c-cd162a569da5
2008-06-28 17:45:55 +00:00
Clemens Fruhwirth
7dc7b90a9b Initial checking of what was revision 56 on http://luks.endorphin.org/svn/cryptsetup
git-svn-id: https://cryptsetup.googlecode.com/svn/trunk@3 36d66b0a-2a48-0410-832c-cd162a569da5
2008-03-22 08:23:35 +00:00