mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-04-17 19:18:06 -05:00
When loading SSH-2 key, ignore passphrase argument if key is unencrypted.
This should get rid of a problem that three or four people reported where PuTTY intermittently reports "Unable to load private key" (MAC failed). (ssh.c:do_ssh2_authconn() should also initialise its passphrase so it's not passing garbage passphrases around, of course, but I haven't yet worked out where the best place in the auth loop to do that would be.) [originally from svn r3439]
This commit is contained in:
parent
f6835045f8
commit
15ac9c09eb
@ -784,7 +784,7 @@ struct ssh2_userkey *ssh2_load_userkey(const Filename *filename,
|
|||||||
|
|
||||||
SHA_Init(&s);
|
SHA_Init(&s);
|
||||||
SHA_Bytes(&s, header, sizeof(header)-1);
|
SHA_Bytes(&s, header, sizeof(header)-1);
|
||||||
if (passphrase)
|
if (cipher && passphrase)
|
||||||
SHA_Bytes(&s, passphrase, passlen);
|
SHA_Bytes(&s, passphrase, passlen);
|
||||||
SHA_Final(&s, mackey);
|
SHA_Final(&s, mackey);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user