From: tedu Date: Thu, 17 Jul 2014 13:38:22 +0000 (+0000) Subject: zero entropy buf X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=f59b47d5ba7d0365430bb7ffa9d0e9d74065149e;p=openbsd zero entropy buf --- 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); }