aboutsummaryrefslogtreecommitdiff
path: root/hostfile.c
diff options
context:
space:
mode:
authorDag-Erling Smørgrav <des@FreeBSD.org>2017-01-31 12:33:47 +0000
committerDag-Erling Smørgrav <des@FreeBSD.org>2017-01-31 12:33:47 +0000
commit19ca85510bbe080af3faf5e9ae394608428ac953 (patch)
tree117f9a26f0d949b937129ea841578bd2ba4390fa /hostfile.c
parentab4ec008e7abd1c8098428dbf9642c3685383045 (diff)
downloadsrc-vendor/openssh/7.4p1.tar.gz
src-vendor/openssh/7.4p1.zip
Vendor import of OpenSSH 7.4p1.vendor/openssh/7.4p1
Diffstat (limited to 'hostfile.c')
-rw-r--r--hostfile.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/hostfile.c b/hostfile.c
index 2850a47936d8..4548fbab3d80 100644
--- a/hostfile.c
+++ b/hostfile.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: hostfile.c,v 1.66 2015/05/04 06:10:48 djm Exp $ */
+/* $OpenBSD: hostfile.c,v 1.67 2016/09/17 18:00:27 tedu Exp $ */
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -123,14 +123,13 @@ host_hash(const char *host, const char *name_from_hostfile, u_int src_len)
u_char salt[256], result[256];
char uu_salt[512], uu_result[512];
static char encoded[1024];
- u_int i, len;
+ u_int len;
len = ssh_digest_bytes(SSH_DIGEST_SHA1);
if (name_from_hostfile == NULL) {
/* Create new salt */
- for (i = 0; i < len; i++)
- salt[i] = arc4random();
+ arc4random_buf(salt, len);
} else {
/* Extract salt from known host entry */
if (extract_salt(name_from_hostfile, src_len, salt,