From 1286c030b050d56aaee1d072828e2bd545305495 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Wed, 14 Jun 2017 21:11:37 +0100 Subject: [PATCH] gpg batch parameters for curve 25519 --- src/freedombone-adduser | 5 +++-- src/freedombone-base-email | 10 ++++++---- src/freedombone-utils-backup | 5 +++-- 3 files changed, 12 insertions(+), 8 deletions(-) diff --git a/src/freedombone-adduser b/src/freedombone-adduser index 3285c5cb..73e64af6 100755 --- a/src/freedombone-adduser +++ b/src/freedombone-adduser @@ -136,8 +136,9 @@ chmod 700 /home/$ADD_USERNAME/.gnupg chmod 600 /home/$ADD_USERNAME/.gnupg/* # Generate a GPG key -echo 'Key-Type: 9' > /home/$ADD_USERNAME/gpg-genkey.conf -echo 'Subkey-Type: 1' >> /home/$ADD_USERNAME/gpg-genkey.conf +echo 'Key-Type: eddsa' > /home/$ADD_USERNAME/gpg-genkey.conf +echo 'Key-Curve: Ed25519' > /home/$ADD_USERNAME/gpg-genkey.conf +echo 'Subkey-Type: eddsa' >> /home/$ADD_USERNAME/gpg-genkey.conf echo "Name-Real: $ADD_USERNAME" >> /home/$ADD_USERNAME/gpg-genkey.conf echo "Name-Email: $ADD_USERNAME@$HOSTNAME" >> /home/$ADD_USERNAME/gpg-genkey.conf echo 'Expire-Date: 0' >> /home/$ADD_USERNAME/gpg-genkey.conf diff --git a/src/freedombone-base-email b/src/freedombone-base-email index 59381f51..ba1e7d75 100755 --- a/src/freedombone-base-email +++ b/src/freedombone-base-email @@ -1505,9 +1505,10 @@ function create_gpg_subkey { KEYGRIP=$(gpg --fingerprint --fingerprint $MY_EMAIL_ADDRESS | grep fingerprint | tail -1 | cut -d= -f2 | sed -e 's/ //g') # Generate a GPG subkey - echo 'Key-Type: 9' > /home/$MY_USERNAME/gpg-genkey.conf + echo 'Key-Type: eddsa' > /home/$MY_USERNAME/gpg-genkey.conf + echo 'Key-Curve: Ed25519' > /home/$MY_USERNAME/gpg-genkey.conf echo "Key-Grip: $KEYGRIP" > /home/$MY_USERNAME/gpg-genkey.conf - echo 'Subkey-Type: 1' >> /home/$MY_USERNAME/gpg-genkey.conf + echo 'Subkey-Type: eddsa' >> /home/$MY_USERNAME/gpg-genkey.conf echo "subkey-Usage: $GPG_KEY_USAGE" > /home/$MY_USERNAME/gpg-genkey.conf echo "Name-Real: $MY_NAME" >> /home/$MY_USERNAME/gpg-genkey.conf echo "Name-Email: $MY_EMAIL_ADDRESS" >> /home/$MY_USERNAME/gpg-genkey.conf @@ -1622,8 +1623,9 @@ function configure_gpg { fi else # Generate a GPG key - echo 'Key-Type: 9' > /home/$MY_USERNAME/gpg-genkey.conf - echo 'Subkey-Type: 1' >> /home/$MY_USERNAME/gpg-genkey.conf + echo 'Key-Type: eddsa' > /home/$MY_USERNAME/gpg-genkey.conf + echo 'Key-Curve: Ed25519' >> /home/$MY_USERNAME/gpg-genkey.conf + echo 'Subkey-Type: eddsa' >> /home/$MY_USERNAME/gpg-genkey.conf echo "Name-Real: $MY_NAME" >> /home/$MY_USERNAME/gpg-genkey.conf echo "Name-Email: $MY_EMAIL_ADDRESS" >> /home/$MY_USERNAME/gpg-genkey.conf echo 'Expire-Date: 0' >> /home/$MY_USERNAME/gpg-genkey.conf diff --git a/src/freedombone-utils-backup b/src/freedombone-utils-backup index eaf4958f..27a6854d 100755 --- a/src/freedombone-utils-backup +++ b/src/freedombone-utils-backup @@ -65,8 +65,9 @@ function configure_backup_key { # Generate a GPG key for backups BACKUP_KEY_EXISTS=$(gpg_key_exists "$MY_USERNAME" "$MY_NAME (backup key)") if [[ $BACKUP_KEY_EXISTS == "no" ]]; then - echo 'Key-Type: 9' > /home/$MY_USERNAME/gpg-genkey.conf - echo 'Subkey-Type: 1' >> /home/$MY_USERNAME/gpg-genkey.conf + echo 'Key-Type: eddsa' > /home/$MY_USERNAME/gpg-genkey.conf + echo 'Key-Curve: Ed25519' > /home/$MY_USERNAME/gpg-genkey.conf + echo 'Subkey-Type: eddsa' >> /home/$MY_USERNAME/gpg-genkey.conf echo "Name-Real: $MY_NAME" >> /home/$MY_USERNAME/gpg-genkey.conf echo "Name-Email: $MY_EMAIL_ADDRESS" >> /home/$MY_USERNAME/gpg-genkey.conf echo "Name-Comment: backup key" >> /home/$MY_USERNAME/gpg-genkey.conf