From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.90_1) id 1k1Xnj-0001jw-M9 for mharc-grub-devel@gnu.org; Fri, 31 Jul 2020 12:22:32 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34790) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1k1Xng-0001jl-SG for grub-devel@gnu.org; Fri, 31 Jul 2020 12:22:28 -0400 Received: from mail-pg1-x544.google.com ([2607:f8b0:4864:20::544]:40692) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1k1Xne-0007sp-KZ for grub-devel@gnu.org; Fri, 31 Jul 2020 12:22:28 -0400 Received: by mail-pg1-x544.google.com with SMTP id h12so4924247pgf.7 for ; Fri, 31 Jul 2020 09:22:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=efficientek-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:in-reply-to:references:reply-to :mime-version:content-transfer-encoding; bh=fJ/8+vUMxhuEqqpqsHa7aABOEpP7JzqjUzcL+/dQEbs=; b=ga3LwCiS37F+e6eem3W64+dRQZBs1uZFX/85UhItL/DxEvedeqOz61Sah070DCL81q Im9Fq9duVvV8l/CzDsetQXclf7RS7CeELnRfvEkiQ7xd/S04/Nm7vv6Es/IX2JJ+1BkR +QP4FP7yqWpYFfMQSN9b6e8cpydFNL1EpXzQf441i+sk6PwJpdfZbzywUCBZc0UN1gw0 y7v4BuNuaXN3hwokOfMYtveUllk7IbH9CNpE0rN9LrDQ6Jnn4GNVRPa6a/iyXoJF41/p MWAqYG4uhqYLTTTwBginEZUZ5b73jKOma1YZtnEu7pe/4uWKs++N99ykjzyje4pwkEEE b87Q== 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:cc:subject:message-id:in-reply-to :references:reply-to:mime-version:content-transfer-encoding; bh=fJ/8+vUMxhuEqqpqsHa7aABOEpP7JzqjUzcL+/dQEbs=; b=hQlap65CziCNcxj+Uky+gf0DwAe1/h6I01epKtrQcNClFd3nOLbcI72n2VqCqD0/kv m3x9CaSEI3wMZZrrfwQnDwcm0wfAn6g0GL3oXeXh1Oke22+DJooiaJ2oBaV9sRx9FXSx ca5ZSXAH5wGM9BNenpOWVXHhaiAMMc+AY8q9KIsEG+sC/IZEl2h9YOuWRCFfKdqkUIyW XxPznKdK5puFWt7Kw2dYfDP4nxqzCOlcBEXcE/ZeaLQcQGSThRgauO+oJcnVCGqURt7z 6qWX8nf/FeKa55RfSLIKUEy3QCJGjl9ahbeHA0b9EDw2KElDuaAaf5bYnnh7C/LhdMyz LR+A== X-Gm-Message-State: AOAM532CG94qyuP55kgW17faUhCVIPeW9HBdgSUodx2UeswmsWBQgFSx mjyPv6rzBoguDSPnIN17M4vHBg== X-Google-Smtp-Source: ABdhPJyugsZ5Hoprj4iHuNGV2NmK8TXmPy1neD7lCSzEs89wi4EVvHbFvU9WkIxRGIUFpkByj4WKOQ== X-Received: by 2002:a63:1c23:: with SMTP id c35mr4250557pgc.91.1596212544375; Fri, 31 Jul 2020 09:22:24 -0700 (PDT) Received: from crass-HP-ZBook-15-G2 ([189.216.105.24]) by smtp.gmail.com with ESMTPSA id d93sm9672047pjk.44.2020.07.31.09.22.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 31 Jul 2020 09:22:24 -0700 (PDT) Date: Fri, 31 Jul 2020 11:22:15 -0500 From: Glenn Washburn To: Patrick Steinhardt Cc: grub-devel@gnu.org, Daniel Kiper Subject: Re: [CRYPTO-LUKS v1 15/19] cryptodisk,luks2: Add header line to procfs entry and crypto and source device names. Message-ID: <20200731111941.3402e5c4@crass-HP-ZBook-15-G2> In-Reply-To: <20200731153746.GB11731@tanuki.pks.im> References: <71fcd8e9e2d3b7b3ab3093d9a512a6045a058b30.1596196383.git.development@efficientek.com> <20200731153746.GB11731@tanuki.pks.im> Reply-To: development@efficientek.com X-Mailer: Claws Mail 3.17.4 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Received-SPF: pass client-ip=2607:f8b0:4864:20::544; envelope-from=development@efficientek.com; helo=mail-pg1-x544.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 Jul 2020 16:22:29 -0000 On Fri, 31 Jul 2020 17:37:46 +0200 Patrick Steinhardt wrote: > On Fri, Jul 31, 2020 at 07:01:56AM -0500, Glenn Washburn wrote: > > A header line is added to luks_script for easier comprehension of > > fields by user. And the crypto disk name and source device names > > are added. > > > > Signed-off-by: Glenn Washburn > > --- > > grub-core/disk/cryptodisk.c | 28 ++++++++++++++++++++++------ > > 1 file changed, 22 insertions(+), 6 deletions(-) > > > > diff --git a/grub-core/disk/cryptodisk.c > > b/grub-core/disk/cryptodisk.c index 9399849b6..2c6e73b39 100644 > > --- a/grub-core/disk/cryptodisk.c > > +++ b/grub-core/disk/cryptodisk.c > > @@ -1206,35 +1206,48 @@ hex (grub_uint8_t val) > > } > > > > /* Open a file named NAME and initialize FILE. */ > > +#define STR(s) #s > > +#define MAX_ID_PRINT 10000 > > static char * > > luks_script_get (grub_size_t *sz) > > { > > grub_cryptodisk_t i; > > grub_size_t size = 0; > > char *ptr, *ret; > > + const char header[] = N_(" > > > + "offset> > > \n"); > > + static char errmsg[] = N_("Can not list more than " > > STR(MAX_ID_PRINT) > > + " crypto devices.\n"); > > Not sure, but this seems like a backwards-incompatible change to me, > right? In case anybody has been looping over this list, he'll not know > to skip the first line. > > Patrick Yes, it is backwards-incompatible. How likely do you think it is that anyone would be doing pragmatically reading that data? As far as I know the grub environment isn't powerful enough to do that. I doubt anyone writing modules would, since they'd just use the internal data structures instead. So that leaves getting that data through the serial port (am I missing something?). Perhaps as part of some automated test harness? I've also added extra fields to each line, which would be considered backwards-incompatible. Also, this change should make future additions more backward-incompatible proof as the header fields make the output more like an associative array and you can choose your fields by field name. Glenn