diff options
author | Daniel Kahn Gillmor <dkg@fifthhorseman.net> | 2010-01-18 01:32:08 -0500 |
---|---|---|
committer | Daniel Kahn Gillmor <dkg@fifthhorseman.net> | 2010-01-18 01:32:08 -0500 |
commit | 4665f8508b6bb2b20a424b7176768358d53c59df (patch) | |
tree | 1a59c61ceeb5db249061a82b437942d7a9ad15cd /tests/keytrans | |
parent | 585800f161f5cc09ffcb666426691714294cf95e (diff) |
add check for multiple secret keys and new listfprs subcommand to tests/keytrans
Diffstat (limited to 'tests/keytrans')
-rwxr-xr-x | tests/keytrans | 47 |
1 files changed, 45 insertions, 2 deletions
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 <<EOF +pub:u:1024:1:$KEYID:$timestamp:::u:::scSC: +uid:u::::$timestamp::E90EC72E68C6C2A0751DADC70F54F60D27B88C3D::monkeymonkey: +sig:!::1:$KEYID:$timestamp::::monkeymonkey:13x: +uid:r::::::8200BD0425CC70C7D698DF3FE412044EAAB83F94::testtest: +sig:!::1:$KEYID:$timestamp::::monkeymonkey:13x: +rev:!::1:$KEYID:$revtime::::monkeymonkey:30x: +uid:u::::$timestamp::EDDC32D783E7F4C7B6982D9AE5DC4A61000648BA::baz: +sig:!::1:$KEYID:$timestamp::::monkeymonkey:13x: +pub:-:1024:1:$NEWKEYID:$(($timestamp + 1)):::-:::caCA: +uid:-::::$(($timestamp + 1))::A0D708F51CC257DEFC01AEDE1E0A5F329DFD8F16::fubar: +sig:!::1:$NEWKEYID:$(($timestamp + 1))::::fubar:13x: +EOF + +diff -u "$TEMPDIR"/expectedout <(gpg --check-sigs --with-colons --fixed-list-mode | grep -v ^tru) + +cat >"$TEMPDIR"/expectedout <<EOF +$KEYFPR +$NEWKEYFPR +EOF + +diff -u "$TEMPDIR"/expectedout <( < "$TEMPDIR"/secring.gpg keytrans listfprs) + ## FIXME: addtest: not testing subkeys at the moment. |