summaryrefslogtreecommitdiff
path: root/sshd.c
diff options
context:
space:
mode:
Diffstat (limited to 'sshd.c')
-rw-r--r--sshd.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/sshd.c b/sshd.c
index 174cc7a42..cddc87e8d 100644
--- a/sshd.c
+++ b/sshd.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: sshd.c,v 1.404 2013/07/19 07:37:48 markus Exp $ */ 1/* $OpenBSD: sshd.c,v 1.405 2013/08/22 19:02:21 djm Exp $ */
2/* 2/*
3 * Author: Tatu Ylonen <ylo@cs.hut.fi> 3 * Author: Tatu Ylonen <ylo@cs.hut.fi>
4 * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland 4 * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -613,6 +613,7 @@ privsep_preauth_child(void)
613 arc4random_stir(); 613 arc4random_stir();
614 arc4random_buf(rnd, sizeof(rnd)); 614 arc4random_buf(rnd, sizeof(rnd));
615 RAND_seed(rnd, sizeof(rnd)); 615 RAND_seed(rnd, sizeof(rnd));
616 bzero(rnd, sizeof(rnd));
616 617
617 /* Demote the private keys to public keys. */ 618 /* Demote the private keys to public keys. */
618 demote_sensitive_data(); 619 demote_sensitive_data();
@@ -747,6 +748,7 @@ privsep_postauth(Authctxt *authctxt)
747 arc4random_stir(); 748 arc4random_stir();
748 arc4random_buf(rnd, sizeof(rnd)); 749 arc4random_buf(rnd, sizeof(rnd));
749 RAND_seed(rnd, sizeof(rnd)); 750 RAND_seed(rnd, sizeof(rnd));
751 bzero(rnd, sizeof(rnd));
750 752
751 /* Drop privileges */ 753 /* Drop privileges */
752 do_setusercontext(authctxt->pw); 754 do_setusercontext(authctxt->pw);
@@ -1139,6 +1141,7 @@ server_accept_loop(int *sock_in, int *sock_out, int *newsock, int *config_s)
1139 struct sockaddr_storage from; 1141 struct sockaddr_storage from;
1140 socklen_t fromlen; 1142 socklen_t fromlen;
1141 pid_t pid; 1143 pid_t pid;
1144 u_char rnd[256];
1142 1145
1143 /* setup fd set for accept */ 1146 /* setup fd set for accept */
1144 fdset = NULL; 1147 fdset = NULL;
@@ -1339,6 +1342,9 @@ server_accept_loop(int *sock_in, int *sock_out, int *newsock, int *config_s)
1339 * from that of the child 1342 * from that of the child
1340 */ 1343 */
1341 arc4random_stir(); 1344 arc4random_stir();
1345 arc4random_buf(rnd, sizeof(rnd));
1346 RAND_seed(rnd, sizeof(rnd));
1347 bzero(rnd, sizeof(rnd));
1342 } 1348 }
1343 1349
1344 /* child process check (or debug mode) */ 1350 /* child process check (or debug mode) */