]> asedeno.scripts.mit.edu Git - PuTTY.git/commit
uxpgnt: correct control flow in find_key().
authorSimon Tatham <anakin@pobox.com>
Wed, 15 Feb 2017 05:31:30 +0000 (05:31 +0000)
committerSimon Tatham <anakin@pobox.com>
Wed, 15 Feb 2017 05:47:16 +0000 (05:47 +0000)
commit1266ac0e304b4e4db809eb045b8ac5dc43f299c4
tree88cc9b25d886799d7dc0c0f30eda733caf70c0c2
parent54720b2c5a36648864d7bfc6547ef86168db1865
uxpgnt: correct control flow in find_key().

If we try to interpret a string argument as the name of a key file,
sometimes we it's in circumstances where we _know_ it's a key file, so
we must print an error message and return failure if the file can't be
loaded. Other times it's not, and we just fall back to interpreting
the argument in some other way (e.g. as a pattern match against the
comment or fingerprint of a key already in the agent).

My code dealing with failure returns from the public-key loading
functions were mishandling the latter case, if they identified a file
as existing and looking more or less like some kind of key file but
then it turned out to have a format error; they would try to copy and
return a public key that they didn't actually have. Even if
pageant_pubkey_copy avoided crashing as a result, this would still
inhibit the fallback to treating the input string as some other kind
of pattern match.
unix/uxpgnt.c