summaryrefslogtreecommitdiff
path: root/sshconnect1.c
diff options
context:
space:
mode:
Diffstat (limited to 'sshconnect1.c')
-rw-r--r--sshconnect1.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/sshconnect1.c b/sshconnect1.c
index bfc523bde3176..a0453618402b1 100644
--- a/sshconnect1.c
+++ b/sshconnect1.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sshconnect1.c,v 1.78 2015/11/15 22:26:49 jcs Exp $ */
+/* $OpenBSD: sshconnect1.c,v 1.79 2016/09/19 07:52:42 natano Exp $ */
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -509,7 +509,6 @@ ssh_kex(char *host, struct sockaddr *hostaddr)
u_char cookie[8];
u_int supported_ciphers;
u_int server_flags, client_flags;
- u_int32_t rnd = 0;
debug("Waiting for server public key.");
@@ -568,12 +567,7 @@ ssh_kex(char *host, struct sockaddr *hostaddr)
* random number, interpreted as a 32-byte key, with the least
* significant 8 bits being the first byte of the key.
*/
- for (i = 0; i < 32; i++) {
- if (i % 4 == 0)
- rnd = arc4random();
- session_key[i] = rnd & 0xff;
- rnd >>= 8;
- }
+ arc4random_buf(session_key, sizeof(session_key));
/*
* According to the protocol spec, the first byte of the session key