aboutsummaryrefslogtreecommitdiff
path: root/lib/keyringer/actions/genkeys
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2018-05-30 14:45:39 -0300
committerSilvio Rhatto <rhatto@riseup.net>2018-05-30 14:45:39 -0300
commita5e39bf904e83989b763f001a29adb9053df60f2 (patch)
tree7f81c07390b46b38a59b158f970d57f1cf3a70d2 /lib/keyringer/actions/genkeys
parent6c62a1906b59e4ab8eb3475ebfe3c3b7cfa67f0b (diff)
parent126eb39671e9c65c0c60a78b25189e4d4b1fae72 (diff)
downloadkeyringer-a5e39bf904e83989b763f001a29adb9053df60f2.tar.gz
keyringer-a5e39bf904e83989b763f001a29adb9053df60f2.tar.bz2
New upstream version 0.5.3upstream_keyringer_0.5.3
Diffstat (limited to 'lib/keyringer/actions/genkeys')
-rwxr-xr-xlib/keyringer/actions/genkeys30
1 files changed, 16 insertions, 14 deletions
diff --git a/lib/keyringer/actions/genkeys b/lib/keyringer/actions/genkeys
index 634c847..deacbfd 100755
--- a/lib/keyringer/actions/genkeys
+++ b/lib/keyringer/actions/genkeys
@@ -34,23 +34,25 @@ function genkeys_ssh {
function genkeys_gpg {
echo "Make sure that $KEYDIR is atop of an encrypted volume."
- passphrase="no"
- passphrase_confirm="confirm"
+ #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"
+ #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
+ # if [ "$passphrase" != "$passphrase_confirm" ]; then
+ # echo "Password don't match."
+ # fi
+ #done
+
+ keyringer_exec pwgen "$BASEDIR" "$FILE.passwd"
+ passphrase="`keyringer_exec decrypt "$BASEDIR" "$FILE.passwd"`"
# TODO: insert random bytes
# TODO: custom Name-Comment and Name-Email
- # TODO: allow for empty passphrases
$GPG --homedir "$TMPWORK" --gen-key --batch <<EOF
Key-Type: RSA
Key-Length: 4096
@@ -68,8 +70,8 @@ EOF
$GPG --armor --homedir "$TMPWORK" --export-secret-keys | keyringer_exec encrypt "$BASEDIR" "$FILE"
echo "Encrypting public key into keyringer..."
$GPG --armor --homedir "$TMPWORK" --export | keyringer_exec encrypt "$BASEDIR" "$FILE.pub"
- echo "Encrypting passphrase into keyringer..."
- echo "Passphrase for $FILE: $passphrase" | keyringer_exec encrypt "$BASEDIR" "$FILE.passwd"
+ #echo "Encrypting passphrase into keyringer..."
+ #echo "Passphrase for $FILE: $passphrase" | keyringer_exec encrypt "$BASEDIR" "$FILE.passwd"
if [ ! -z "$OUTFILE" ]; then
mkdir -p `dirname $OUTFILE`