mirror of
https://github.com/PowerShell/openssh-portable.git
synced 2025-07-27 15:54:22 +02:00
- 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@.
This commit is contained in:
parent
96e8ea6a31
commit
a8a73e62ed
@ -7,6 +7,10 @@
|
|||||||
[key.c key.h]
|
[key.c key.h]
|
||||||
add improved fingerprint functions. based on work by Carsten
|
add improved fingerprint functions. based on work by Carsten
|
||||||
Raskgaard <cara@int.tele.dk> and modified by me. ok markus@.
|
Raskgaard <cara@int.tele.dk> and modified by me. ok markus@.
|
||||||
|
- 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@.
|
||||||
|
|
||||||
20010311
|
20010311
|
||||||
- OpenBSD CVS Sync
|
- OpenBSD CVS Sync
|
||||||
@ -4500,4 +4504,4 @@
|
|||||||
- Wrote replacements for strlcpy and mkdtemp
|
- Wrote replacements for strlcpy and mkdtemp
|
||||||
- Released 1.0pre1
|
- Released 1.0pre1
|
||||||
|
|
||||||
$Id: ChangeLog,v 1.941 2001/03/11 20:03:44 mouring Exp $
|
$Id: ChangeLog,v 1.942 2001/03/11 20:05:19 mouring Exp $
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
.\" $OpenBSD: ssh-keygen.1,v 1.33 2001/03/02 18:54:31 deraadt Exp $
|
.\" $OpenBSD: ssh-keygen.1,v 1.34 2001/03/11 15:04:16 jakob Exp $
|
||||||
.\"
|
.\"
|
||||||
.\" -*- nroff -*-
|
.\" -*- nroff -*-
|
||||||
.\"
|
.\"
|
||||||
@ -72,6 +72,7 @@
|
|||||||
.Op Fl f Ar keyfile
|
.Op Fl f Ar keyfile
|
||||||
.Nm ssh-keygen
|
.Nm ssh-keygen
|
||||||
.Fl l
|
.Fl l
|
||||||
|
.Op Fl v
|
||||||
.Op Fl f Ar input_keyfile
|
.Op Fl f Ar input_keyfile
|
||||||
.Sh DESCRIPTION
|
.Sh DESCRIPTION
|
||||||
.Nm
|
.Nm
|
||||||
@ -172,6 +173,8 @@ Provides the new comment.
|
|||||||
Provides the new passphrase.
|
Provides the new passphrase.
|
||||||
.It Fl P Ar passphrase
|
.It Fl P Ar passphrase
|
||||||
Provides the (old) passphrase.
|
Provides the (old) passphrase.
|
||||||
|
.It Fl v
|
||||||
|
Print verbose information.
|
||||||
.It Fl x
|
.It Fl x
|
||||||
This option will read a private
|
This option will read a private
|
||||||
OpenSSH DSA format file and print a SSH2-compatible public key to stdout.
|
OpenSSH DSA format file and print a SSH2-compatible public key to stdout.
|
||||||
|
30
ssh-keygen.c
30
ssh-keygen.c
@ -12,7 +12,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include "includes.h"
|
#include "includes.h"
|
||||||
RCSID("$OpenBSD: ssh-keygen.c,v 1.46 2001/03/09 03:14:39 deraadt Exp $");
|
RCSID("$OpenBSD: ssh-keygen.c,v 1.47 2001/03/11 15:04:16 jakob Exp $");
|
||||||
|
|
||||||
#include <openssl/evp.h>
|
#include <openssl/evp.h>
|
||||||
#include <openssl/pem.h>
|
#include <openssl/pem.h>
|
||||||
@ -64,6 +64,7 @@ char *identity_comment = NULL;
|
|||||||
int convert_to_ssh2 = 0;
|
int convert_to_ssh2 = 0;
|
||||||
int convert_from_ssh2 = 0;
|
int convert_from_ssh2 = 0;
|
||||||
int print_public = 0;
|
int print_public = 0;
|
||||||
|
int print_verbose = 0;
|
||||||
|
|
||||||
/* default to RSA for SSH-1 */
|
/* default to RSA for SSH-1 */
|
||||||
char *key_type_name = "rsa1";
|
char *key_type_name = "rsa1";
|
||||||
@ -350,9 +351,28 @@ do_fingerprint(struct passwd *pw)
|
|||||||
debug("try_load_public_key KEY_UNSPEC failed");
|
debug("try_load_public_key KEY_UNSPEC failed");
|
||||||
}
|
}
|
||||||
if (success) {
|
if (success) {
|
||||||
printf("%d %s %s\n", key_size(public), key_fingerprint(public), comment);
|
char *digest_md5, *digest_sha1, *digest_bubblebabble;
|
||||||
|
|
||||||
|
digest_md5 = key_fingerprint_ex(public, SSH_FP_MD5, SSH_FP_HEX);
|
||||||
|
digest_sha1 = key_fingerprint_ex(public, SSH_FP_SHA1, SSH_FP_HEX);
|
||||||
|
digest_bubblebabble = key_fingerprint_ex(public, SSH_FP_SHA1, SSH_FP_BUBBLEBABBLE);
|
||||||
|
|
||||||
|
if(print_verbose) {
|
||||||
|
printf("comment: %s\n", comment);
|
||||||
|
printf("size: %d\n", key_size(public));
|
||||||
|
printf("md5: %s\n", digest_md5);
|
||||||
|
printf("sha1: %s\n", digest_sha1);
|
||||||
|
printf("bubblebabble: %s\n", digest_bubblebabble);
|
||||||
|
} else {
|
||||||
|
printf("%d %s %s\n", key_size(public), digest_md5, comment);
|
||||||
|
}
|
||||||
|
|
||||||
key_free(public);
|
key_free(public);
|
||||||
xfree(comment);
|
xfree(comment);
|
||||||
|
xfree(digest_md5);
|
||||||
|
xfree(digest_sha1);
|
||||||
|
xfree(digest_bubblebabble);
|
||||||
|
|
||||||
exit(0);
|
exit(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -646,7 +666,7 @@ main(int ac, char **av)
|
|||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
while ((opt = getopt(ac, av, "dqpclRxXyb:f:t:P:N:C:")) != -1) {
|
while ((opt = getopt(ac, av, "dqpclRxXyvb:f:t:P:N:C:")) != -1) {
|
||||||
switch (opt) {
|
switch (opt) {
|
||||||
case 'b':
|
case 'b':
|
||||||
bits = atoi(optarg);
|
bits = atoi(optarg);
|
||||||
@ -706,6 +726,10 @@ main(int ac, char **av)
|
|||||||
print_public = 1;
|
print_public = 1;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case 'v':
|
||||||
|
print_verbose = 1;
|
||||||
|
break;
|
||||||
|
|
||||||
case 'd':
|
case 'd':
|
||||||
key_type_name = "dsa";
|
key_type_name = "dsa";
|
||||||
break;
|
break;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user