1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-01-09 17:38:00 +00:00

Jacob's last-minute testing found a couple of trivial bugs in

import.c, and my attempts to reproduce them in cmdgen found another
one there :-)

[originally from svn r3847]
This commit is contained in:
Simon Tatham 2004-02-11 13:58:27 +00:00
parent 55bc23297f
commit 1f04a58f8d
2 changed files with 3 additions and 2 deletions

View File

@ -730,7 +730,7 @@ int main(int argc, char **argv)
case SSH_KEYTYPE_OPENSSH:
case SSH_KEYTYPE_SSHCOM:
ssh2key = import_ssh2(&infilename, intype, passphrase);
if (ssh2key)
if (ssh2key && ssh2key != SSH2_WRONG_PASSPHRASE)
error = NULL;
else if (!error) {
if (ssh2key == SSH2_WRONG_PASSPHRASE)

View File

@ -582,6 +582,7 @@ struct ssh2_userkey *openssh_read(const Filename *filename, char *passphrase)
if (ret < 0 || id != 2 ||
key->keyblob+key->keyblob_len-p < len) {
errmsg = "ASN.1 decoding failure";
retval = SSH2_WRONG_PASSPHRASE;
goto error;
}
@ -1323,7 +1324,7 @@ struct ssh2_userkey *sshcom_read(const Filename *filename, char *passphrase)
* Strip away the containing string to get to the real meat.
*/
len = GET_32BIT(ciphertext);
if (len > cipherlen-4) {
if (len < 0 || len > cipherlen-4) {
errmsg = "containing string was ill-formed";
goto error;
}