summaryrefslogtreecommitdiff
path: root/usr.bin/ssh/ssh-keygen.c
diff options
context:
space:
mode:
authorMarkus Friedl <markus@cvs.openbsd.org>2000-08-19 21:34:45 +0000
committerMarkus Friedl <markus@cvs.openbsd.org>2000-08-19 21:34:45 +0000
commit3e0faeac47b31140f7d1afae467c8354d11f1b8c (patch)
treeb106e4cf366a597834d39c0a25da3d4bd212ca46 /usr.bin/ssh/ssh-keygen.c
parentc77945f9b968167988fecb8f47ab5f9652ffb647 (diff)
add SSH2/DSA support to the agent and some other DSA related cleanups.
(note that we cannot talk to ssh.com's ssh2 agents)
Diffstat (limited to 'usr.bin/ssh/ssh-keygen.c')
-rw-r--r--usr.bin/ssh/ssh-keygen.c19
1 files changed, 7 insertions, 12 deletions
diff --git a/usr.bin/ssh/ssh-keygen.c b/usr.bin/ssh/ssh-keygen.c
index 3d5b8fb095c..8f69f8eedc0 100644
--- a/usr.bin/ssh/ssh-keygen.c
+++ b/usr.bin/ssh/ssh-keygen.c
@@ -7,7 +7,7 @@
*/
#include "includes.h"
-RCSID("$OpenBSD: ssh-keygen.c,v 1.29 2000/07/15 04:01:37 djm Exp $");
+RCSID("$OpenBSD: ssh-keygen.c,v 1.30 2000/08/19 21:34:43 markus Exp $");
#include <openssl/evp.h>
#include <openssl/pem.h>
@@ -16,7 +16,6 @@ RCSID("$OpenBSD: ssh-keygen.c,v 1.29 2000/07/15 04:01:37 djm Exp $");
#include "ssh.h"
#include "xmalloc.h"
-#include "fingerprint.h"
#include "key.h"
#include "rsa.h"
#include "dsa.h"
@@ -224,8 +223,9 @@ do_print_public(struct passwd *pw)
void
do_fingerprint(struct passwd *pw)
{
+ /* XXX RSA1 only */
+
FILE *f;
- BIGNUM *e, *n;
Key *public;
char *comment = NULL, *cp, *ep, line[16*1024];
int i, skip = 0, num = 1, invalid = 1;
@@ -245,13 +245,9 @@ do_fingerprint(struct passwd *pw)
key_free(public);
exit(0);
}
- key_free(public);
- /* XXX */
f = fopen(identity_file, "r");
if (f != NULL) {
- n = BN_new();
- e = BN_new();
while (fgets(line, sizeof(line), f)) {
i = strlen(line) - 1;
if (line[i] != '\n') {
@@ -286,18 +282,17 @@ do_fingerprint(struct passwd *pw)
*cp++ = '\0';
}
ep = cp;
- if (auth_rsa_read_key(&cp, &ignore, e, n)) {
+ if (auth_rsa_read_key(&cp, &ignore, public->rsa->e, public->rsa->n)) {
invalid = 0;
comment = *cp ? cp : comment;
- printf("%d %s %s\n", BN_num_bits(n),
- fingerprint(e, n),
+ printf("%d %s %s\n", key_size(public),
+ key_fingerprint(public),
comment ? comment : "no comment");
}
}
- BN_free(e);
- BN_free(n);
fclose(f);
}
+ key_free(public);
if (invalid) {
printf("%s is not a valid key file.\n", identity_file);
exit(1);