version 1.165, 2008/01/19 22:37:19 |
version 1.166, 2008/05/19 15:46:31 |
|
|
static void |
static void |
print_host(FILE *f, const char *name, Key *public, int hash) |
print_host(FILE *f, const char *name, Key *public, int hash) |
{ |
{ |
if (hash && (name = host_hash(name, NULL, 0)) == NULL) |
if (print_fingerprint) { |
fatal("hash_host failed"); |
enum fp_rep rep; |
fprintf(f, "%s ", name); |
enum fp_type fptype; |
if (!key_write(public, f)) |
char *fp; |
fatal("key_write failed"); |
|
fprintf(f, "\n"); |
fptype = print_bubblebabble ? SSH_FP_SHA1 : SSH_FP_MD5; |
|
rep = print_bubblebabble ? SSH_FP_BUBBLEBABBLE : SSH_FP_HEX; |
|
fp = key_fingerprint(public, fptype, rep); |
|
printf("%u %s %s\n", key_size(public), fp, name); |
|
xfree(fp); |
|
} else { |
|
if (hash && (name = host_hash(name, NULL, 0)) == NULL) |
|
fatal("hash_host failed"); |
|
fprintf(f, "%s ", name); |
|
if (!key_write(public, f)) |
|
fatal("key_write failed"); |
|
fprintf(f, "\n"); |
|
} |
} |
} |
|
|
static void |
static void |
|
|
} |
} |
if (change_passphrase && change_comment) { |
if (change_passphrase && change_comment) { |
printf("Can only have one of -p and -c.\n"); |
printf("Can only have one of -p and -c.\n"); |
|
usage(); |
|
} |
|
if (print_fingerprint && (delete_host || hash_hosts)) { |
|
printf("Cannot use -l with -D or -R.\n"); |
usage(); |
usage(); |
} |
} |
if (delete_host || hash_hosts || find_host) |
if (delete_host || hash_hosts || find_host) |