[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#478598: partman-crypto: problems with using random keys



Hey there Frans,

On Wed, Apr 30, 2008 at 01:04:35AM +0200, Frans Pop wrote:
> make the swap partition use loop-aes with random key.
> 
> "Correct" method:
> - select the swap partition
> - choose Use as: physical volume for encryption
> - choose Encryption method: Loopback
> - choose Encryption key: Random key
> - choose Erase data: no
> - Done setting up partition
> - Proceed with "Configure encrypted volumes", OK to write changes to disk.
> 
> After this the process completes immediately, apparently successfully. I do 
> *not* get the dialog asking to enter random keys. This seems like it could 
> be a bug, especially given that I am asked to do so with the next example.

Not a bug -

When you select "Random key" for loop-AES, the actual keys
are generated from /dev/urandom by mount or swapon. We don't 
use cdebconf-entropy for such setups.

> "Incorrect" method:
> - select the swap partition
> - choose Use as: physical volume for encryption
> - choose Encryption key: Random key
> - choose Encryption method: Loopback
> Note that I now select the key type before the method.
> - choose Erase data: no
> - Done setting up partition
> - Proceed with "Configure encrypted volumes", OK to write changes to disk.
> 
> After this I am first asked to enter an encryption passphrase, even though 
> there is no partition that uses one. This is a bug.

Indeed, this is arguably non-intuitive.

Your earlier choice of random keytype was reset to the default
for loop-AES, gnupg keyfile, when you changed the encryption
method. 

FWIW, the partman dialog should reflect the reset keytype after
switching the encryption type.

I think we should be able to retain all settings except cipher
and keysize - I'll check and adapt the code.

> After that I *am* asked to enter random characters, with the progress bar at 
> only 2%. Getting sufficient entropy litterally takes ages: getting from 5 
> to 10% takes 20 seconds. I don't remember it taking that long with previous 
> tests I've done.

Were the earlier tests done in the same environment? 

Lots of factors contribute to how well (or how badly) the entropy
pool is being fed by device drivers. IIRC some disk drivers do,
some don't, some network drivers do, others don't etc.

Apart from that I don't recall any changes that should have made
key generation more painful than it already was. :-/

FWIW, I'm doing most of my testing with 

  d-i preseed/early_command string mount --bind /dev/urandom /dev/random

> Question
> Is "Random key" a valid choice when using dm-crypt? 

It is.

> The interface does allow 
> it, but I seem to remember that supporting random keys was the reason why 
> we still needed support for loop-aes.

No. loop-AES is not a "legacy" for lack of features in dm-crypt.

	Max



Reply to: