1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-07-02 03:52:49 -05:00

Fix error messages in ppk_loadpub_s.

The function will accept a public key file or a PPK, but if it fails
to parse as any of those, the error message says "not a PuTTY SSH-2
private key", which is particularly incongruous in situations where
you're specifically _not_ after the private half of the key.

Now says "not a public key or a PuTTY SSH-2 private key".
This commit is contained in:
Simon Tatham
2022-04-20 07:45:17 +01:00
parent a5c0205b87
commit ffa25be185
2 changed files with 4 additions and 4 deletions

View File

@ -1237,7 +1237,7 @@ bool ppk_loadpub_s(BinarySource *src, char **algorithm, BinarySink *bs,
bool ret = openssh_loadpub(src, algorithm, bs, commentptr, errorstr);
return ret;
} else if (type != SSH_KEYTYPE_SSH2) {
error = "not a PuTTY SSH-2 private key";
error = "not a public key or a PuTTY SSH-2 private key";
goto error;
}
@ -1249,7 +1249,7 @@ bool ppk_loadpub_s(BinarySource *src, char **algorithm, BinarySink *bs,
if (0 == strncmp(header, "PuTTY-User-Key-File-", 20))
error = "PuTTY key format too new";
else
error = "not a PuTTY SSH-2 private key";
error = "not a public key or a PuTTY SSH-2 private key";
goto error;
}
error = "file format error";