key lookup strategies

Patrick Brunschwig patrick at mozilla-enigmail.org
Wed Dec 1 12:56:11 CET 2010


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

On 30.11.10 11:23, Ans wrote:
> Hi
> 
>>> I know that it uses the first key to which the pattern applies and that
>>> i could force the correct lookup using -r "<oo at bar.com>" but still it
>>> seems somehow strange.
>>
>> As stated in the manual the default is a substring search and thus you
>> get what you asked for.
> 
> Ok, i see that. But the strange thing is not that it does a substring
> search. The strange thing is that, when i do "gpg --encrypt -r oo at bar"
> (and "-r" apparently stands for *receipient*, not "search string") it
> just picks the first match and encrypts the mail with this key.

Yes, "-r" stands for "recipient" -- but the _parameter_ you specify to
"-r" is a search string, not an exact match (the same rules apply e.g.
to -u). Thus you receive what you've asked for.

> It doesn't even say: "Warning: there were 6 matches, i'm now picking a
> random (*) key from those six, even though one would fit perfectly..."
> no it just silently takes one, which is quite strange as a user-experience.
> 
> You might easily end up using the wrong key if you are not particularly
> careful. (or if you are using another tool to talk to gpg, which does
> not quote email adresses. that's how i found out...).

You should ask the author of the "tool" to change the behavior.

- -Patrick
-----BEGIN PGP SIGNATURE-----
Version: GnuPG/MacGPG2 v2.0.16 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iQEVAwUBTPY32Mk25cDiHiw+AQgdoAf+LSv5zdveyYpUAeq1zbeFX85HSrDuyF4X
YyIiYrtosGP0LxdzgYuDo5RTMXISqOfTUmOJ4u4IaN3FDlfGCuX6kdcgzF/7EE7L
q2DMnC3Ll9rc+Fgn27GMWJazzmUpvlkmEEJGKUIluo9aKnOipJNtbyER1wmbCqI3
dwSu6wVXcttgOhH+4SYTmncjpDJwANlQ2RCF7RAtj51z5HT/ReBDTtJ84Uvjnbjj
UhQErtuwAmDbwfwgUu03OwnJ7kKO98J/iWNH+pVn5XZKw6vPvgtO0Tirwm8gp8Ke
B5n7CAQPl6vkwP/1Eh4qtVbYE74IlWuFH9FeLHvV28zHumgYLPAhOg==
=YupI
-----END PGP SIGNATURE-----




More information about the Gnupg-devel mailing list