220 40405 <1aa6c911-439e-4469-806d-bdc39989ad40@isocpp.org> article
Path: news.gmane.org!.POSTED!not-for-mail
From: =?UTF-8?Q?Micha=C5=82_Gawron?= <mcvsama@gmail.com>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: more security concerns
Date: Tue, 9 Oct 2018 00:25:48 -0700 (PDT)
Lines: 156
Approved: news@gmane.org
Message-ID: <1aa6c911-439e-4469-806d-bdc39989ad40@isocpp.org>
References: <CAFdMc-0NqfbqeOhhH1YiVGxDRVPv7COKNqge3mLu8UE8SgcXNw@mail.gmail.com>
 <CAO8_tC4kNZ6s-xMXo69n1D3dbOMkqt0fjLU44Uq5TfABp17hQQ@mail.gmail.com> <CAFdMc-1DpAUkYDVyNmP5H49XyNVDq5_T6UkEVaQGMGA0YEhNGw@mail.gmail.com>
 <CANiq72=4-NBXg28AVBbaY83jLgTNRowmKiMT8Sgk28jTUu2xfw@mail.gmail.com>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: blaine.gmane.org
Mime-Version: 1.0
Content-Type: multipart/mixed; 
	boundary="----=_Part_1965_1321297405.1539069948469"
X-Trace: blaine.gmane.org 1539069825 10229 195.159.176.226 (9 Oct 2018 07:23:45 GMT)
X-Complaints-To: usenet@blaine.gmane.org
NNTP-Posting-Date: Tue, 9 Oct 2018 07:23:45 +0000 (UTC)
To: ISO C++ Standard - Future Proposals <std-proposals@isocpp.org>
Original-X-From: std-proposals+bncBCRMZK6MQMOBB7NP6HOQKGQEMV3NS6Y@isocpp.org Tue Oct 09 09:23:41 2018
Return-path: <std-proposals+bncBCRMZK6MQMOBB7NP6HOQKGQEMV3NS6Y@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-yb1-f198.google.com ([209.85.219.198])
	by blaine.gmane.org with esmtp (Exim 4.84_2)
	(envelope-from <std-proposals+bncBCRMZK6MQMOBB7NP6HOQKGQEMV3NS6Y@isocpp.org>)
	id 1g9mMm-0002Xd-Br
	for gclcip-std-proposals@m.gmane.org; Tue, 09 Oct 2018 09:23:40 +0200
Original-Received: by mail-yb1-f198.google.com with SMTP id s190-v6sf179373ybf.8
        for <gclcip-std-proposals@m.gmane.org>; Tue, 09 Oct 2018 00:25:51 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=isocpp-org.20150623.gappssmtp.com; s=20150623;
        h=date:from:to:message-id:in-reply-to:references:subject:mime-version
         :x-original-sender:reply-to:precedence:mailing-list:list-id
         :list-post:list-help:list-archive:list-subscribe:list-unsubscribe;
        bh=pIB71DSvGHxxBuVmv47j1cCdLrhiN3CV777JrHMgIZ0=;
        b=aiAunvFmzUnEiO2up+hZS4LhsqDip+Oh0emnZ3Mv1gHaE5AmN158R1v5C+NzL0t0PI
         bni1EL9yj4UOBWzkInmWCXwzY6K/MCQmVJmZbYkPzgXF5/FHCwKa7pEtVr08PxxB9aLj
         u0OJiK87gmA9o0PDqUciT7H17lCpEzP22+MtHeVd3FPMQwajQjRx0qP9BlZGAfQ0C1bR
         9tU2x+ARweqKREP9pWse+UiSLt9b8mIqZXzTOKNo+9/krFFam3lv9ijvsEh0iPl3lREC
         9hFsNQW1YG+Dhoof0yWHtU1k3fAHacfBfpZgYQZaWAfWEFciNsmmB4L33Es+ALuW6Uru
         6jnw==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20161025;
        h=date:from:to:message-id:in-reply-to:references:subject:mime-version
         :x-original-sender:reply-to:precedence:mailing-list:list-id
         :list-post:list-help:list-archive:list-subscribe:list-unsubscribe;
        bh=pIB71DSvGHxxBuVmv47j1cCdLrhiN3CV777JrHMgIZ0=;
        b=b/XU+ELwkuDSW9yIrGUvaL1xE7pRhJRiaga6CjLjYWst3Nh2C60LY85Id0nqv8tz5K
         p8bQ9gdVXdZo8S9L2H8KpqnLa+EhbJLe2K5RjRk38S9wnb1toLApMq8gKjuulWi2U7HC
         hgW0XSla/ZwpdfN8o8QXojwL96Y82qz29S/v3p+ul46oDxof4DvJkH64PsBbejU4q9Kl
         EkOvCoZgDHhTgw90JpXbXjLBiYEap/MgSRg2MwgsO4olixLa5vt6TW5kiz7QbBYVDtcm
         4XV9aYnny1nlk/tZ7B3zzgGo2XrHnhDsNV9/xs+PgD18aQv3mebbHkJ30dKXRMKWLJvV
         isTQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20161025;
        h=x-gm-message-state:date:from:to:message-id:in-reply-to:references
         :subject:mime-version:x-original-sender:reply-to:precedence
         :mailing-list:list-id:x-spam-checked-in-group:list-post:list-help
         :list-archive:list-subscribe:list-unsubscribe;
        bh=pIB71DSvGHxxBuVmv47j1cCdLrhiN3CV777JrHMgIZ0=;
        b=LltiERpEmUdFwqjioYNHAvJ7ZoBCgmzRZN4Byb8Lx5oTEHU3BXSjdgCkGOTsKoRCWU
         kNgExjHMUSsRdHJZ4RuJe6JZofBybYK/iFlvzYND24gvQAkMAtoZMSqHYizIaTdStLTF
         PFuZRishIWXV7JlYpYi1Rm+xfVrKOqM7IE6kjIcQPh/I5PTt6keYP97pLv5e+kDjTQyR
         c+HFByJ4qdPnAs4WMB37KnvYOhlCeNhRFhTIOHtP0ZduNrwJYpbrzxM9/iL/iJgIO6f9
         yNnL6BWZB5iSJtSLnh2RdNNZ8uph2R15g4wt+4CtClRX3FX0+ZeI0fDdefFnGExULDkF
         fogQ==
X-Gm-Message-State: ABuFfogIB3JChrSXUiDYHYs9IpVozaDEe5iiUIFBXDFxdCHDgBuPiRr9
	1Suj5esoGyyT+mJLpJ5lScGqww==
X-Google-Smtp-Source: ACcGV600xtEuLpVA25q3B+kPbmBqCDZIFpYvwfCZW2LimF8gU8oHTb9kN9U5bSR6R0RB6cYRG0mJ9w==
X-Received: by 2002:a25:8143:: with SMTP id j3-v6mr13585430ybm.70.1539069950633;
        Tue, 09 Oct 2018 00:25:50 -0700 (PDT)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 2002:a25:512:: with SMTP id 18-v6ls689092ybf.2.gmail; Tue, 09 Oct
 2018 00:25:49 -0700 (PDT)
X-Received: by 2002:a25:d90a:: with SMTP id q10-v6mr325040ybg.0.1539069949131;
        Tue, 09 Oct 2018 00:25:49 -0700 (PDT)
In-Reply-To: <CANiq72=4-NBXg28AVBbaY83jLgTNRowmKiMT8Sgk28jTUu2xfw@mail.gmail.com>
X-Original-Sender: mcvsama@gmail.com
Precedence: list
Mailing-list: list std-proposals@isocpp.org; contact std-proposals+owners@isocpp.org
List-ID: <std-proposals.isocpp.org>
X-Spam-Checked-In-Group: std-proposals@isocpp.org
X-Google-Group-Id: 399137483710
List-Post: <https://groups.google.com/a/isocpp.org/group/std-proposals/post>, <mailto:std-proposals@isocpp.org>
List-Help: <https://support.google.com/a/isocpp.org/bin/topic.py?topic=25838>, <mailto:std-proposals+help@isocpp.org>
List-Archive: <https://groups.google.com/a/isocpp.org/group/std-proposals/>
List-Subscribe: <https://groups.google.com/a/isocpp.org/group/std-proposals/subscribe>,
 <mailto:std-proposals+subscribe@isocpp.org>
List-Unsubscribe: <mailto:googlegroups-manage+399137483710+unsubscribe@googlegroups.com>,
 <https://groups.google.com/a/isocpp.org/group/std-proposals/subscribe>
Xref: news.gmane.org gmane.comp.lang.c++.isocpp.proposals:40405
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/40405>

------=_Part_1965_1321297405.1539069948469
Content-Type: multipart/alternative; 
	boundary="----=_Part_1966_2029531398.1539069948470"

------=_Part_1966_2029531398.1539069948470
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

Wouldn't something like this as a std:: function work?

template<class T>
    inline add_volatile<T>&
    make_volatile (T& t)
    {
        return t;
    }

Then later:

int a =3D 5;
=E2=80=A6
make_volatile (a) =3D 0;


std::best_regards();

On Tuesday, October 9, 2018 at 9:02:41 AM UTC+2, Miguel Ojeda wrote:
>
> Hi Daniel,=20
>
> For this specific case (data that must be kept as secret as reasonably=20
> possible, like passwords, secrets, keying data...), I am proposing=20
> `secure_clear` (a memset_s-like function and function template) and=20
> `secure_val` (a new class template) in P1315 for the next mailing.=20
> Meanwhile that is out, please take a look at:=20
>
>   https://ojeda.io/cpp/secure_val=20
>
> As long as your proposal allows to write functionality like=20
> `secure_clear` and `secure_val` as portably and easily as possible, it=20
> seems useful!=20
>
> Cheers,=20
> Miguel=20
>

--=20
You received this message because you are subscribed to the Google Groups "=
ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
To view this discussion on the web visit https://groups.google.com/a/isocpp=
..org/d/msgid/std-proposals/1aa6c911-439e-4469-806d-bdc39989ad40%40isocpp.or=
g.

------=_Part_1966_2029531398.1539069948470
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">Wouldn&#39;t something like this as a std:: function work?=
<br><br><div class=3D"prettyprint" style=3D"background-color: rgb(250, 250,=
 250); border-color: rgb(187, 187, 187); border-style: solid; border-width:=
 1px; word-wrap: break-word;"><code class=3D"prettyprint"><div class=3D"sub=
prettyprint"><span style=3D"color: #008;" class=3D"styled-by-prettify">temp=
late</span><span style=3D"color: #660;" class=3D"styled-by-prettify">&lt;</=
span><span style=3D"color: #008;" class=3D"styled-by-prettify">class</span>=
<span style=3D"color: #000;" class=3D"styled-by-prettify"> T</span><span st=
yle=3D"color: #660;" class=3D"styled-by-prettify">&gt;</span><span style=3D=
"color: #000;" class=3D"styled-by-prettify"><br>=C2=A0 =C2=A0 </span><span =
style=3D"color: #008;" class=3D"styled-by-prettify">inline</span><span styl=
e=3D"color: #000;" class=3D"styled-by-prettify"> add_volatile</span><span s=
tyle=3D"color: #660;" class=3D"styled-by-prettify">&lt;</span><span style=
=3D"color: #000;" class=3D"styled-by-prettify">T</span><span style=3D"color=
: #660;" class=3D"styled-by-prettify">&gt;&amp;</span><span style=3D"color:=
 #000;" class=3D"styled-by-prettify"><br>=C2=A0 =C2=A0 make_volatile </span=
><span style=3D"color: #660;" class=3D"styled-by-prettify">(</span><span st=
yle=3D"color: #000;" class=3D"styled-by-prettify">T</span><span style=3D"co=
lor: #660;" class=3D"styled-by-prettify">&amp;</span><span style=3D"color: =
#000;" class=3D"styled-by-prettify"> t</span><span style=3D"color: #660;" c=
lass=3D"styled-by-prettify">)</span><span style=3D"color: #000;" class=3D"s=
tyled-by-prettify"><br>=C2=A0 =C2=A0 </span><span style=3D"color: #660;" cl=
ass=3D"styled-by-prettify">{</span><span style=3D"color: #000;" class=3D"st=
yled-by-prettify"><br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 </span><span style=3D"col=
or: #008;" class=3D"styled-by-prettify">return</span><span style=3D"color: =
#000;" class=3D"styled-by-prettify"> t</span><span style=3D"color: #660;" c=
lass=3D"styled-by-prettify">;</span><span style=3D"color: #000;" class=3D"s=
tyled-by-prettify"><br>=C2=A0 =C2=A0 </span><span style=3D"color: #660;" cl=
ass=3D"styled-by-prettify">}</span><span style=3D"color: #000;" class=3D"st=
yled-by-prettify"><br></span></div></code></div><div><br></div><div>Then la=
ter:</div><div><br></div><div><div class=3D"prettyprint" style=3D"backgroun=
d-color: rgb(250, 250, 250); border-color: rgb(187, 187, 187); border-style=
: solid; border-width: 1px; word-wrap: break-word;"><code class=3D"prettypr=
int"><div class=3D"subprettyprint"><span style=3D"color: #008;" class=3D"st=
yled-by-prettify">int</span><span style=3D"color: #000;" class=3D"styled-by=
-prettify"> a </span><span style=3D"color: #660;" class=3D"styled-by-pretti=
fy">=3D</span><span style=3D"color: #000;" class=3D"styled-by-prettify"> </=
span><span style=3D"color: #066;" class=3D"styled-by-prettify">5</span><spa=
n style=3D"color: #660;" class=3D"styled-by-prettify">;</span><span style=
=3D"color: #000;" class=3D"styled-by-prettify"><br></span><span style=3D"co=
lor: #660;" class=3D"styled-by-prettify">=E2=80=A6</span><span style=3D"col=
or: #000;" class=3D"styled-by-prettify"><br>make_volatile </span><span styl=
e=3D"color: #660;" class=3D"styled-by-prettify">(</span><span style=3D"colo=
r: #000;" class=3D"styled-by-prettify">a</span><span style=3D"color: #660;"=
 class=3D"styled-by-prettify">)</span><span style=3D"color: #000;" class=3D=
"styled-by-prettify"> </span><span style=3D"color: #660;" class=3D"styled-b=
y-prettify">=3D</span><span style=3D"color: #000;" class=3D"styled-by-prett=
ify"> </span><span style=3D"color: #066;" class=3D"styled-by-prettify">0</s=
pan><span style=3D"color: #660;" class=3D"styled-by-prettify">;</span></div=
></code></div><br></div><div><br>std::best_regards();<br><br>On Tuesday, Oc=
tober 9, 2018 at 9:02:41 AM UTC+2, Miguel Ojeda wrote:<blockquote class=3D"=
gmail_quote" style=3D"margin: 0;margin-left: 0.8ex;border-left: 1px #ccc so=
lid;padding-left: 1ex;">Hi Daniel,
<br>
<br>For this specific case (data that must be kept as secret as reasonably
<br>possible, like passwords, secrets, keying data...), I am proposing
<br>`secure_clear` (a memset_s-like function and function template) and
<br>`secure_val` (a new class template) in P1315 for the next mailing.
<br>Meanwhile that is out, please take a look at:
<br>
<br>=C2=A0 <a href=3D"https://ojeda.io/cpp/secure_val" target=3D"_blank" re=
l=3D"nofollow" onmousedown=3D"this.href=3D&#39;https://www.google.com/url?q=
\x3dhttps%3A%2F%2Fojeda.io%2Fcpp%2Fsecure_val\x26sa\x3dD\x26sntz\x3d1\x26us=
g\x3dAFQjCNF-Z2fPlRu8XiZWvsdOeh1PS9HiIg&#39;;return true;" onclick=3D"this.=
href=3D&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fojeda.io%2Fcpp%2F=
secure_val\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNF-Z2fPlRu8XiZWvsdOeh1PS9=
HiIg&#39;;return true;">https://ojeda.io/cpp/secure_<wbr>val</a>
<br>
<br>As long as your proposal allows to write functionality like
<br>`secure_clear` and `secure_val` as portably and easily as possible, it
<br>seems useful!
<br>
<br>Cheers,
<br>Miguel
<br></blockquote></div></div>

<p></p>

-- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals&quot; group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:std-proposals+unsubscribe@isocpp.org">std-proposa=
ls+unsubscribe@isocpp.org</a>.<br />
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org">std-proposals@isocpp.org</a>.<br />
To view this discussion on the web visit <a href=3D"https://groups.google.c=
om/a/isocpp.org/d/msgid/std-proposals/1aa6c911-439e-4469-806d-bdc39989ad40%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.=
com/a/isocpp.org/d/msgid/std-proposals/1aa6c911-439e-4469-806d-bdc39989ad40=
%40isocpp.org</a>.<br />

------=_Part_1966_2029531398.1539069948470--

------=_Part_1965_1321297405.1539069948469--

.
