|
Lines 714-726
do_fingerprint(struct passwd *pw)
Link Here
|
| 714 |
{ |
714 |
{ |
| 715 |
FILE *f; |
715 |
FILE *f; |
| 716 |
Key *public; |
716 |
Key *public; |
| 717 |
char *comment = NULL, *cp, *ep, line[16*1024], *fp, *ra; |
717 |
char *comment = NULL, *cp, *ep, line[16*1024], *fp, *ra, *pfx; |
| 718 |
int i, skip = 0, num = 0, invalid = 1; |
718 |
int i, skip = 0, num = 0, invalid = 1; |
| 719 |
enum fp_rep rep; |
719 |
enum fp_rep rep; |
| 720 |
enum fp_type fptype; |
720 |
enum fp_type fptype; |
| 721 |
struct stat st; |
721 |
struct stat st; |
| 722 |
|
722 |
|
| 723 |
fptype = print_bubblebabble ? SSH_FP_SHA1 : SSH_FP_MD5; |
723 |
fptype = print_bubblebabble ? SSH_FP_SHA1 : key_fingerprint_selection(); |
|
|
724 |
pfx = print_bubblebabble ? "" : key_fingerprint_prefix(); |
| 724 |
rep = print_bubblebabble ? SSH_FP_BUBBLEBABBLE : SSH_FP_HEX; |
725 |
rep = print_bubblebabble ? SSH_FP_BUBBLEBABBLE : SSH_FP_HEX; |
| 725 |
|
726 |
|
| 726 |
if (!have_identity) |
727 |
if (!have_identity) |
|
Lines 732-739
do_fingerprint(struct passwd *pw)
Link Here
|
| 732 |
public = key_load_public(identity_file, &comment); |
733 |
public = key_load_public(identity_file, &comment); |
| 733 |
if (public != NULL) { |
734 |
if (public != NULL) { |
| 734 |
fp = key_fingerprint(public, fptype, rep); |
735 |
fp = key_fingerprint(public, fptype, rep); |
| 735 |
ra = key_fingerprint(public, SSH_FP_MD5, SSH_FP_RANDOMART); |
736 |
ra = key_selected_fingerprint(public, SSH_FP_RANDOMART); |
| 736 |
printf("%u %s %s (%s)\n", key_size(public), fp, comment, |
737 |
printf("%u %s%s %s (%s)\n", key_size(public), pfx, fp, comment, |
| 737 |
key_type(public)); |
738 |
key_type(public)); |
| 738 |
if (log_level >= SYSLOG_LEVEL_VERBOSE) |
739 |
if (log_level >= SYSLOG_LEVEL_VERBOSE) |
| 739 |
printf("%s\n", ra); |
740 |
printf("%s\n", ra); |
|
Lines 798-805
do_fingerprint(struct passwd *pw)
Link Here
|
| 798 |
} |
799 |
} |
| 799 |
comment = *cp ? cp : comment; |
800 |
comment = *cp ? cp : comment; |
| 800 |
fp = key_fingerprint(public, fptype, rep); |
801 |
fp = key_fingerprint(public, fptype, rep); |
| 801 |
ra = key_fingerprint(public, SSH_FP_MD5, SSH_FP_RANDOMART); |
802 |
ra = key_selected_fingerprint(public, SSH_FP_RANDOMART); |
| 802 |
printf("%u %s %s (%s)\n", key_size(public), fp, |
803 |
printf("%u %s%s %s (%s)\n", key_size(public), pfx, fp, |
| 803 |
comment ? comment : "no comment", key_type(public)); |
804 |
comment ? comment : "no comment", key_type(public)); |
| 804 |
if (log_level >= SYSLOG_LEVEL_VERBOSE) |
805 |
if (log_level >= SYSLOG_LEVEL_VERBOSE) |
| 805 |
printf("%s\n", ra); |
806 |
printf("%s\n", ra); |
|
Lines 823-835
printhost(FILE *f, const char *name, Key
Link Here
|
| 823 |
if (print_fingerprint) { |
824 |
if (print_fingerprint) { |
| 824 |
enum fp_rep rep; |
825 |
enum fp_rep rep; |
| 825 |
enum fp_type fptype; |
826 |
enum fp_type fptype; |
| 826 |
char *fp, *ra; |
827 |
char *fp, *ra, *pfx; |
| 827 |
|
828 |
|
| 828 |
fptype = print_bubblebabble ? SSH_FP_SHA1 : SSH_FP_MD5; |
829 |
fptype = print_bubblebabble ? SSH_FP_SHA1 : key_fingerprint_selection(); |
|
|
830 |
pfx = print_bubblebabble ? "" : key_fingerprint_prefix(); |
| 829 |
rep = print_bubblebabble ? SSH_FP_BUBBLEBABBLE : SSH_FP_HEX; |
831 |
rep = print_bubblebabble ? SSH_FP_BUBBLEBABBLE : SSH_FP_HEX; |
|
|
832 |
|
| 830 |
fp = key_fingerprint(public, fptype, rep); |
833 |
fp = key_fingerprint(public, fptype, rep); |
| 831 |
ra = key_fingerprint(public, SSH_FP_MD5, SSH_FP_RANDOMART); |
834 |
ra = key_selected_fingerprint(public, SSH_FP_RANDOMART); |
| 832 |
printf("%u %s %s (%s)\n", key_size(public), fp, name, |
835 |
printf("%u %s%s %s (%s)\n", key_size(public), pfx, fp, name, |
| 833 |
key_type(public)); |
836 |
key_type(public)); |
| 834 |
if (log_level >= SYSLOG_LEVEL_VERBOSE) |
837 |
if (log_level >= SYSLOG_LEVEL_VERBOSE) |
| 835 |
printf("%s\n", ra); |
838 |
printf("%s\n", ra); |
|
Lines 1695-1710
do_show_cert(struct passwd *pw)
Link Here
|
| 1695 |
fatal("%s is not a certificate", identity_file); |
1698 |
fatal("%s is not a certificate", identity_file); |
| 1696 |
v00 = key->type == KEY_RSA_CERT_V00 || key->type == KEY_DSA_CERT_V00; |
1699 |
v00 = key->type == KEY_RSA_CERT_V00 || key->type == KEY_DSA_CERT_V00; |
| 1697 |
|
1700 |
|
| 1698 |
key_fp = key_fingerprint(key, SSH_FP_MD5, SSH_FP_HEX); |
1701 |
key_fp = key_selected_fingerprint(key, SSH_FP_HEX); |
| 1699 |
ca_fp = key_fingerprint(key->cert->signature_key, |
1702 |
ca_fp = key_selected_fingerprint(key->cert->signature_key, SSH_FP_HEX); |
| 1700 |
SSH_FP_MD5, SSH_FP_HEX); |
|
|
| 1701 |
|
1703 |
|
| 1702 |
printf("%s:\n", identity_file); |
1704 |
printf("%s:\n", identity_file); |
| 1703 |
printf(" Type: %s %s certificate\n", key_ssh_name(key), |
1705 |
printf(" Type: %s %s certificate\n", key_ssh_name(key), |
| 1704 |
key_cert_type(key)); |
1706 |
key_cert_type(key)); |
| 1705 |
printf(" Public key: %s %s\n", key_type(key), key_fp); |
1707 |
printf(" Public key: %s %s%s\n", key_type(key), |
| 1706 |
printf(" Signing CA: %s %s\n", |
1708 |
key_fingerprint_prefix(), key_fp); |
| 1707 |
key_type(key->cert->signature_key), ca_fp); |
1709 |
printf(" Signing CA: %s %s%s\n", |
|
|
1710 |
key_type(key->cert->signature_key), |
| 1711 |
key_fingerprint_prefix(), ca_fp); |
| 1708 |
printf(" Key ID: \"%s\"\n", key->cert->key_id); |
1712 |
printf(" Key ID: \"%s\"\n", key->cert->key_id); |
| 1709 |
if (!v00) { |
1713 |
if (!v00) { |
| 1710 |
printf(" Serial: %llu\n", |
1714 |
printf(" Serial: %llu\n", |
|
Lines 2249-2261
passphrase_again:
Link Here
|
| 2249 |
fclose(f); |
2253 |
fclose(f); |
| 2250 |
|
2254 |
|
| 2251 |
if (!quiet) { |
2255 |
if (!quiet) { |
| 2252 |
char *fp = key_fingerprint(public, SSH_FP_MD5, SSH_FP_HEX); |
2256 |
char *fp = key_selected_fingerprint(public, SSH_FP_HEX); |
| 2253 |
char *ra = key_fingerprint(public, SSH_FP_MD5, |
2257 |
char *ra = key_selected_fingerprint(public, SSH_FP_RANDOMART); |
| 2254 |
SSH_FP_RANDOMART); |
|
|
| 2255 |
printf("Your public key has been saved in %s.\n", |
2258 |
printf("Your public key has been saved in %s.\n", |
| 2256 |
identity_file); |
2259 |
identity_file); |
| 2257 |
printf("The key fingerprint is:\n"); |
2260 |
printf("The key fingerprint is:\n"); |
| 2258 |
printf("%s %s\n", fp, comment); |
2261 |
printf("%s%s %s\n", key_fingerprint_prefix(), fp, comment); |
| 2259 |
printf("The key's randomart image is:\n"); |
2262 |
printf("The key's randomart image is:\n"); |
| 2260 |
printf("%s\n", ra); |
2263 |
printf("%s\n", ra); |
| 2261 |
xfree(ra); |
2264 |
xfree(ra); |