From: Daniel Kahn Gillmor Date: Mon, 18 Jan 2010 06:32:08 +0000 (-0500) Subject: add check for multiple secret keys and new listfprs subcommand to tests/keytrans X-Git-Tag: monkeysphere_0.28~35 X-Git-Url: https://codewiz.org/gitweb?a=commitdiff_plain;h=4665f8508b6bb2b20a424b7176768358d53c59df;p=monkeysphere.git add check for multiple secret keys and new listfprs subcommand to tests/keytrans --- diff --git a/tests/keytrans b/tests/keytrans index 8808cbc..e70751d 100755 --- a/tests/keytrans +++ b/tests/keytrans @@ -106,8 +106,8 @@ diff -u \ <(hd "$TEMPDIR"/secret.key) \ <(hd "$TEMPDIR"/converted.secret.key) - -KEYID=$(gpg --fingerprint --with-colons --list-keys | grep ^fpr | cut -f10 -d: | cut -b25-40) +KEYFPR=$(gpg --fingerprint --with-colons --list-keys | grep ^fpr | cut -f10 -d:) +KEYID=$(printf "%s" "$KEYFPR" | cut -b25-40) echo "conversions look good!" @@ -162,6 +162,49 @@ EOF diff -u "$TEMPDIR"/expectedout <(gpg --check-sigs --with-colons --fixed-list-mode | grep -v ^tru) +echo "##################################################" +echo "### test working with two primary keys ... " + +ssh-keygen -t rsa -b 1024 -N '' -f "$TEMPDIR"/newkey + +PEM2OPENPGP_USAGE_FLAGS=authenticate,certify \ +PEM2OPENPGP_TIMESTAMP="$(( $timestamp + 1 ))" pem2openpgp fubar \ + < "$TEMPDIR"/newkey > "$TEMPDIR"/newkey.gpg + +NEWKEYFPR=$(< "$TEMPDIR"/newkey.gpg keytrans listfprs) +NEWKEYID=$( printf "%s" "$NEWKEYFPR" | cut -b25-40) + +< "$TEMPDIR"/newkey.gpg gpg --import + +< "$TEMPDIR"/secring.gpg \ +PEM2OPENPGP_TIMESTAMP="$timestamp" \ + keytrans adduserid "$KEYID" "baz" | gpg --import + +gpg --check-sigs --with-colons --fixed-list-mode + +cat >"$TEMPDIR"/expectedout <"$TEMPDIR"/expectedout <