diff options
author | Niels Provos <provos@cvs.openbsd.org> | 1999-09-28 04:45:39 +0000 |
---|---|---|
committer | Niels Provos <provos@cvs.openbsd.org> | 1999-09-28 04:45:39 +0000 |
commit | 2ab8fdfdfd2725f7f58cb91304befeb8d360ddf6 (patch) | |
tree | 78b8943ea351c6ae64bb3911ff8bb65d29ff6ad4 /usr.bin/ssh/channels.c | |
parent | 9f4a6fa812c9ca6ac0b6df69d6a8dbf9e53a62c1 (diff) |
convert all uses of gmp to SSL bignum
convert all used of rsa to SSL rsa functions
remove all use of randomstate to OpenBSD arc4random() and arc4_stir()
all this done at a long long night in Canada.
Diffstat (limited to 'usr.bin/ssh/channels.c')
-rw-r--r-- | usr.bin/ssh/channels.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/usr.bin/ssh/channels.c b/usr.bin/ssh/channels.c index c6b2e21a3b9..75ad8d19a4f 100644 --- a/usr.bin/ssh/channels.c +++ b/usr.bin/ssh/channels.c @@ -16,7 +16,7 @@ arbitrary tcp/ip connections, and the authentication agent connection. */ #include "includes.h" -RCSID("$Id: channels.c,v 1.1 1999/09/26 20:53:34 deraadt Exp $"); +RCSID("$Id: channels.c,v 1.2 1999/09/28 04:45:36 provos Exp $"); #ifndef HAVE_GETHOSTNAME #include <sys/utsname.h> @@ -1334,14 +1334,14 @@ void x11_input_open(int payload_len) /* Requests forwarding of X11 connections, generates fake authentication data, and enables authentication spoofing. */ -void x11_request_forwarding_with_spoofing(RandomState *state, - const char *proto, const char *data) +void x11_request_forwarding_with_spoofing(const char *proto, const char *data) { unsigned int data_len = (unsigned int)strlen(data) / 2; unsigned int i, value; char *new_data; int screen_number; const char *cp; + u_int32_t rand; cp = getenv("DISPLAY"); if (cp) @@ -1364,8 +1364,11 @@ void x11_request_forwarding_with_spoofing(RandomState *state, { if (sscanf(data + 2 * i, "%2x", &value) != 1) fatal("x11_request_forwarding: bad authentication data: %.100s", data); + if (i % 4 == 0) + rand = arc4random(); x11_saved_data[i] = value; - x11_fake_data[i] = random_get_byte(state); + x11_fake_data[i] = rand & 0xff; + rand >>= 8; } x11_saved_data_len = data_len; x11_fake_data_len = data_len; |