From 3fe08f7b15f1b58b1174249752090b1bddaaa6c0 Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Sun, 12 Dec 2010 17:25:12 -0200 Subject: Passphrase confirmation at genpair_gpg --- share/keyringer/genpair | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) 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 -- cgit v1.2.3