X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=blobdiff_plain;f=unix%2Fuxpgnt.c;h=50f6516860370cef6b8f14639b34a0275368800c;hb=1266ac0e304b4e4db809eb045b8ac5dc43f299c4;hp=a4bc6b9389b0ff09e7b7bc7fdcc5dc9fa3ebf087;hpb=54720b2c5a36648864d7bfc6547ef86168db1865;p=PuTTY.git diff --git a/unix/uxpgnt.c b/unix/uxpgnt.c index a4bc6b93..50f65168 100644 --- a/unix/uxpgnt.c +++ b/unix/uxpgnt.c @@ -543,19 +543,19 @@ struct pageant_pubkey *find_key(const char *string, char **retstr) filename_free(fn); return NULL; } + } else { + /* + * If we've successfully loaded the file, stop here - we + * already have a key blob and need not go to the agent to + * list things. + */ + key_in.ssh_version = 1; + key_in.comment = NULL; + key_ret = pageant_pubkey_copy(&key_in); + sfree(key_in.blob); + filename_free(fn); + return key_ret; } - - /* - * If we've successfully loaded the file, stop here - we - * already have a key blob and need not go to the agent to - * list things. - */ - key_in.ssh_version = 1; - key_in.comment = NULL; - key_ret = pageant_pubkey_copy(&key_in); - sfree(key_in.blob); - filename_free(fn); - return key_ret; } else if (keytype == SSH_KEYTYPE_SSH2 || keytype == SSH_KEYTYPE_SSH2_PUBLIC_RFC4716 || keytype == SSH_KEYTYPE_SSH2_PUBLIC_OPENSSH) { @@ -570,19 +570,19 @@ struct pageant_pubkey *find_key(const char *string, char **retstr) filename_free(fn); return NULL; } + } else { + /* + * If we've successfully loaded the file, stop here - we + * already have a key blob and need not go to the agent to + * list things. + */ + key_in.ssh_version = 2; + key_in.comment = NULL; + key_ret = pageant_pubkey_copy(&key_in); + sfree(key_in.blob); + filename_free(fn); + return key_ret; } - - /* - * If we've successfully loaded the file, stop here - we - * already have a key blob and need not go to the agent to - * list things. - */ - key_in.ssh_version = 2; - key_in.comment = NULL; - key_ret = pageant_pubkey_copy(&key_in); - sfree(key_in.blob); - filename_free(fn); - return key_ret; } else { if (file_errors) { *retstr = dupprintf("unable to load key file '%s': %s",