X-Git-Url: https://codewiz.org/gitweb?a=blobdiff_plain;ds=sidebyside;f=src%2Fshare%2Fcommon;h=37f5305a46022f59ea2ed2a1c7e1d2cb76ac4a38;hb=93dd8e30ae877ac3ee2e73a8303e3e797e27b944;hp=0a7fe87c862585928b7cb6b066b482eb044300aa;hpb=8b806ee99239d48fd3c2920c19f5cac7d54d2e8d;p=monkeysphere.git diff --git a/src/share/common b/src/share/common index 0a7fe87..37f5305 100644 --- a/src/share/common +++ b/src/share/common @@ -478,7 +478,7 @@ gpg2ssh() { keyID="$1" - gpg --export "$keyID" | openpgp2ssh "$keyID" 2>/dev/null + gpg --export --no-armor "$keyID" | openpgp2ssh "$keyID" 2>/dev/null } # output known_hosts line from ssh key @@ -1200,13 +1200,25 @@ process_authorized_user_ids() { list_primary_fingerprints() { local fake=$(msmktempdir) trap "rm -rf $fake" EXIT - GNUPGHOME="$fake" gpg --no-tty --quiet --import + GNUPGHOME="$fake" gpg --no-tty --quiet --import --ignore-time-conflict 2>/dev/null GNUPGHOME="$fake" gpg --with-colons --fingerprint --list-keys | \ awk -F: '/^fpr:/{ print $10 }' trap - EXIT rm -rf "$fake" } +# takes an OpenPGP key or set of keys on stdin, a fingerprint or other +# key identifier as $1, and outputs the gpg-formatted information for +# the requested keys from the material on stdin +get_cert_info() { + local fake=$(msmktempdir) + trap "rm -rf $fake" EXIT + 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" + trap - EXIT + rm -rf "$fake" +} + check_cruft_file() { local loc="$1"