From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41866) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZoDIb-0000rV-GU for qemu-devel@nongnu.org; Mon, 19 Oct 2015 12:28:38 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZoDIa-0000o3-Lx for qemu-devel@nongnu.org; Mon, 19 Oct 2015 12:28:37 -0400 References: <1445267389-21846-1-git-send-email-berrange@redhat.com> <1445267389-21846-2-git-send-email-berrange@redhat.com> <562509E0.7060608@redhat.com> <20151019152408.GC17892@redhat.com> <56250ED8.2000406@redhat.com> <20151019154627.GD17892@redhat.com> <56251685.9050806@redhat.com> <20151019162425.GF17892@redhat.com> From: Paolo Bonzini Message-ID: <56251A2A.90504@redhat.com> Date: Mon, 19 Oct 2015 18:28:26 +0200 MIME-Version: 1.0 In-Reply-To: <20151019162425.GF17892@redhat.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 01/17] crypto: add QCryptoSecret object class for password/key handling List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Daniel P. Berrange" Cc: Kevin Wolf , Ronnie Sahlberg , qemu-block@nongnu.org, Markus Armbruster , qemu-devel@nongnu.org, Stefan Hajnoczi On 19/10/2015 18:24, Daniel P. Berrange wrote: > The input format, eg the encoding of the data=XXXX value, or the contents > of the file, and the output format, which is that required by the consumer > inside QEMU. We convert between the two. eg you can provide data in base64 > even if QEMU ultimately needs to use it in plain utf-8 format, or vica-verca. Right. In the end QCryptoSecret only needs to provide a raw output; converting it to something else, and possibly applying restrictions such as UTF-8, should depend on the user. Of course the API can include helper functions for common restrictions, but in general a "secret storage" module is independent of them. > IIUC, you're suggesting that for the input format, the data=XXX value > should allow a choice of utf8 or base64, while the external file could > just take raw or base64 data. That's easy enough to wire up - just add > a 3rd option to the format enum and make raw be the default for files. Almost. I am also saying that the utf8 case for data=XXX actually should be raw, because utf8 is just a limitation of JSON and not of the data=XXX interface. Non-UTF8 data=XXX would then be accepted for the -object command line option. Paolo