Commit Graph

665 Commits

Author SHA1 Message Date
Milan Broz
1f9efdf59a Check UUID of active device to match header when initializing context.
git-svn-id: https://cryptsetup.googlecode.com/svn/trunk@597 36d66b0a-2a48-0410-832c-cd162a569da5
2011-08-15 16:32:44 +00:00
Milan Broz
1f776bc979 Do not allow crypt_load() on already initialised context.
Signed-off-by: Ondrej Kozina <okozina@redhat.com>

git-svn-id: https://cryptsetup.googlecode.com/svn/trunk@596 36d66b0a-2a48-0410-832c-cd162a569da5
2011-08-15 16:32:36 +00:00
Milan Broz
f80b506b65 * Allow different data offset setting for detached header.
git-svn-id: https://cryptsetup.googlecode.com/svn/trunk@576 36d66b0a-2a48-0410-832c-cd162a569da5
2011-07-20 17:39:38 +00:00
Milan Broz
f7f9e291f4 * Add --header option for detached metadata (on-disk LUKS header) device.
* Add crypt_init_by_name_and_header() and crypt_set_data_device() to API.

git-svn-id: https://cryptsetup.googlecode.com/svn/trunk@575 36d66b0a-2a48-0410-832c-cd162a569da5
2011-07-20 17:39:26 +00:00
Milan Broz
1bf26b9a90 * Revert default initialisation of volume key in crypt_init_by_name().
* Do not allow key retrieval while suspended (key could be wiped).
* Do not allow suspend for non-LUKS devices.
* Support retries and timeout parameters for luksSuspend.

Add luksSuspend/Resume test.

git-svn-id: https://cryptsetup.googlecode.com/svn/trunk@574 36d66b0a-2a48-0410-832c-cd162a569da5
2011-07-19 13:55:34 +00:00
Milan Broz
261d0d05a5 Add crypt_get_iv_offset() function to API.
git-svn-id: https://cryptsetup.googlecode.com/svn/trunk@573 36d66b0a-2a48-0410-832c-cd162a569da5
2011-07-18 13:03:15 +00:00
Milan Broz
39e6cfcb8a Use struct volume key thorough.
git-svn-id: https://cryptsetup.googlecode.com/svn/trunk@571 36d66b0a-2a48-0410-832c-cd162a569da5
2011-07-17 22:35:30 +00:00
Milan Broz
913ef7c07e Rewrite dm query/create function backend.
git-svn-id: https://cryptsetup.googlecode.com/svn/trunk@570 36d66b0a-2a48-0410-832c-cd162a569da5
2011-07-17 22:35:17 +00:00
Milan Broz
a1306ed01c Remove old API functions (all functions using crypt_options).
git-svn-id: https://cryptsetup.googlecode.com/svn/trunk@561 36d66b0a-2a48-0410-832c-cd162a569da5
2011-07-07 14:32:42 +00:00
Milan Broz
d44d07c9eb * Add --shared option for creating non-overlapping crypt segments.
* Add shared flag to libcryptsetup api.
* Fix plain crypt format parameters to include size option (API change).

git-svn-id: https://cryptsetup.googlecode.com/svn/trunk@559 36d66b0a-2a48-0410-832c-cd162a569da5
2011-07-01 16:38:58 +00:00
Milan Broz
9e9bf5ca56 Fix previous fix - keep API logic clean, fix cryptsetup call.
Add more API regression tests.

git-svn-id: https://cryptsetup.googlecode.com/svn/trunk@525 36d66b0a-2a48-0410-832c-cd162a569da5
2011-05-18 15:05:46 +00:00
Milan Broz
b53b577b19 Fix keyfile=- processing in create command (1.3.0, issue 104)
git-svn-id: https://cryptsetup.googlecode.com/svn/trunk@524 36d66b0a-2a48-0410-832c-cd162a569da5
2011-05-17 15:34:40 +00:00
Milan Broz
a1ad5894ca Pluralize "Cannot not read %d bytes from key file %s.\n" message. (ppisar)
git-svn-id: https://cryptsetup.googlecode.com/svn/trunk@521 36d66b0a-2a48-0410-832c-cd162a569da5
2011-05-11 10:27:33 +00:00
Milan Broz
afd526a8c4 Fix size argument for create command. (regression in 1.2.0)
git-svn-id: https://cryptsetup.googlecode.com/svn/trunk@518 36d66b0a-2a48-0410-832c-cd162a569da5
2011-05-03 13:13:16 +00:00
Milan Broz
9ca1ac5a39 Remove another compile warnings.
git-svn-id: https://cryptsetup.googlecode.com/svn/trunk@515 36d66b0a-2a48-0410-832c-cd162a569da5
2011-04-18 14:03:59 +00:00
Milan Broz
5d2205a2f8 Fix verbose mode compiler warnings.
git-svn-id: https://cryptsetup.googlecode.com/svn/trunk@510 36d66b0a-2a48-0410-832c-cd162a569da5
2011-04-18 10:52:02 +00:00
Milan Broz
e95ed30c66 Also support --hash option for loopaesOpen.
git-svn-id: https://cryptsetup.googlecode.com/svn/trunk@489 36d66b0a-2a48-0410-832c-cd162a569da5
2011-03-25 17:00:57 +00:00
Milan Broz
38590eaef2 Fix return code when passphrase is read from pipe.
git-svn-id: https://cryptsetup.googlecode.com/svn/trunk@486 36d66b0a-2a48-0410-832c-cd162a569da5
2011-03-25 16:11:03 +00:00
Milan Broz
22e5cda9c6 Remove unused paramater.
git-svn-id: https://cryptsetup.googlecode.com/svn/trunk@483 36d66b0a-2a48-0410-832c-cd162a569da5
2011-03-23 11:43:11 +00:00
Milan Broz
2072adf705 Also support --skip option for loopaesOpen.
git-svn-id: https://cryptsetup.googlecode.com/svn/trunk@481 36d66b0a-2a48-0410-832c-cd162a569da5
2011-03-22 20:51:50 +00:00
Milan Broz
93da52f883 Rewrite key input handling, add limits.
git-svn-id: https://cryptsetup.googlecode.com/svn/trunk@474 36d66b0a-2a48-0410-832c-cd162a569da5
2011-03-19 00:17:10 +00:00
Milan Broz
ddcdd76cc2 Specify copyright holders in source files.
Add README notes.

git-svn-id: https://cryptsetup.googlecode.com/svn/trunk@461 36d66b0a-2a48-0410-832c-cd162a569da5
2011-03-14 14:17:38 +00:00
Milan Broz
25512d89ae Clean up plain password hashing, do not ignore error in crypto backend.
(New backend can fail there).

git-svn-id: https://cryptsetup.googlecode.com/svn/trunk@451 36d66b0a-2a48-0410-832c-cd162a569da5
2011-03-13 23:50:49 +00:00
Milan Broz
01e03f7002 Use loop functions even in api test.
git-svn-id: https://cryptsetup.googlecode.com/svn/trunk@448 36d66b0a-2a48-0410-832c-cd162a569da5
2011-03-12 22:29:14 +00:00
Milan Broz
dd9bff8d67 Proper handle old systems.
git-svn-id: https://cryptsetup.googlecode.com/svn/trunk@447 36d66b0a-2a48-0410-832c-cd162a569da5
2011-03-12 21:31:41 +00:00
Milan Broz
be3448fb8a Separate loop handling from internal code.
git-svn-id: https://cryptsetup.googlecode.com/svn/trunk@444 36d66b0a-2a48-0410-832c-cd162a569da5
2011-03-12 20:23:16 +00:00
Milan Broz
d9ba34693f Add support for automatic loop device use (image infile etc).
git-svn-id: https://cryptsetup.googlecode.com/svn/trunk@443 36d66b0a-2a48-0410-832c-cd162a569da5
2011-03-11 19:04:37 +00:00
Milan Broz
0a905364fa Fix mapping removal if device disappeared but node still exists.
git-svn-id: https://cryptsetup.googlecode.com/svn/trunk@420 36d66b0a-2a48-0410-832c-cd162a569da5
2011-01-29 15:55:27 +00:00
Milan Broz
044cb58588 Add loop-AES compatible handling code.
git-svn-id: https://cryptsetup.googlecode.com/svn/trunk@418 36d66b0a-2a48-0410-832c-cd162a569da5
2011-01-25 18:48:56 +00:00
Milan Broz
49937ac591 Detect # of keys from cipher string.
Fix status output string.

git-svn-id: https://cryptsetup.googlecode.com/svn/trunk@417 36d66b0a-2a48-0410-832c-cd162a569da5
2011-01-25 18:48:48 +00:00
Milan Broz
66bea4b3be Add dm flags for query for features.
Move adjust device helper to utils.
Fix locking memory message.

git-svn-id: https://cryptsetup.googlecode.com/svn/trunk@416 36d66b0a-2a48-0410-832c-cd162a569da5
2011-01-25 18:48:41 +00:00
Milan Broz
af87ffbd37 Add context to crypto backend init (so it can print errors to callback).
git-svn-id: https://cryptsetup.googlecode.com/svn/trunk@415 36d66b0a-2a48-0410-832c-cd162a569da5
2011-01-16 10:40:57 +00:00
Milan Broz
d04d9f336a Switch to new crypto backend interface.
git-svn-id: https://cryptsetup.googlecode.com/svn/trunk@408 36d66b0a-2a48-0410-832c-cd162a569da5
2010-12-31 14:33:43 +00:00
Milan Broz
38c694a143 Fix crypt_activate_by_keyfile() to work with PLAIN devices.
(allows systemd swap with /dev/urandom activation)

git-svn-id: https://cryptsetup.googlecode.com/svn/trunk@385 36d66b0a-2a48-0410-832c-cd162a569da5
2010-11-25 14:56:46 +00:00
Milan Broz
a70b27762d Fix some warnings if compiled with clang.
git-svn-id: https://cryptsetup.googlecode.com/svn/trunk@371 36d66b0a-2a48-0410-832c-cd162a569da5
2010-11-15 16:19:19 +00:00
Milan Broz
312d8eca73 * Allow to activate by internally cached volume key
(format/activate without keyslots active - used for temporary devices).
* Initialize volume key from active device in crypt_init_by_name()

git-svn-id: https://cryptsetup.googlecode.com/svn/trunk@365 36d66b0a-2a48-0410-832c-cd162a569da5
2010-11-14 17:22:04 +00:00
Milan Broz
f90edb6133 Simplify return codes from get key functions.
git-svn-id: https://cryptsetup.googlecode.com/svn/trunk@363 36d66b0a-2a48-0410-832c-cd162a569da5
2010-11-13 16:41:29 +00:00
Milan Broz
6258753b1a * Fix password callback call.
* Fix default plain password entry from terminal in activate_by_passphrase.

git-svn-id: https://cryptsetup.googlecode.com/svn/trunk@362 36d66b0a-2a48-0410-832c-cd162a569da5
2010-11-13 16:41:20 +00:00
Milan Broz
b7caa72acd * Disallow mapping of device which is already in use (mapped or mounted).
* Disallow luksFormat on device in use.

git-svn-id: https://cryptsetup.googlecode.com/svn/trunk@361 36d66b0a-2a48-0410-832c-cd162a569da5
2010-11-05 17:53:33 +00:00
Milan Broz
c9881f8c33 * Add crypt_get_type(), crypt_resize(), crypt_keyslot_max()
and crypt_get_active_device() to API.
* Rewrite all implementations in cryptsetup to new API.
* Fix luksRemoveKey to behave as documented (do not ask
for remaining keyslot passphrase).
* Add more regression tests for commands.

git-svn-id: https://cryptsetup.googlecode.com/svn/trunk@360 36d66b0a-2a48-0410-832c-cd162a569da5
2010-11-05 11:27:47 +00:00
Milan Broz
a38cb2375f * Add crypt_set_uuid() to API.
* Allow UUID setting in luksFormat and luksUUID (--uuid parameter).

git-svn-id: https://cryptsetup.googlecode.com/svn/trunk@355 36d66b0a-2a48-0410-832c-cd162a569da5
2010-10-29 13:54:14 +00:00
Milan Broz
dfe77be748 * Implement --use-random and --use-urandom for luksFormat to allow setting of RNG for volume key generator.
* Add crypt_set_rng_type() and crypt_get_rng_type() to API.

git-svn-id: https://cryptsetup.googlecode.com/svn/trunk@354 36d66b0a-2a48-0410-832c-cd162a569da5
2010-10-27 15:35:23 +00:00
Milan Broz
3ae161df5d Move get_key to common code, simplify verify flags.
(This code need rewrite anyway).

git-svn-id: https://cryptsetup.googlecode.com/svn/trunk@352 36d66b0a-2a48-0410-832c-cd162a569da5
2010-10-26 22:08:02 +00:00
Milan Broz
3a5a1ea0e7 Move safe alloc routines into common lib file.
git-svn-id: https://cryptsetup.googlecode.com/svn/trunk@351 36d66b0a-2a48-0410-832c-cd162a569da5
2010-10-26 22:07:43 +00:00
Milan Broz
bb8e085378 Add utils_crypt file and test for supported modes presentation.
git-svn-id: https://cryptsetup.googlecode.com/svn/trunk@348 36d66b0a-2a48-0410-832c-cd162a569da5
2010-10-26 14:34:47 +00:00
Milan Broz
3b50005d2f Simplify crypto backend init.
git-svn-id: https://cryptsetup.googlecode.com/svn/trunk@347 36d66b0a-2a48-0410-832c-cd162a569da5
2010-10-26 14:34:35 +00:00
Milan Broz
ef10cd09ec Generalise volume key struct.
Do not generate unused volume key in PLAIN mode.

git-svn-id: https://cryptsetup.googlecode.com/svn/trunk@346 36d66b0a-2a48-0410-832c-cd162a569da5
2010-10-26 14:34:17 +00:00
Milan Broz
9679fb7f25 Add crypt_get_device_name() to API (get underlying device name).
git-svn-id: https://cryptsetup.googlecode.com/svn/trunk@342 36d66b0a-2a48-0410-832c-cd162a569da5
2010-10-18 14:47:06 +00:00
Milan Broz
b117dcc209 Do not query non-existent device twice:
# cryptsetup status /dev/nonexistent
  Device /dev/nonexistent not found
  Device /dev/nonexistent not found

git-svn-id: https://cryptsetup.googlecode.com/svn/trunk@330 36d66b0a-2a48-0410-832c-cd162a569da5
2010-08-13 14:05:34 +00:00
Milan Broz
ef44e6e3d3 Use default data alignment to 1MiB.
If there is topology info, use default if topology is multiple of default,
otherwise use topology values.

See https://bugzilla.redhat.com/show_bug.cgi?id=621684 and issue 55.

git-svn-id: https://cryptsetup.googlecode.com/svn/trunk@325 36d66b0a-2a48-0410-832c-cd162a569da5
2010-08-09 16:34:42 +00:00