[Pkg-cryptsetup-devel] Bug#465902: passphrase prompting util

David Härdeman david at hardeman.nu
Fri Mar 21 20:23:59 UTC 2008


I said before:
> On the other hand, I already have some code for a simple program (in C)
> that automatically uses usplash or console to get a passphrase from a
> user. Perhaps it is time to dust it off, add fifo as a third input method
> and add it to cryptsetup.

I've attached a first version of the tool to this mail. The idea is that 
we would ship this as (e.g.) /lib/cryptsetup/askpass in both the real fs 
and in the initramfs.

It will automatically detect if usplash is running and if so, use it. 
Otherwise, the console will be used for a regular text-based prompt. A 
fifo is also created in /lib/cryptsetup/passfifo, which if written to, 
will cause the command prompt or usplash based prompts to exit and the 
value written to that pipe will be used instead.

My hope is that we can also extend the program in the future to support 
splashy.

The binary can be compiled with:
gcc -Wall -std=c99 -pedantic askpass.c -o askpass

And executed with:
./askpass "Please enter passphrase for something: "

The passphrase will be echoed to stdout.

This is a rough first version, but it seems to be working so far. I 
suggest we integrate it into the cryptsetup build first, then we can 
gradually experiment with introducing it into the initramfs script 
(which should ensure a minimum amount of breakage since simply shipping 
the binary won't break anything).

-- 
David Härdeman
-------------- next part --------------
A non-text attachment was scrubbed...
Name: askpass.c
Type: text/x-csrc
Size: 9958 bytes
Desc: not available
Url : http://lists.alioth.debian.org/pipermail/pkg-cryptsetup-devel/attachments/20080321/fb530ae8/attachment.c 


More information about the Pkg-cryptsetup-devel mailing list