summaryrefslogtreecommitdiff
path: root/src/share/common
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/common
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/common')
-rw-r--r--src/share/common9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/share/common b/src/share/common
index 28da3c0..de97ef7 100644
--- a/src/share/common
+++ b/src/share/common
@@ -530,6 +530,15 @@ gpg2authorized_keys() {
### GPG UTILITIES
+# script to determine if gpg version is equal to or greater than specified version
+is_gpg_version_greater_equal() {
+ local gpgVersion=$(gpg --version | head -1 | awk '{ print $3 }')
+ local latest=$(printf '%s\n%s\n' "$1" "$gpgVersion" \
+ | tr '.' ' ' | sort -g -k1 -k2 -k3 \
+ | tail -1 | tr ' ' '.')
+ [[ "$gpgVersion" == "$latest" ]]
+}
+
# retrieve all keys with given user id from keyserver
# FIXME: need to figure out how to retrieve all matching keys
# (not just first N (5 in this case))