diff options
author | Markus Friedl <markus@cvs.openbsd.org> | 2000-03-23 22:15:35 +0000 |
---|---|---|
committer | Markus Friedl <markus@cvs.openbsd.org> | 2000-03-23 22:15:35 +0000 |
commit | be14628f3ce880cece503400a53bb33560d1a536 (patch) | |
tree | 933b40db98beddabe8efed0cc638c4ff03c68e14 /usr.bin/ssh/sshd.c | |
parent | f3b7b8412c7db74a298cea1e7397f3327225ca24 (diff) |
initial support for DSA keys. ok deraadt@, niels@
Diffstat (limited to 'usr.bin/ssh/sshd.c')
-rw-r--r-- | usr.bin/ssh/sshd.c | 27 |
1 files changed, 15 insertions, 12 deletions
diff --git a/usr.bin/ssh/sshd.c b/usr.bin/ssh/sshd.c index ac8ea406b96..6a5625394ff 100644 --- a/usr.bin/ssh/sshd.c +++ b/usr.bin/ssh/sshd.c @@ -11,7 +11,7 @@ */ #include "includes.h" -RCSID("$OpenBSD: sshd.c,v 1.93 2000/03/22 09:55:10 markus Exp $"); +RCSID("$OpenBSD: sshd.c,v 1.94 2000/03/23 22:15:34 markus Exp $"); #include "xmalloc.h" #include "rsa.h" @@ -1264,7 +1264,7 @@ do_authloop(struct passwd * pw) { int attempt = 0; unsigned int bits; - BIGNUM *client_host_key_e, *client_host_key_n; + RSA *client_host_key; BIGNUM *n; char *client_user, *password; char user[1024]; @@ -1381,21 +1381,24 @@ do_authloop(struct passwd * pw) client_user = packet_get_string(&ulen); /* Get the client host key. */ - client_host_key_e = BN_new(); - client_host_key_n = BN_new(); + client_host_key = RSA_new(); + if (client_host_key == NULL) + fatal("RSA_new failed"); + client_host_key->e = BN_new(); + client_host_key->n = BN_new(); + if (client_host_key->e == NULL || client_host_key->n == NULL) + fatal("BN_new failed"); bits = packet_get_int(); - packet_get_bignum(client_host_key_e, &elen); - packet_get_bignum(client_host_key_n, &nlen); + packet_get_bignum(client_host_key->e, &elen); + packet_get_bignum(client_host_key->n, &nlen); - if (bits != BN_num_bits(client_host_key_n)) + if (bits != BN_num_bits(client_host_key->n)) error("Warning: keysize mismatch for client_host_key: " - "actual %d, announced %d", BN_num_bits(client_host_key_n), bits); + "actual %d, announced %d", BN_num_bits(client_host_key->n), bits); packet_integrity_check(plen, (4 + ulen) + 4 + elen + nlen, type); - authenticated = auth_rhosts_rsa(pw, client_user, - client_host_key_e, client_host_key_n); - BN_clear_free(client_host_key_e); - BN_clear_free(client_host_key_n); + authenticated = auth_rhosts_rsa(pw, client_user, client_host_key); + RSA_free(client_host_key); snprintf(user, sizeof user, " ruser %s", client_user); xfree(client_user); |