mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-07-09 23:33:46 -05:00
Rename all public/private key load/save functions.
Now they have names that are more consistent (no more userkey_this but that_userkey); a bit shorter; and, most importantly, all the current functions end in _f to indicate that they deal with keys stored in disk files. I'm about to add a second set of entry points that deal with keys via the more general BinarySource / BinarySink interface, which will sit alongside these with a different suffix.
This commit is contained in:
13
ssh1login.c
13
ssh1login.c
@ -451,13 +451,13 @@ static void ssh1_login_process_queue(PacketProtocolLayer *ppl)
|
||||
keytype == SSH_KEYTYPE_SSH1_PUBLIC) {
|
||||
const char *error;
|
||||
s->publickey_blob = strbuf_new();
|
||||
if (rsa_ssh1_loadpub(s->keyfile,
|
||||
BinarySink_UPCAST(s->publickey_blob),
|
||||
&s->publickey_comment, &error)) {
|
||||
if (rsa1_loadpub_f(s->keyfile,
|
||||
BinarySink_UPCAST(s->publickey_blob),
|
||||
&s->publickey_comment, &error)) {
|
||||
s->privatekey_available = (keytype == SSH_KEYTYPE_SSH1);
|
||||
if (!s->privatekey_available)
|
||||
ppl_logevent("Key file contains public key only");
|
||||
s->privatekey_encrypted = rsa_ssh1_encrypted(s->keyfile, NULL);
|
||||
s->privatekey_encrypted = rsa1_encrypted_f(s->keyfile, NULL);
|
||||
} else {
|
||||
ppl_logevent("Unable to load key (%s)", error);
|
||||
ppl_printf("Unable to load key file \"%s\" (%s)\r\n",
|
||||
@ -683,8 +683,7 @@ static void ssh1_login_process_queue(PacketProtocolLayer *ppl)
|
||||
/*
|
||||
* Try decrypting key with passphrase.
|
||||
*/
|
||||
retd = rsa_ssh1_loadkey(
|
||||
s->keyfile, &s->key, passphrase, &error);
|
||||
retd = rsa1_load_f(s->keyfile, &s->key, passphrase, &error);
|
||||
if (passphrase) {
|
||||
smemclr(passphrase, strlen(passphrase));
|
||||
sfree(passphrase);
|
||||
@ -702,7 +701,7 @@ static void ssh1_login_process_queue(PacketProtocolLayer *ppl)
|
||||
got_passphrase = false;
|
||||
/* and try again */
|
||||
} else {
|
||||
unreachable("unexpected return from rsa_ssh1_loadkey()");
|
||||
unreachable("unexpected return from rsa1_load_f()");
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user