summaryrefslogtreecommitdiffstats
path: root/lib/libc/crypt/arc4random.c
diff options
context:
space:
mode:
authortedu <tedu@openbsd.org>2014-05-06 15:37:57 +0000
committertedu <tedu@openbsd.org>2014-05-06 15:37:57 +0000
commit367165dc924c7cc221f463e8f8a349b46348651f (patch)
tree170750093e05e85f8bead6675caf5035fd6dd441 /lib/libc/crypt/arc4random.c
parentremove cpsw_{read,write}_4 wrapper functions and just use the real (diff)
downloadwireguard-openbsd-367165dc924c7cc221f463e8f8a349b46348651f.tar.xz
wireguard-openbsd-367165dc924c7cc221f463e8f8a349b46348651f.zip
clear a stack buffer with explicit_bzero
Diffstat (limited to 'lib/libc/crypt/arc4random.c')
-rw-r--r--lib/libc/crypt/arc4random.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/libc/crypt/arc4random.c b/lib/libc/crypt/arc4random.c
index 57acc0d56da..57decde1f81 100644
--- a/lib/libc/crypt/arc4random.c
+++ b/lib/libc/crypt/arc4random.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: arc4random.c,v 1.28 2014/05/06 02:31:45 tedu Exp $ */
+/* $OpenBSD: arc4random.c,v 1.29 2014/05/06 15:37:57 tedu Exp $ */
/*
* Copyright (c) 1996, David Mazieres <dm@uun.org>
@@ -92,7 +92,7 @@ _rs_stir(void)
_rs_init(rnd, sizeof(rnd));
} else
_rs_rekey(rnd, sizeof(rnd));
- memset(rnd, 0, sizeof(rnd));
+ explicit_bzero(rnd, sizeof(rnd));
/* invalidate rs_buf */
rs_have = 0;