Commit 6d618b92 authored by Niels Möller's avatar Niels Möller

* src/lsh.c: Use make_default_random().

* src/lsh_proxy.c: Likewise.
* src/lshd.c: Likewise.

Rev: src/lshd.c:1.102
parent cf75cf56
...@@ -143,8 +143,7 @@ const char *argp_program_bug_address = BUG_ADDRESS; ...@@ -143,8 +143,7 @@ const char *argp_program_bug_address = BUG_ADDRESS;
(e object exception_handler) (e object exception_handler)
(reaper object reap) (reaper object reap)
(random_poll object random_poll) (random object randomness_with_poll)
(random object randomness)
(signature_algorithms object alist) (signature_algorithms object alist)
(style . sexp_argp_state) (style . sexp_argp_state)
...@@ -212,12 +211,9 @@ make_lshd_options(struct io_backend *backend) ...@@ -212,12 +211,9 @@ make_lshd_options(struct io_backend *backend)
self->e = make_lshd_exception_handler(&default_exception_handler, self->e = make_lshd_exception_handler(&default_exception_handler,
HANDLER_CONTEXT); HANDLER_CONTEXT);
self->reaper = make_reaper(); self->reaper = make_reaper();
self->random_poll = make_unix_random(self->reaper); self->random = make_default_random(self->reaper, self->e);
self->random = make_arcfour_random(self->random_poll,
&sha1_algorithm, self->e);
/* FIXME: We don't support rsa yet in the rest of the code! */ self->signature_algorithms = all_signature_algorithms(&self->random->super);
self->signature_algorithms = all_signature_algorithms(self->random);
self->style = SEXP_TRANSPORT; self->style = SEXP_TRANSPORT;
self->interface = NULL; self->interface = NULL;
...@@ -405,7 +401,7 @@ main_argp_parser(int key, char *arg, struct argp_state *state) ...@@ -405,7 +401,7 @@ main_argp_parser(int key, char *arg, struct argp_state *state)
LIST(self->kex_algorithms)[i++] = ATOM_DIFFIE_HELLMAN_GROUP1_SHA1; LIST(self->kex_algorithms)[i++] = ATOM_DIFFIE_HELLMAN_GROUP1_SHA1;
ALIST_SET(self->super.algorithms, ALIST_SET(self->super.algorithms,
ATOM_DIFFIE_HELLMAN_GROUP1_SHA1, ATOM_DIFFIE_HELLMAN_GROUP1_SHA1,
make_dh_server(make_dh1(self->random))); make_dh_server(make_dh1(&self->random->super)));
} }
#if WITH_SRP #if WITH_SRP
if (self->with_srp_keyexchange) if (self->with_srp_keyexchange)
...@@ -414,7 +410,7 @@ main_argp_parser(int key, char *arg, struct argp_state *state) ...@@ -414,7 +410,7 @@ main_argp_parser(int key, char *arg, struct argp_state *state)
LIST(self->kex_algorithms)[i++] = ATOM_SRP_RING1_SHA1_LOCAL; LIST(self->kex_algorithms)[i++] = ATOM_SRP_RING1_SHA1_LOCAL;
ALIST_SET(self->super.algorithms, ALIST_SET(self->super.algorithms,
ATOM_SRP_RING1_SHA1_LOCAL, ATOM_SRP_RING1_SHA1_LOCAL,
make_srp_server(make_srp1(self->random), db)); make_srp_server(make_srp1(&self->random->super), db));
} }
#endif /* WITH_SRP */ #endif /* WITH_SRP */
} }
...@@ -466,6 +462,9 @@ main_argp_parser(int key, char *arg, struct argp_state *state) ...@@ -466,6 +462,9 @@ main_argp_parser(int key, char *arg, struct argp_state *state)
} }
else else
argp_error(state, "All user authentication methods disabled."); argp_error(state, "All user authentication methods disabled.");
/* Start background poll */
RANDOM_POLL_BACKGROUND(self->random->poller);
break; break;
} }
...@@ -684,8 +683,6 @@ int main(int argc, char **argv) ...@@ -684,8 +683,6 @@ int main(int argc, char **argv)
return EXIT_FAILURE; return EXIT_FAILURE;
} }
RANDOM_POLL_BACKGROUND(options->random_poll);
{ {
/* Commands to be invoked on the connection */ /* Commands to be invoked on the connection */
struct object_list *connection_hooks; struct object_list *connection_hooks;
...@@ -735,11 +732,11 @@ int main(int argc, char **argv) ...@@ -735,11 +732,11 @@ int main(int argc, char **argv)
"lsh - a free ssh", "lsh - a free ssh",
NULL, NULL,
SSH_MAX_PACKET, SSH_MAX_PACKET,
options->random, &options->random->super,
options->super.algorithms, options->super.algorithms,
options->sshd1), options->sshd1),
make_simple_kexinit make_simple_kexinit
(options->random, (&options->random->super,
options->kex_algorithms, options->kex_algorithms,
options->super.hostkey_algorithms, options->super.hostkey_algorithms,
options->super.crypto_algorithms, options->super.crypto_algorithms,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment