From: Silvio Rhatto Date: Sun, 12 Dec 2010 19:25:12 +0000 (-0200) Subject: Passphrase confirmation at genpair_gpg X-Git-Tag: 0.2.1~92 X-Git-Url: https://gitweb.fluxo.info/?a=commitdiff_plain;h=3fe08f7b15f1b58b1174249752090b1bddaaa6c0;p=keyringer.git Passphrase confirmation at genpair_gpg --- diff --git a/share/keyringer/genpair b/share/keyringer/genpair index 6dff7c6..d6a2b9d 100755 --- a/share/keyringer/genpair +++ b/share/keyringer/genpair @@ -34,8 +34,20 @@ function genpair_ssh { # Generate a keypair, gpg version function genpair_gpg { echo "Make sure that $KEYDIR is atop of an encrypted volume." - read -s -p "Enter password for the private key: " passphrase - printf "\n" + + passphrase="no" + passphrase_confirm="confirm" + + while [ "$passphrase" != "$passphrase_confirm" ]; do + read -s -p "Enter password for the private key: " passphrase + printf "\n" + read -s -p "Enter password again: " passphrase_confirm + printf "\n" + + if [ "$passphrase" != "$passphrase_confirm" ]; then + echo "Password don't match." + fi + done # TODO: insert random bytes # TODO: custom Name-Comment and Name-Email