version 1.405, 2020/04/03 02:26:56 |
version 1.406, 2020/04/17 07:16:07 |
|
|
{ |
{ |
struct stat st; |
struct stat st; |
char *comment = NULL; |
char *comment = NULL; |
struct sshkey *public = NULL; |
struct sshkey *key = NULL; |
int r; |
int r; |
|
|
if (stat(identity_file, &st) == -1) |
if (stat(identity_file, &st) == -1) |
fatal("%s: %s", path, strerror(errno)); |
fatal("%s: %s", path, strerror(errno)); |
if ((r = sshkey_load_public(path, &public, &comment)) != 0) { |
if ((r = sshkey_load_private(path, NULL, &key, &comment)) != 0) { |
debug("load public \"%s\": %s", path, ssh_err(r)); |
debug("load private \"%s\": %s", path, ssh_err(r)); |
if ((r = sshkey_load_private(path, NULL, |
if ((r = sshkey_load_public(path, &key, &comment)) != 0) { |
&public, &comment)) != 0) { |
debug("load public \"%s\": %s", path, ssh_err(r)); |
debug("load private \"%s\": %s", path, ssh_err(r)); |
|
fatal("%s is not a key file.", path); |
fatal("%s is not a key file.", path); |
} |
} |
} |
} |
|
|
fingerprint_one_key(public, comment); |
fingerprint_one_key(key, comment); |
sshkey_free(public); |
sshkey_free(key); |
free(comment); |
free(comment); |
} |
} |
|
|