Bug#478598: partman-crypto: problems with using random keys
Hey Frans,
On Sat, May 03, 2008 at 10:56:31PM +0200, Frans Pop wrote:
> On Saturday 03 May 2008, Max Vozeler wrote:
> > 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.
>
> Does that mean that I should not have been shown *either* of the two dialogs
> (passphrase and random typing) with the "incorrect" method?
No. By switching encryption methods, you got the default of the
selected method (loop-AES), which is keyfile. It involves asking
for a passphrase and getting random input.
> Should cdebconf-entropy be used only with dm-crypt?
No. Here is a table to clear up any misunderstandings:
Method | Type | Key generation
------------------------------------------------------
dm-crypt | passphrase | persistent key from /dev/urandom, wrapped
| | with passphrase
dm-crypt | random | volatile key from /dev/random
loop-AES | keyfile | persistent key from /dev/random, wrapped
with GnuPG
loop-AES | random | volatile key from /dev/urandom
In all cases that involve /dev/random rather than /dev/urandom,
we use cdebconf-entropy to help key generation, because random
blocks when the kernel is running out of entropy.
These cases use cdebconf-entropy:
dm-crypt random
loop-AES keyfile
These cases ask for a passphrase:
dm-crypt passphrase
loop-AES keyfile
The other cases show neither dialogs, because they generate
volatile keys from /dev/urandom with no passphrase:
loop-AES random
BTW: We can and should switch the dm-crypt random case to just
use /dev/urandom, since it is sufficient for a volatile one-time
encryption key.
> If that is the case then the current logic is _really_ broken...
...
> > FWIW, the partman dialog should reflect the reset keytype after
> > switching the encryption type.
>
> IIRC it did not. My test should be trivial to reproduce though.
It does - I just verified it.
Max
Reply to: