Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Create a GnuPG keyfile for use by loop-AES.
- # (v3 key format: 2925 bytes in base64)
- create_gnupg_keyfile () {
- local keyfile pass passfifo pid
- keyfile=$1
- pass=$2
- passfifo=$keyfile.pass
- if [ ! -p $passfifo ]; then
- mknod $passfifo p
- chmod 0600 $passfifo
- fi
- # Fork off gnupg encrypting pipe
- printf %s "$pass" > $passfifo &
- gnupg_encrypt $keyfile $passfifo &
- gpg_pid=$!
- # Call plugin to feed randfifo
- call_entropy_plugin 2925
- if [ $? -ne 0 ] || ! wait $gpg_pid; then
- rm $keyfile
- kill $gpg_pid
- return 1
- fi
- # for use by init.d/crypto
- printf %s "$pass" > $passfifo &
- return 0
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement