From f59b47d5ba7d0365430bb7ffa9d0e9d74065149e Mon Sep 17 00:00:00 2001 From: tedu Date: Thu, 17 Jul 2014 13:38:22 +0000 Subject: [PATCH] zero entropy buf --- sys/dev/rnd.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/dev/rnd.c b/sys/dev/rnd.c index a6afe5d1be5..9770108eaf6 100644 --- a/sys/dev/rnd.c +++ b/sys/dev/rnd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rnd.c,v 1.158 2014/07/12 18:48:51 tedu Exp $ */ +/* $OpenBSD: rnd.c,v 1.159 2014/07/17 13:38:22 tedu Exp $ */ /* * Copyright (c) 2011 Theo de Raadt. @@ -946,6 +946,7 @@ sys_getentropy(struct proc *p, void *v, register_t *retval) arc4random_buf(buf, SCARG(uap, nbyte)); if ((error = copyout(buf, SCARG(uap, buf), SCARG(uap, nbyte))) != 0) return (error); + explicit_bzero(buf, sizeof(buf)); retval[0] = 0; return (0); } -- 2.20.1