Hi Neal,
I tested with TOFU Conflict and got an unexpected result which I think is a bug.
If I delete a key the TOFU binding is still around and subsequent verifications will
still result in conflict.
I also get messages about the deleted key:
gpg: key "B0C3D4105EFEB59FF6844A6F87252BE27FF7506D" not found: Not found
Imo it might be common to delete a key after a tofu conflict. "Oh this isn't
your key? Ok, I'll delete it."
Console log:
(kf5) aheinecke@esus ~> GNUPGHOME=$(mktemp -d)
(kf5) aheinecke@esus ~> export GNUPGHOME=$(mktemp -d)
(kf5) aheinecke@esus ~> gpg2 --import arbeit/gpg4win/zertifikate/aheinecke3.asc
gpg: NOTE: THIS IS A DEVELOPMENT VERSION!
gpg: It is only intended for test purposes and should NOT be
gpg: used in a production environment or with production keys!
gpg: keybox '/tmp/tmp.eZWNJPSRGE/pubring.kbx' created
gpg: /tmp/tmp.eZWNJPSRGE/trustdb.gpg: trustdb created
gpg: key 87252BE27FF7506D: public key "Andre Heinecke (This is a Test key)
<aheinecke3@example.com>" imported
gpg: Total number processed: 1
gpg: imported: 1
(kf5) aheinecke@esus ~> gpg2 --import
arbeit/gpg4win/zertifikate/aheinecke3-conflict.asc
gpg: NOTE: THIS IS A DEVELOPMENT VERSION!
gpg: It is only intended for test purposes and should NOT be
gpg: used in a production environment or with production keys!
gpg: key 58E583B9012747A5: public key "aheinecke3 for conflic (Test key)
<aheinecke3@example.com>" imported
gpg: Total number processed: 1
gpg: imported: 1
(kf5) aheinecke@esus ~>
(kf5) aheinecke@esus ~> gpg2 --trust-model tofu --verify /tmp/msg1
1
gpg: NOTE: THIS IS A DEVELOPMENT VERSION!
gpg: It is only intended for test purposes and should NOT be
gpg: used in a production environment or with production keys!
gpg: Signature made Thu 01 Dec 2016 04:13:07 PM CET
gpg: using EDDSA key B0C3D4105EFEB59FF6844A6F87252BE27FF7506D
gpg: checking the trustdb
gpg: no ultimately trusted keys found
gpg: Good signature from "Andre Heinecke (This is a Test key)
<aheinecke3@example.com>" [marginal]
gpg: aheinecke3@example.com: Verified 1 signature in the past 0 seconds, and
encrypted 0 messages.
gpg: Warning: we've only seen one message signed using this key and user id!
gpg: Warning: you have yet to encrypt a message to this key!
gpg: Warning: if you think you've seen more signatures by this key and user
id, then this key might be a forgery! Carefully examine the email address for small variations. If the key is suspect, then use gpg --tofu-policy bad B0C3D4105EFEB59FF6844A6F87252BE27FF7506D to mark it as being bad.
gpg: WARNING: This key is not certified with sufficiently trusted signatures!
gpg: It is not certain that the signature belongs to the owner.
Primary key fingerprint: B0C3 D410 5EFE B59F F684 4A6F 8725 2BE2 7FF7 506D
(kf5) aheinecke@esus ~> gpg2 --trust-model tofu --verify /tmp/msg2
gpg: NOTE: THIS IS A DEVELOPMENT VERSION!
gpg: It is only intended for test purposes and should NOT be
gpg: used in a production environment or with production keys!
gpg: Signature made Thu 01 Dec 2016 04:13:18 PM CET
gpg: using EDDSA key 535EE3A49BB8F14C1622B64358E583B9012747A5
gpg: Good signature from "aheinecke3 for conflic (Test key)
<aheinecke3@example.com>" [undefined]
The email address "aheinecke3@example.com" is associated with 2 keys!
Please indicate whether this email address should be associated with key
535EE3A49BB8F14C1622B64358E583B9012747A5 or whether you think someone is
impersonating "aheinecke3@example.com".
This key's user IDs:
aheinecke3 for conflic (Test key) <aheinecke3@example.com> (policy: ask)
Statistics for keys with the email address "aheinecke3@example.com":
535E E3A4 9BB8 F14C 1622 B643 58E5 83B9 0127 47A5 (this key): Encrypted 0 messages. Verified 1 message over the past day. B0C3 D410 5EFE B59F F684 4A6F 8725 2BE2 7FF7 506D (policy: ask): Encrypted 0 messages. Verified 1 message over the past day.
Normally, an email address is associated with a single key. However,
people sometimes generate a new key if their key is too old or they think
it might be compromised. Alternatively, a new key may indicate a
man-in-the-middle attack! Before accepting this association, you should
talk to or call the person to make sure this new key is legitimate.
(G)ood, (A)ccept once, (U)nknown, (R)eject once, (B)ad?
gpg: signal Interrupt caught ... exiting
(kf5) aheinecke@esus ~> gpg2 --trust-model tofu --batch --verify /tmp/msg2
130
gpg: Signature made Thu 01 Dec 2016 04:13:18 PM CET
gpg: using EDDSA key 535EE3A49BB8F14C1622B64358E583B9012747A5
gpg: Good signature from "aheinecke3 for conflic (Test key)
<aheinecke3@example.com>" [undefined]
gpg: aheinecke3@example.com: Verified 1 signature in the past 19 seconds, and
encrypted 0 messages.
gpg: WARNING: This key is not certified with a trusted signature!
gpg: There is no indication that the signature belongs to the owner.
Primary key fingerprint: 535E E3A4 9BB8 F14C 1622 B643 58E5 83B9 0127 47A5
(kf5) aheinecke@esus ~> gpg2 --trust-model tofu --batch --verify /tmp/msg1
gpg: Signature made Thu 01 Dec 2016 04:13:07 PM CET
gpg: using EDDSA key B0C3D4105EFEB59FF6844A6F87252BE27FF7506D
gpg: Good signature from "Andre Heinecke (This is a Test key)
<aheinecke3@example.com>" [undefined]
gpg: aheinecke3@example.com: Verified 1 signature in the past 45 seconds, and
encrypted 0 messages.
gpg: WARNING: This key is not certified with a trusted signature!
gpg: There is no indication that the signature belongs to the owner.
Primary key fingerprint: B0C3 D410 5EFE B59F F684 4A6F 8725 2BE2 7FF7 506D
(kf5) aheinecke@esus ~> gpg2 --delete-key B0C3D4105EFEB59FF6844A6F87252BE27FF7506D
gpg (GnuPG) 2.1.16-beta394; Copyright (C) 2016 Free Software Foundation, Inc.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
gpg: NOTE: THIS IS A DEVELOPMENT VERSION!
gpg: It is only intended for test purposes and should NOT be
gpg: used in a production environment or with production keys!
pub ed25519/87252BE27FF7506D 2016-10-14 Andre Heinecke (This is a Test key)
<aheinecke3@example.com>
Delete this key from the keyring? (y/N) y
(kf5) aheinecke@esus ~> gpg2 --trust-model tofu --batch --verify /tmp/msg2
gpg: Signature made Thu 01 Dec 2016 04:13:18 PM CET
gpg: using EDDSA key 535EE3A49BB8F14C1622B64358E583B9012747A5
gpg: key "B0C3D4105EFEB59FF6844A6F87252BE27FF7506D" not found: Not found
gpg: Good signature from "aheinecke3 for conflic (Test key)
<aheinecke3@example.com>" [undefined]
gpg: key "B0C3D4105EFEB59FF6844A6F87252BE27FF7506D" not found: Not found
gpg: key "B0C3D4105EFEB59FF6844A6F87252BE27FF7506D" not found: Not found
gpg: aheinecke3@example.com: Verified 1 signature in the past 1 minute, and
encrypted 0 messages.
gpg: WARNING: This key is not certified with a trusted signature!
gpg: There is no indication that the signature belongs to the owner.
Primary key fingerprint: 535E E3A4 9BB8 F14C 1622 B643 58E5 83B9 0127 47A5