version 1.16.2.3, 2001/03/12 15:44:15 |
version 1.16.2.4, 2001/03/21 18:53:08 |
|
|
* called by a name other than "ssh" or "Secure Shell". |
* called by a name other than "ssh" or "Secure Shell". |
* |
* |
* SSH2 implementation, |
* SSH2 implementation, |
* Copyright (c) 2000 Markus Friedl. All rights reserved. |
* Copyright (c) 2000 Markus Friedl. All rights reserved. |
* |
* |
* Redistribution and use in source and binary forms, with or without |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* modification, are permitted provided that the following conditions |
|
|
} |
} |
|
|
void |
void |
list_identities(AuthenticationConnection *ac, int fp) |
list_identities(AuthenticationConnection *ac, int do_fp) |
{ |
{ |
Key *key; |
Key *key; |
char *comment; |
char *comment, *fp; |
int had_identities = 0; |
int had_identities = 0; |
int version; |
int version; |
|
|
|
|
key != NULL; |
key != NULL; |
key = ssh_get_next_identity(ac, &comment, version)) { |
key = ssh_get_next_identity(ac, &comment, version)) { |
had_identities = 1; |
had_identities = 1; |
if (fp) { |
if (do_fp) { |
|
fp = key_fingerprint(key, SSH_FP_MD5, |
|
SSH_FP_HEX); |
printf("%d %s %s (%s)\n", |
printf("%d %s %s (%s)\n", |
key_size(key), key_fingerprint(key), |
key_size(key), fp, comment, key_type(key)); |
comment, key_type(key)); |
xfree(fp); |
} else { |
} else { |
if (!key_write(key, stdout)) |
if (!key_write(key, stdout)) |
fprintf(stderr, "key_write failed"); |
fprintf(stderr, "key_write failed"); |