summaryrefslogtreecommitdiff
path: root/security/monkeysphere/files/patch-src_share_common
blob: 1c2b501f5de002e379c3addec2fcea9b24eec6c1 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
--- src/share/common.orig	2018-10-16 16:24:55 UTC
+++ src/share/common
@@ -495,7 +495,7 @@ gpg2ssh() {
     
     keyID="$1"
 
-    gpg --export --no-armor "$keyID" | openpgp2ssh "$keyID" 2>/dev/null
+    gpg2 --export --no-armor "$keyID" | openpgp2ssh "$keyID" 2>/dev/null
 }
 
 # output known_hosts line from ssh key
@@ -601,7 +601,7 @@ gpg2authorized_keys() {
 
 # 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 gpgVersion=$(gpg2 --version | head -1 | awk '{ print $3 }')
     local latest=$(printf '%s\n%s\n' "$1" "$gpgVersion" \
 	| tr '.' ' ' | sort -g -k1 -k2 -k3 \
 	| tail -1 | tr ' ' '.')
@@ -622,7 +622,7 @@ gpg_fetch_userid() {
 
     log verbose " checking keyserver $KEYSERVER... "
     foundkeyids="$(echo | \
-	gpg --quiet --batch --with-colons \
+	gpg2 --quiet --batch --with-colons \
 	--command-fd 0 --keyserver "$KEYSERVER" \
 	--search ="$userID" 2>/dev/null)"
     returnCode="$?"
@@ -637,7 +637,7 @@ $foundkeyids
         foundkeyids="$(printf "%s" "$foundkeyids" | grep '^pub:' | cut -f2 -d: | sed 's/^/0x/')"
         log verbose " Found keyids on keyserver: $(printf "%s" "$foundkeyids" | tr '\n' ' ')"
         if [ -n "$foundkeyids" ]; then
-            echo | gpg --quiet --batch --with-colons \
+            echo | gpg2 --quiet --batch --with-colons \
                 --command-fd 0 --keyserver "$KEYSERVER" \
                 --recv-keys $foundkeyids &>/dev/null
             returnCode="$?"
@@ -693,7 +693,7 @@ process_user_id() {
     gpg_fetch_userid "$userID"
 
     # output gpg info for (exact) userid and store
-    gpgOut=$(gpg --list-key --fixed-list-mode --with-colons \
+    gpgOut=$(gpg2 --list-key --fixed-list-mode --with-colons \
 	--with-fingerprint --with-fingerprint \
 	="$userID" 2>/dev/null) || returnCode="$?"
 
@@ -962,8 +962,8 @@ list_primary_fingerprints() {
         rm -rf "$fake"
     }
     trap cleanup EXIT
-    GNUPGHOME="$fake" gpg --no-tty --quiet --import --ignore-time-conflict 2>/dev/null
-    GNUPGHOME="$fake" gpg --with-colons --fingerprint --list-keys | \
+    GNUPGHOME="$fake" gpg2 --no-tty --quiet --import --ignore-time-conflict 2>/dev/null
+    GNUPGHOME="$fake" gpg2 --with-colons --fingerprint --list-keys | \
 	awk -F: '/^fpr:/{ if (ok) { print $10 } ; ok=0 } /^pub:/{ ok=1 }'
     trap - EXIT
     cleanup
@@ -981,8 +981,8 @@ get_cert_info() {
         fi
         rm -rf "$fake"
     }
-    GNUPGHOME="$fake" gpg --no-tty --quiet --import --ignore-time-conflict 2>/dev/null
-    GNUPGHOME="$fake" gpg --with-colons --fingerprint --fixed-list-mode --list-keys "$1"
+    GNUPGHOME="$fake" gpg2 --no-tty --quiet --import --ignore-time-conflict 2>/dev/null
+    GNUPGHOME="$fake" gpg2 --with-colons --fingerprint --fixed-list-mode --list-keys "$1"
     trap - EXIT
     cleanup
 }