]> gitweb.fluxo.info Git - keyringer.git/commitdiff
Passphrase confirmation at genpair_gpg
authorSilvio Rhatto <rhatto@riseup.net>
Sun, 12 Dec 2010 19:25:12 +0000 (17:25 -0200)
committerSilvio Rhatto <rhatto@riseup.net>
Sun, 12 Dec 2010 19:25:12 +0000 (17:25 -0200)
share/keyringer/genpair

index 6dff7c64f50173d4cf1943443ec6bb54a2c2c1ce..d6a2b9d4c4f76d936356b0be91183221019d2fc0 100755 (executable)
@@ -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