summaryrefslogtreecommitdiff
path: root/src/share/m
diff options
context:
space:
mode:
authorJameson Rollins <jrollins@finestructure.net>2010-01-10 18:48:59 -0500
committerJameson Rollins <jrollins@finestructure.net>2010-01-10 18:48:59 -0500
commitcf7d2f1e843e429a462d2dd11430fd48b0281cb2 (patch)
tree4555db56e328273af485acdd6c0799cc4f612e4d /src/share/m
parent9a3c85827f90722036a8f6a2b81a2926ea088ff3 (diff)
Fix patch for gen_key to test gpg version.
This patch checks the version of gpg (for v1 and v2) and sets the key type command for the gen_subkey gpg edit-key script appropriately.
Diffstat (limited to 'src/share/m')
-rw-r--r--src/share/m/gen_subkey23
1 files changed, 18 insertions, 5 deletions
diff --git a/src/share/m/gen_subkey b/src/share/m/gen_subkey
index 9cc6028..cf1ed0c 100644
--- a/src/share/m/gen_subkey
+++ b/src/share/m/gen_subkey
@@ -44,12 +44,25 @@ Type '$PGRM help' for usage."
# check that an authentication subkey does not already exist
check_gpg_authentication_subkey "$keyID"
+ # determine which keyType to use from gpg version
+ keyType=7
+ case $(gpg --version | head -1 | awk '{ print $3 }' | cut -d. -f1) in
+ 1)
+ if is_gpg_version_greater_equal 1.4.10 ; then
+ keyType=8
+ fi
+ ;;
+ 2)
+ if is_gpg_version_greater_equal 2.0.13 ; then
+ keyType=8
+ fi
+ ;;
+ *)
+ keyType=8
+ ;;
+ esac
+
# generate the list of commands that will be passed to edit-key
- # 7 for < 1.4.10
- # 8 for >= 1.4.10
- # 7 for < 2.0.13
- # 8 for >= 2.0.13
- keyType=8
editCommands="addkey
$keyType
S