From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1U0tgC-0006jc-L9 for mharc-grub-devel@gnu.org; Thu, 31 Jan 2013 07:55:48 -0500 Received: from eggs.gnu.org ([208.118.235.92]:40997) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U0tg7-0006Vk-On for grub-devel@gnu.org; Thu, 31 Jan 2013 07:55:46 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1U0tg6-0005NV-IQ for grub-devel@gnu.org; Thu, 31 Jan 2013 07:55:43 -0500 Received: from mail-lb0-f171.google.com ([209.85.217.171]:40391) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U0tg6-0005NA-Aw for grub-devel@gnu.org; Thu, 31 Jan 2013 07:55:42 -0500 Received: by mail-lb0-f171.google.com with SMTP id gg13so3354689lbb.30 for ; Thu, 31 Jan 2013 04:55:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:date:from:to:subject:message-id:in-reply-to:references :x-mailer:mime-version:content-type; bh=lTsCdH9crYV0imE2G68LfKkSEQugpHS0PTYV+hPh6Hs=; b=ZgUdT6vnjyFeKFM0ITUaemJAlB1J4wWMpXAD2kV7Bl5YYfMoJrboGXNzU232B56c8d xZzxx7kZ3TlWk1tAkNbf0103SfkSvMKWR3HcKn3oUx+7ggYYMjRI2eoDY9GvR7Wlcow4 JX4N+l9vQRg8L5I85inVjQRcbzdD5oIFI2yLY894UE3HPezblLD2BfX0GGMKv5j7X7Z4 KWgBKmNdl8gnrgBF5zfQdNxzk67Ujl/MLhbo+5cIUmHvALXpjO7jDqqWPSy9Xuc0InR9 yc8Flp2hWvObIv9I2Znrql3aqjZU0rkFqIeSWw5rOTFyf4i6xH6cqGh15jLwMP1CTQlZ WdCg== X-Received: by 10.152.144.202 with SMTP id so10mr7856747lab.9.1359636559093; Thu, 31 Jan 2013 04:49:19 -0800 (PST) Received: from opensuse.site (ppp91-78-198-46.pppoe.mtu-net.ru. [91.78.198.46]) by mx.google.com with ESMTPS id pk1sm2395236lab.0.2013.01.31.04.49.17 (version=SSLv3 cipher=RC4-SHA bits=128/128); Thu, 31 Jan 2013 04:49:18 -0800 (PST) Date: Thu, 31 Jan 2013 16:49:15 +0400 From: Andrey Borzenkov To: grub-devel@gnu.org Subject: Re: DSA GnuPG signatures Message-ID: <20130131164915.2b90aeed@opensuse.site> In-Reply-To: <50F07BFE.4050800@gmail.com> References: <50F07BFE.4050800@gmail.com> X-Mailer: Claws Mail 3.9.0 (GTK+ 2.24.10; x86_64-suse-linux-gnu) Mime-Version: 1.0 Content-Type: multipart/signed; micalg=PGP-SHA1; boundary="Sig_/1=dkYjA7zKB6a1.SUgHKYpv"; protocol="application/pgp-signature" X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 209.85.217.171 X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: The development of GNU GRUB List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 31 Jan 2013 12:55:46 -0000 --Sig_/1=dkYjA7zKB6a1.SUgHKYpv Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable =D0=92 Fri, 11 Jan 2013 21:54:22 +0100 Vladimir '=CF=86-coder/phcoder' Serbinenko =D0=BF=D0=B8= =D1=88=D0=B5=D1=82: > Hello, all. I've just committed import of libgcrypt and implementation > of related code to check signatures. Short usage: > verify_detached FILE FILE.sig [pubkey.gpg] > trust KEY.gpg > distruct KEYID > check_signatures=3D[enforce|no] >=20 > grub-mkimage -k KEY gcry_dsa verify [...] >=20 > When check_signatures=3Denforce every time anthing tries to open a file > its signature (file.sig) is looked for and the open fails if signature > is absent or invalid. There is no protection against file modification after signature was verified. Is it intentional (i.e. it is not considered as viable threat)? One possibility is to cache file in memory on first open, which ensures it cannot be modified externally. > Some limitations: > 1) DSA keys only. RSA is more tricky since it needs padding and RSA > should be progressively phased out, not put into new places due to some > vulnerabilities (large classes of semiprimes are factorisable up to the > point when a lot of care has to be taken to avoid them). > 2) Not efficient. Checking every file is slow. Some hashlists should be > implemented. > 3) Not efficient. File is read twice though it's avoidable in many cases. --Sig_/1=dkYjA7zKB6a1.SUgHKYpv Content-Type: application/pgp-signature; name=signature.asc Content-Disposition: attachment; filename=signature.asc -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (GNU/Linux) iEYEARECAAYFAlEKaEsACgkQR6LMutpd94zbQQCgnAbm70u1pphV8aG4OnvTCA0i 5bcAoKIsk09w9inRcq7H9nwI504r5frP =ks5L -----END PGP SIGNATURE----- --Sig_/1=dkYjA7zKB6a1.SUgHKYpv--