diff options
author | Ben Lindstrom <mouring@eviladmin.org> | 2001-03-11 20:05:19 +0000 |
---|---|---|
committer | Ben Lindstrom <mouring@eviladmin.org> | 2001-03-11 20:05:19 +0000 |
commit | a8a73e62eda1c81e04c11099e0c0155164486992 (patch) | |
tree | a76d82059f2eefc8e17c47c5305648509e070cee | |
parent | 96e8ea6a31184e2ea46bc655f912bc67b6221e64 (diff) |
- jakob@cvs.openbsd.org 2001/03/11 15:04:16
[ssh-keygen.1 ssh-keygen.c]
print both md5, sha1 and bubblebabble fingerprints when using
ssh-keygen -l -v. ok markus@.
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | ssh-keygen.1 | 5 | ||||
-rw-r--r-- | ssh-keygen.c | 30 |
3 files changed, 36 insertions, 5 deletions
@@ -7,6 +7,10 @@ | |||
7 | [key.c key.h] | 7 | [key.c key.h] |
8 | add improved fingerprint functions. based on work by Carsten | 8 | add improved fingerprint functions. based on work by Carsten |
9 | Raskgaard <cara@int.tele.dk> and modified by me. ok markus@. | 9 | Raskgaard <cara@int.tele.dk> and modified by me. ok markus@. |
10 | - jakob@cvs.openbsd.org 2001/03/11 15:04:16 | ||
11 | [ssh-keygen.1 ssh-keygen.c] | ||
12 | print both md5, sha1 and bubblebabble fingerprints when using | ||
13 | ssh-keygen -l -v. ok markus@. | ||
10 | 14 | ||
11 | 20010311 | 15 | 20010311 |
12 | - OpenBSD CVS Sync | 16 | - OpenBSD CVS Sync |
@@ -4500,4 +4504,4 @@ | |||
4500 | - Wrote replacements for strlcpy and mkdtemp | 4504 | - Wrote replacements for strlcpy and mkdtemp |
4501 | - Released 1.0pre1 | 4505 | - Released 1.0pre1 |
4502 | 4506 | ||
4503 | $Id: ChangeLog,v 1.941 2001/03/11 20:03:44 mouring Exp $ | 4507 | $Id: ChangeLog,v 1.942 2001/03/11 20:05:19 mouring Exp $ |
diff --git a/ssh-keygen.1 b/ssh-keygen.1 index 70310ed30..d6ad33d6a 100644 --- a/ssh-keygen.1 +++ b/ssh-keygen.1 | |||
@@ -1,4 +1,4 @@ | |||
1 | .\" $OpenBSD: ssh-keygen.1,v 1.33 2001/03/02 18:54:31 deraadt Exp $ | 1 | .\" $OpenBSD: ssh-keygen.1,v 1.34 2001/03/11 15:04:16 jakob Exp $ |
2 | .\" | 2 | .\" |
3 | .\" -*- nroff -*- | 3 | .\" -*- nroff -*- |
4 | .\" | 4 | .\" |
@@ -72,6 +72,7 @@ | |||
72 | .Op Fl f Ar keyfile | 72 | .Op Fl f Ar keyfile |
73 | .Nm ssh-keygen | 73 | .Nm ssh-keygen |
74 | .Fl l | 74 | .Fl l |
75 | .Op Fl v | ||
75 | .Op Fl f Ar input_keyfile | 76 | .Op Fl f Ar input_keyfile |
76 | .Sh DESCRIPTION | 77 | .Sh DESCRIPTION |
77 | .Nm | 78 | .Nm |
@@ -172,6 +173,8 @@ Provides the new comment. | |||
172 | Provides the new passphrase. | 173 | Provides the new passphrase. |
173 | .It Fl P Ar passphrase | 174 | .It Fl P Ar passphrase |
174 | Provides the (old) passphrase. | 175 | Provides the (old) passphrase. |
176 | .It Fl v | ||
177 | Print verbose information. | ||
175 | .It Fl x | 178 | .It Fl x |
176 | This option will read a private | 179 | This option will read a private |
177 | OpenSSH DSA format file and print a SSH2-compatible public key to stdout. | 180 | OpenSSH DSA format file and print a SSH2-compatible public key to stdout. |
diff --git a/ssh-keygen.c b/ssh-keygen.c index dbb46ac90..af59bcf6e 100644 --- a/ssh-keygen.c +++ b/ssh-keygen.c | |||
@@ -12,7 +12,7 @@ | |||
12 | */ | 12 | */ |
13 | 13 | ||
14 | #include "includes.h" | 14 | #include "includes.h" |
15 | RCSID("$OpenBSD: ssh-keygen.c,v 1.46 2001/03/09 03:14:39 deraadt Exp $"); | 15 | RCSID("$OpenBSD: ssh-keygen.c,v 1.47 2001/03/11 15:04:16 jakob Exp $"); |
16 | 16 | ||
17 | #include <openssl/evp.h> | 17 | #include <openssl/evp.h> |
18 | #include <openssl/pem.h> | 18 | #include <openssl/pem.h> |
@@ -64,6 +64,7 @@ char *identity_comment = NULL; | |||
64 | int convert_to_ssh2 = 0; | 64 | int convert_to_ssh2 = 0; |
65 | int convert_from_ssh2 = 0; | 65 | int convert_from_ssh2 = 0; |
66 | int print_public = 0; | 66 | int print_public = 0; |
67 | int print_verbose = 0; | ||
67 | 68 | ||
68 | /* default to RSA for SSH-1 */ | 69 | /* default to RSA for SSH-1 */ |
69 | char *key_type_name = "rsa1"; | 70 | char *key_type_name = "rsa1"; |
@@ -350,9 +351,28 @@ do_fingerprint(struct passwd *pw) | |||
350 | debug("try_load_public_key KEY_UNSPEC failed"); | 351 | debug("try_load_public_key KEY_UNSPEC failed"); |
351 | } | 352 | } |
352 | if (success) { | 353 | if (success) { |
353 | printf("%d %s %s\n", key_size(public), key_fingerprint(public), comment); | 354 | char *digest_md5, *digest_sha1, *digest_bubblebabble; |
355 | |||
356 | digest_md5 = key_fingerprint_ex(public, SSH_FP_MD5, SSH_FP_HEX); | ||
357 | digest_sha1 = key_fingerprint_ex(public, SSH_FP_SHA1, SSH_FP_HEX); | ||
358 | digest_bubblebabble = key_fingerprint_ex(public, SSH_FP_SHA1, SSH_FP_BUBBLEBABBLE); | ||
359 | |||
360 | if(print_verbose) { | ||
361 | printf("comment: %s\n", comment); | ||
362 | printf("size: %d\n", key_size(public)); | ||
363 | printf("md5: %s\n", digest_md5); | ||
364 | printf("sha1: %s\n", digest_sha1); | ||
365 | printf("bubblebabble: %s\n", digest_bubblebabble); | ||
366 | } else { | ||
367 | printf("%d %s %s\n", key_size(public), digest_md5, comment); | ||
368 | } | ||
369 | |||
354 | key_free(public); | 370 | key_free(public); |
355 | xfree(comment); | 371 | xfree(comment); |
372 | xfree(digest_md5); | ||
373 | xfree(digest_sha1); | ||
374 | xfree(digest_bubblebabble); | ||
375 | |||
356 | exit(0); | 376 | exit(0); |
357 | } | 377 | } |
358 | 378 | ||
@@ -646,7 +666,7 @@ main(int ac, char **av) | |||
646 | exit(1); | 666 | exit(1); |
647 | } | 667 | } |
648 | 668 | ||
649 | while ((opt = getopt(ac, av, "dqpclRxXyb:f:t:P:N:C:")) != -1) { | 669 | while ((opt = getopt(ac, av, "dqpclRxXyvb:f:t:P:N:C:")) != -1) { |
650 | switch (opt) { | 670 | switch (opt) { |
651 | case 'b': | 671 | case 'b': |
652 | bits = atoi(optarg); | 672 | bits = atoi(optarg); |
@@ -706,6 +726,10 @@ main(int ac, char **av) | |||
706 | print_public = 1; | 726 | print_public = 1; |
707 | break; | 727 | break; |
708 | 728 | ||
729 | case 'v': | ||
730 | print_verbose = 1; | ||
731 | break; | ||
732 | |||
709 | case 'd': | 733 | case 'd': |
710 | key_type_name = "dsa"; | 734 | key_type_name = "dsa"; |
711 | break; | 735 | break; |