1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-07-01 03:22:48 -05:00

Clean up the crufty old SSH-1 RSA API.

Lots of functions had really generic names (like 'makekey'), or names
that missed out an important concept (like 'rsakey_pubblob', which
loads a public blob from a _file_ and doesn't generate it from an
in-memory representation at all). Also, the opaque 'int order' that
distinguishes the two formats of public key blob is now a mnemonic
enumeration, and while I'm at it, rsa_ssh1_public_blob takes one of
those as an extra argument.
This commit is contained in:
Simon Tatham
2018-05-24 08:22:44 +01:00
parent 1a02274272
commit 7e8ae41a3f
8 changed files with 109 additions and 89 deletions

View File

@ -671,7 +671,7 @@ void load_key_file(HWND hwnd, struct MainDlgState *state,
comment = NULL;
passphrase = NULL;
if (realtype == SSH_KEYTYPE_SSH1)
needs_pass = rsakey_encrypted(filename, &comment);
needs_pass = rsa_ssh1_encrypted(filename, &comment);
else if (realtype == SSH_KEYTYPE_SSH2)
needs_pass = ssh2_userkey_encrypted(filename, &comment);
else
@ -698,7 +698,8 @@ void load_key_file(HWND hwnd, struct MainDlgState *state,
passphrase = dupstr("");
if (type == SSH_KEYTYPE_SSH1) {
if (realtype == type)
ret = loadrsakey(filename, &newkey1, passphrase, &errmsg);
ret = rsa_ssh1_loadkey(
filename, &newkey1, passphrase, &errmsg);
else
ret = import_ssh1(filename, realtype, &newkey1,
passphrase, &errmsg);
@ -1279,8 +1280,9 @@ static INT_PTR CALLBACK MainDlgProc(HWND hwnd, UINT msg,
ret = export_ssh1(fn, type, &state->key,
*passphrase ? passphrase : NULL);
else
ret = saversakey(fn, &state->key,
*passphrase ? passphrase : NULL);
ret = rsa_ssh1_savekey(
fn, &state->key,
*passphrase ? passphrase : NULL);
filename_free(fn);
}
if (ret <= 0) {