X-Git-Url: https://git.distorted.org.uk/u/mdw/putty/blobdiff_plain/a4f1d55c1d1e4e35e43fb8fe8d13a3b665b6405c..1bb20a3812d8a52f7a7933258c27d810db973803:/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; }