From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: Storing sensitive data indefinitely in variables or buffers: Whether and how to fix? Date: Fri, 02 Jun 2023 09:30:07 +0300 Message-ID: <83v8g6bcls.fsf@gnu.org> References: <5b541bf1-1d13-ac8e-a91c-e1b238cc6f84@alphapapa.net> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="12718"; mail-complaints-to="usenet@ciao.gmane.io" Cc: jschmidt4gnu@vodafonemail.de, adam@alphapapa.net, emacs-devel@gnu.org, yantar92@posteo.net To: Adam Porter Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Fri Jun 02 08:30:24 2023 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1q4yIq-00038A-F9 for ged-emacs-devel@m.gmane-mx.org; Fri, 02 Jun 2023 08:30:24 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1q4yI3-0000Xi-2o; Fri, 02 Jun 2023 02:29:36 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1q4yHx-0000XG-P9 for emacs-devel@gnu.org; Fri, 02 Jun 2023 02:29:31 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1q4yHv-0001Bo-Pq; Fri, 02 Jun 2023 02:29:27 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=adp32YwAinxY6A7sksBFlre/8VmEcwqDP/+El2F4m3o=; b=Idv2jeJOHfr5 OKhmOOjrr6b76vSeVhzjh+fG+/iZBYc6Byqi1DbmkkOfmmOHr8FkxjHx7IcLWxk5ZdC9OHsoxKJBB aoTuzJfDwzX8yNxO5mOxfRiNuKxivt405/3Wy9u7cU+yfshrJkMGNUEkDXzpHMDUc8mYX/o2KTE1j m3kDUsWBGeVK+Fq0poqyfUPgFf+kgJGaq1lmg4mnJzCpRkl2dFEDM3sj1syAwECXhBC5fPyMe8TKm thsGcBOQIwzACsBCgkkKMPsj0t676zWQ1cl+iY07izgc/D8GFcspnSFFkJ+NGAbr458G9s4zqg/aN ZL5Ay03YRw/+B+dp9G6ZsA==; Original-Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1q4yHo-0005Dr-3g; Fri, 02 Jun 2023 02:29:23 -0400 In-Reply-To: <5b541bf1-1d13-ac8e-a91c-e1b238cc6f84@alphapapa.net> (message from Adam Porter on Thu, 1 Jun 2023 15:47:39 -0500) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:306541 Archived-At: > Date: Thu, 1 Jun 2023 15:47:39 -0500 > Cc: adam@alphapapa.net, emacs-devel@gnu.org, yantar92@posteo.net > From: Adam Porter > > plstore looks like an interesting library, but even that looks like more > than the simple solution I'm wishing for. I'm not sure that, as an > application author, I should need to care about which keys in a record > are encrypted or not. I just want to do something simple and Lispy, like: > > (alist-get "@alphapapa:matrix.org" (secure-storage 'ement-sessions)) > > To get my Matrix session's data. Or: > > (map-nested-elt (secure-storage 'ement-sessions) > '("@alphapapa:matrix.org" token)) > > to get that session's token. And then: > > (setf (map-nested-elt (secure-storage 'ement-sessions) > '("@alphapapa:matrix.org" token)) "foobarbaz") > > to write the data to the secure storage. And then the secure-storage > library should automatically handle the encryption/decryption, > filesystem location, backend format, prompting the user for a key and/or > caching it appropriately, etc. > > I think this is the simplest kind of API that could be useful to > applications--and it would be really useful. I see no problems implementing such a simple API on top of plstore.el. But I don't really understand why you would care to use alist-get instead of, say, plstore-get. Why does it matter whether the storage is presented as an alist or as an opaque storage with accessor and setter?