X-Git-Url: https://git.distorted.org.uk/u/mdw/putty/blobdiff_plain/224f397a29e27bc74af85762428fd0c38da4aa5e..f668fdf37d5b25f354c8541c1c6dda7c74cb6444:/import.c diff --git a/import.c b/import.c index c43eca40..d1ab7511 100644 --- a/import.c +++ b/import.c @@ -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; }