Received: from list by lists.gnu.org with archive (Exim 4.90_1) id 1iRZcm-0000GC-37 for mharc-grub-devel@gnu.org; Mon, 04 Nov 2019 05:30:16 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:52948) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iRZce-0000FE-OR for grub-devel@gnu.org; Mon, 04 Nov 2019 05:30:13 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iRZcc-0001nE-Tr for grub-devel@gnu.org; Mon, 04 Nov 2019 05:30:08 -0500 Received: from mx0a-00190b01.pphosted.com ([2620:100:9001:583::1]:11074) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1iRZcb-0001mM-Rz for grub-devel@gnu.org; Mon, 04 Nov 2019 05:30:06 -0500 Received: from pps.filterd (m0122332.ppops.net [127.0.0.1]) by mx0a-00190b01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id xA4AHpBV001087; Mon, 4 Nov 2019 10:30:04 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=akamai.com; h=date : from : to : cc : subject : message-id : references : mime-version : content-type : in-reply-to; s=jan2016.eng; bh=/mAyvyOinuC+e6S0bYcVNCE+REX71xIRglj4ZllYAjs=; b=BpYPuspIkP7kFnAVwLynF2EnwJfc3uBQuA8HSjeb8/Bpjx7QXz3J5YDtCWs+5XaTj2J9 OVgsMt/BW8dhx5kr0CvMnke0Oy8IizBQakWYJWCNX10mi0rUNXDPLBNcEAyS1FEK+1qU hD73vWD3cgRH0tsKdg/oabXfUw+/pPTkU8Og19eyrTeorDlWVurXgE2NrLExJRxDAyo8 l6U1DrBQqBkAOkdORwktzKOaL9ogVSjra0Kr6A0e17s1crtY9mZ+8uQaEQKKL8DVAX0r NXvtxqcsZwtkkrj8dMmicLvYLCStF3Nt/kWruphNFJzjnBgdGpdKV2JqvSmLsBhV10qX uQ== Received: from prod-mail-ppoint2 (prod-mail-ppoint2.akamai.com [184.51.33.19] (may be forged)) by mx0a-00190b01.pphosted.com with ESMTP id 2w12qp06t7-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 04 Nov 2019 10:30:04 +0000 Received: from pps.filterd (prod-mail-ppoint2.akamai.com [127.0.0.1]) by prod-mail-ppoint2.akamai.com (8.16.0.27/8.16.0.27) with SMTP id xA4A7ZOn029006; Mon, 4 Nov 2019 05:30:03 -0500 Received: from email.msg.corp.akamai.com ([172.27.123.57]) by prod-mail-ppoint2.akamai.com with ESMTP id 2w154wfnsf-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Mon, 04 Nov 2019 05:30:02 -0500 Received: from USMA1EX-DAG1MB5.msg.corp.akamai.com (172.27.123.105) by usma1ex-dag3mb6.msg.corp.akamai.com (172.27.123.54) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Mon, 4 Nov 2019 05:30:02 -0500 Received: from USMA1EX-CAS2.msg.corp.akamai.com (172.27.123.31) by usma1ex-dag1mb5.msg.corp.akamai.com (172.27.123.105) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Mon, 4 Nov 2019 05:30:01 -0500 Received: from lon-lp55b.london.corp.akamai.com (172.29.67.77) by USMA1EX-CAS2.msg.corp.akamai.com (172.27.123.31) with Microsoft SMTP Server id 15.0.1473.3 via Frontend Transport; Mon, 4 Nov 2019 05:30:01 -0500 Received: by lon-lp55b.london.corp.akamai.com (Postfix, from userid 37336) id A8CD1E00A6; Mon, 4 Nov 2019 10:30:01 +0000 (GMT) Date: Mon, 4 Nov 2019 10:30:01 +0000 From: Max Tottenham To: The development of GNU GRUB CC: Patrick Steinhardt Subject: Re: [PATCH 3/6] bootstrap: Add gnulib's base64 module Message-ID: <20191104103000.GB923@akamai.com> References: <886d2a055eed285759cff7cc9272116a8934f3d3.1572717208.git.ps@pks.im> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <886d2a055eed285759cff7cc9272116a8934f3d3.1572717208.git.ps@pks.im> User-Agent: Mutt/1.9.4 (2018-02-28) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2019-11-04_06:, , signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1908290000 definitions=main-1911040101 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.95,1.0.8 definitions=2019-11-04_07:2019-11-04,2019-11-04 signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxlogscore=999 mlxscore=0 adultscore=0 suspectscore=0 bulkscore=0 phishscore=0 spamscore=0 clxscore=1015 priorityscore=1501 impostorscore=0 malwarescore=0 lowpriorityscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-1908290000 definitions=main-1911040101 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] X-Received-From: 2620:100:9001:583::1 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: Mon, 04 Nov 2019 10:30:14 -0000 On 11/02, Patrick Steinhardt wrote: > The upcoming support for LUKS2 disc encryption requires us to include a > parser for base64-encoded data, as it is used to represent salts and > digests. As gnulib already has code to decode such data, we can just > add it to the boostrapping configuration in order to make it available > in GRUB. > > The gnulib module makes use of booleans via the header. As > GRUB does not provide any POSIX wrapper header for this, but instead > implements support for `bool` in , we need to patch > base64.h to not use anymore. We unfortunately cannot include > instead, as it would then use gnulib's internal header > while compiling the gnulib object but our own when > including it in a GRUB module. Because of this, the patch replaces the > include with a direct typedef. > > Signed-off-by: Patrick Steinhardt > --- > bootstrap.conf | 3 ++- > conf/Makefile.extra-dist | 1 + > grub-core/lib/gnulib-patches/fix-base64.patch | 26 +++++++++++++++++++ > 3 files changed, 29 insertions(+), 1 deletion(-) > create mode 100644 grub-core/lib/gnulib-patches/fix-base64.patch > > diff --git a/bootstrap.conf b/bootstrap.conf > index 988dda099..22b908f36 100644 > --- a/bootstrap.conf > +++ b/bootstrap.conf > @@ -23,6 +23,7 @@ GNULIB_REVISION=d271f868a8df9bbec29049d01e056481b7a1a263 > # directly. > gnulib_modules=" > argp > + base64 > error > fnmatch > getdelim > @@ -78,7 +79,7 @@ cp -a INSTALL INSTALL.grub > > bootstrap_post_import_hook () { > set -e > - for patchname in fix-null-deref fix-width no-abort; do > + for patchname in fix-base64 fix-null-deref fix-width no-abort; do > patch -d grub-core/lib/gnulib -p2 \ > < "grub-core/lib/gnulib-patches/$patchname.patch" > done > diff --git a/conf/Makefile.extra-dist b/conf/Makefile.extra-dist > index 46c4e95e2..32b217853 100644 > --- a/conf/Makefile.extra-dist > +++ b/conf/Makefile.extra-dist > @@ -28,6 +28,7 @@ EXTRA_DIST += grub-core/gensymlist.sh > EXTRA_DIST += grub-core/genemuinit.sh > EXTRA_DIST += grub-core/genemuinitheader.sh > > +EXTRA_DIST += grub-core/lib/gnulib-patches/fix-base64.patch > EXTRA_DIST += grub-core/lib/gnulib-patches/fix-null-deref.patch > EXTRA_DIST += grub-core/lib/gnulib-patches/fix-width.patch > EXTRA_DIST += grub-core/lib/gnulib-patches/no-abort.patch > diff --git a/grub-core/lib/gnulib-patches/fix-base64.patch b/grub-core/lib/gnulib-patches/fix-base64.patch > new file mode 100644 > index 000000000..392f21fb1 > --- /dev/null > +++ b/grub-core/lib/gnulib-patches/fix-base64.patch > @@ -0,0 +1,26 @@ > +diff --git a/lib/base64.h b/lib/base64.h > +index 9cd0183b8..7b06e03df 100644 > +--- a/lib/base64.h > ++++ b/lib/base64.h > +@@ -21,8 +21,10 @@ > + /* Get size_t. */ > + # include > + > +-/* Get bool. */ > +-# include > ++#ifndef GRUB_POSIX_BOOL_DEFINED > ++typedef enum { false = 0, true = 1 } bool; > ++#define GRUB_POSIX_BOOL_DEFINED 1 > ++#endif > + > + # ifdef __cplusplus > + extern "C" { > +@@ -38,7 +40,7 @@ struct base64_decode_context > + char buf[4]; > + }; > + > +-extern bool isbase64 (char ch) _GL_ATTRIBUTE_CONST; > ++extern bool isbase64 (char ch); Is there a reason the const attribute has been removed from this function in this patch? If so then I think you should add a rationale for that in your commit message. > + > + extern void base64_encode (const char *restrict in, size_t inlen, > + char *restrict out, size_t outlen); > -- > 2.23.0 > > > _______________________________________________ > Grub-devel mailing list > Grub-devel@gnu.org > https://lists.gnu.org/mailman/listinfo/grub-devel -- Max Tottenham | mtottenh@akamai.com Senior Software Engineer, Server Platform Engineering /(* Akamai Technologies