From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 9BD631396D9 for ; Mon, 13 Nov 2017 03:03:55 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 4F4D9E117D; Mon, 13 Nov 2017 03:03:49 +0000 (UTC) Received: from smtp.gentoo.org (mail.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id ED51BE1074 for ; Mon, 13 Nov 2017 03:03:48 +0000 (UTC) Received: from [192.168.2.51] (85.253.86.194.cable.starman.ee [85.253.86.194]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: leio) by smtp.gentoo.org (Postfix) with ESMTPSA id D6CD834165A for ; Mon, 13 Nov 2017 03:03:46 +0000 (UTC) Message-ID: <1510542223.24203.0.camel@gentoo.org> Subject: Re: [gentoo-user] memset_s From: Mart Raudsepp To: gentoo-user@lists.gentoo.org Date: Mon, 13 Nov 2017 05:03:43 +0200 In-Reply-To: References: <26501197.ioODuGg76y@thetick> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.18.3 Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-user@lists.gentoo.org Reply-to: gentoo-user@lists.gentoo.org Mime-Version: 1.0 Content-Transfer-Encoding: 8bit X-Archives-Salt: 46688786-d022-4893-9a4b-0b8b53043ad7 X-Archives-Hash: d173463fcc6dd2e6e203e6bd57e722f0 On L, 2017-11-11 at 00:10 +0000, Jorge Almeida wrote: > Well, most programmers probably won't care about this stuff anyway, > and people who deal with cryptography tend to be more cautious than > average. But I'm not really making a case for safe versions of known > functions. After all, the usual functions do fine for most > applications. memset() would be enough to clear RAM with sensitive > data if we had a pragma (or equivalent) to convince the compiler to > not ignore it (I mean a pragma to invoke on a particular function > definition when the programmer  feels that a black box behaviour is > undesirable). Of course, solving the problem of the compiler copying > stuff around might be harder nut to crack. Sounds like you want explicit_bzero from libbsd?