1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-07-01 03:22:48 -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

@ -2418,7 +2418,7 @@ Private-MAC: 6f5e588e475e55434106ec2c3569695b03f423228b44993a9e97d52ffe7be5a8
(True, algorithm, public_blob, comment, None))
self.assertEqual(ppk_loadpub_s("not a key file"),
(False, None, b'', None,
b'not a PuTTY SSH-2 private key'))
b'not a public key or a PuTTY SSH-2 private key'))
k1, c, e = ppk_load_s(input_clear_key, None)
self.assertEqual((c, e), (comment, None))
@ -2480,7 +2480,7 @@ Private-MAC: 5b1f6f4cc43eb0060d2c3e181bc0129343adba2b
(True, algorithm, public_blob, comment, None))
self.assertEqual(ppk_loadpub_s("not a key file"),
(False, None, b'', None,
b'not a PuTTY SSH-2 private key'))
b'not a public key or a PuTTY SSH-2 private key'))
k1, c, e = ppk_load_s(v2_clear_key, None)
self.assertEqual((c, e), (comment, None))