version 1.166, 2008/05/19 15:46:31 |
version 1.167, 2008/06/11 21:01:35 |
|
|
{ |
{ |
FILE *f; |
FILE *f; |
Key *public; |
Key *public; |
char *comment = NULL, *cp, *ep, line[16*1024], *fp; |
char *comment = NULL, *cp, *ep, line[16*1024], *fp, *ra; |
int i, skip = 0, num = 0, invalid = 1; |
int i, skip = 0, num = 0, invalid = 1; |
enum fp_rep rep; |
enum fp_rep rep; |
enum fp_type fptype; |
enum fp_type fptype; |
|
|
public = key_load_public(identity_file, &comment); |
public = key_load_public(identity_file, &comment); |
if (public != NULL) { |
if (public != NULL) { |
fp = key_fingerprint(public, fptype, rep); |
fp = key_fingerprint(public, fptype, rep); |
|
ra = key_fingerprint(public, fptype, rep); |
printf("%u %s %s\n", key_size(public), fp, comment); |
printf("%u %s %s\n", key_size(public), fp, comment); |
|
verbose("%s\n", ra); |
key_free(public); |
key_free(public); |
xfree(comment); |
xfree(comment); |
|
xfree(ra); |
xfree(fp); |
xfree(fp); |
exit(0); |
exit(0); |
} |
} |
|
|
} |
} |
comment = *cp ? cp : comment; |
comment = *cp ? cp : comment; |
fp = key_fingerprint(public, fptype, rep); |
fp = key_fingerprint(public, fptype, rep); |
|
ra = key_fingerprint(public, fptype, SSH_FP_RANDOMART); |
printf("%u %s %s\n", key_size(public), fp, |
printf("%u %s %s\n", key_size(public), fp, |
comment ? comment : "no comment"); |
comment ? comment : "no comment"); |
|
verbose("%s\n", ra); |
|
xfree(ra); |
xfree(fp); |
xfree(fp); |
key_free(public); |
key_free(public); |
invalid = 0; |
invalid = 0; |
|
|
if (print_fingerprint) { |
if (print_fingerprint) { |
enum fp_rep rep; |
enum fp_rep rep; |
enum fp_type fptype; |
enum fp_type fptype; |
char *fp; |
char *fp, *ra; |
|
|
fptype = print_bubblebabble ? SSH_FP_SHA1 : SSH_FP_MD5; |
fptype = print_bubblebabble ? SSH_FP_SHA1 : SSH_FP_MD5; |
rep = print_bubblebabble ? SSH_FP_BUBBLEBABBLE : SSH_FP_HEX; |
rep = print_bubblebabble ? SSH_FP_BUBBLEBABBLE : SSH_FP_HEX; |
fp = key_fingerprint(public, fptype, rep); |
fp = key_fingerprint(public, fptype, rep); |
printf("%u %s %s\n", key_size(public), fp, name); |
ra = key_fingerprint(public, fptype, SSH_FP_RANDOMART); |
|
printf("%u %s %s\n%s\n", key_size(public), fp, name, ra); |
|
xfree(ra); |
xfree(fp); |
xfree(fp); |
} else { |
} else { |
if (hash && (name = host_hash(name, NULL, 0)) == NULL) |
if (hash && (name = host_hash(name, NULL, 0)) == NULL) |
|
|
|
|
if (!quiet) { |
if (!quiet) { |
char *fp = key_fingerprint(public, SSH_FP_MD5, SSH_FP_HEX); |
char *fp = key_fingerprint(public, SSH_FP_MD5, SSH_FP_HEX); |
|
char *ra = key_fingerprint(public, SSH_FP_MD5, |
|
SSH_FP_RANDOMART); |
printf("Your public key has been saved in %s.\n", |
printf("Your public key has been saved in %s.\n", |
identity_file); |
identity_file); |
printf("The key fingerprint is:\n"); |
printf("The key fingerprint is:\n"); |
printf("%s %s\n", fp, comment); |
printf("%s %s\n", fp, comment); |
|
printf("The key's randomart image is:\n"); |
|
printf("%s\n", ra); |
|
xfree(ra); |
xfree(fp); |
xfree(fp); |
} |
} |
|
|