mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-07-01 11:32:48 -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:
@ -537,8 +537,8 @@ struct pageant_pubkey *find_key(const char *string, char **retstr)
|
||||
const char *error;
|
||||
|
||||
key_in.blob = strbuf_new();
|
||||
if (!rsa_ssh1_loadpub(fn, BinarySink_UPCAST(key_in.blob),
|
||||
NULL, &error)) {
|
||||
if (!rsa1_loadpub_f(fn, BinarySink_UPCAST(key_in.blob),
|
||||
NULL, &error)) {
|
||||
strbuf_free(key_in.blob);
|
||||
key_in.blob = NULL;
|
||||
if (file_errors) {
|
||||
@ -567,8 +567,8 @@ struct pageant_pubkey *find_key(const char *string, char **retstr)
|
||||
const char *error;
|
||||
|
||||
key_in.blob = strbuf_new();
|
||||
if (!ssh2_userkey_loadpub(fn, NULL, BinarySink_UPCAST(key_in.blob),
|
||||
NULL, &error)) {
|
||||
if (!ppk_loadpub_f(fn, NULL, BinarySink_UPCAST(key_in.blob),
|
||||
NULL, &error)) {
|
||||
strbuf_free(key_in.blob);
|
||||
key_in.blob = NULL;
|
||||
if (file_errors) {
|
||||
|
@ -581,7 +581,7 @@ int main(int argc, char **argv)
|
||||
if (keytype == SSH_KEYTYPE_SSH2) {
|
||||
ssh2_userkey *uk;
|
||||
ssh_key *key;
|
||||
uk = ssh2_load_userkey(keyfile, NULL, &error);
|
||||
uk = ppk_load_f(keyfile, NULL, &error);
|
||||
filename_free(keyfile);
|
||||
if (!uk || !uk->key) {
|
||||
fprintf(stderr, "%s: unable to load host key '%s': "
|
||||
@ -615,7 +615,7 @@ int main(int argc, char **argv)
|
||||
exit(1);
|
||||
}
|
||||
hostkey1 = snew(RSAKey);
|
||||
if (!rsa_ssh1_loadkey(keyfile, hostkey1, NULL, &error)) {
|
||||
if (!rsa1_load_f(keyfile, hostkey1, NULL, &error)) {
|
||||
fprintf(stderr, "%s: unable to load host key '%s': "
|
||||
"%s\n", appname, val, error);
|
||||
exit(1);
|
||||
@ -647,8 +647,7 @@ int main(int argc, char **argv)
|
||||
ssc.rsa_kex_key = snew(RSAKey);
|
||||
}
|
||||
|
||||
if (!rsa_ssh1_loadkey(keyfile, ssc.rsa_kex_key,
|
||||
NULL, &error)) {
|
||||
if (!rsa1_load_f(keyfile, ssc.rsa_kex_key, NULL, &error)) {
|
||||
fprintf(stderr, "%s: unable to load RSA kex key '%s': "
|
||||
"%s\n", appname, val, error);
|
||||
exit(1);
|
||||
@ -669,8 +668,8 @@ int main(int argc, char **argv)
|
||||
struct AuthPolicy_ssh2_pubkey *node;
|
||||
void *blob;
|
||||
|
||||
if (!ssh2_userkey_loadpub(keyfile, NULL, BinarySink_UPCAST(sb),
|
||||
NULL, &error)) {
|
||||
if (!ppk_loadpub_f(keyfile, NULL, BinarySink_UPCAST(sb),
|
||||
NULL, &error)) {
|
||||
fprintf(stderr, "%s: unable to load user key '%s': "
|
||||
"%s\n", appname, val, error);
|
||||
exit(1);
|
||||
@ -690,8 +689,8 @@ int main(int argc, char **argv)
|
||||
BinarySource src[1];
|
||||
struct AuthPolicy_ssh1_pubkey *node;
|
||||
|
||||
if (!rsa_ssh1_loadpub(keyfile, BinarySink_UPCAST(sb),
|
||||
NULL, &error)) {
|
||||
if (!rsa1_loadpub_f(keyfile, BinarySink_UPCAST(sb),
|
||||
NULL, &error)) {
|
||||
fprintf(stderr, "%s: unable to load user key '%s': "
|
||||
"%s\n", appname, val, error);
|
||||
exit(1);
|
||||
|
Reference in New Issue
Block a user