From: Pavel Machek Subject: Re: [PATCH 17/18] Hibernate: introduced SNAPSHOT_SIG_HASH config for select hash algorithm Date: Sun, 25 Aug 2013 18:43:29 +0200 Message-ID: <20130825164329.GL5171@amd.pavel.ucw.cz> References: <1377169317-5959-1-git-send-email-jlee@suse.com> <1377169317-5959-18-git-send-email-jlee@suse.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-security-module-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-efi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-pm-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-crypto-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, opensuse-kernel-stAJ6ESoqRxg9hUCZPvPmw@public.gmane.org, David Howells , "Rafael J. Wysocki" , Matthew Garrett , Len Brown , Josh Boyer , Vojtech Pavlik , Matt Fleming , James Bottomley , Greg KH , JKosina-IBi9RG/b67k@public.gmane.org, Rusty Russell , Herbert Xu , "David S. Miller" , "H. Peter Anvin" , Michal Marek , Gary Lin , Vivek Goyal , "Lee, Chun-Yi" To: "Lee, Chun-Yi" Return-path: Content-Disposition: inline In-Reply-To: <1377169317-5959-18-git-send-email-jlee-IBi9RG/b67k@public.gmane.org> Sender: linux-efi-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org List-Id: linux-crypto.vger.kernel.org On Thu 2013-08-22 19:01:56, Lee, Chun-Yi wrote: > This patch introduced SNAPSHOT_SIG_HASH config for user to select which > hash algorithm will be used during signature generation of snapshot. > > v2: > Add define check of oCONFIG_SNAPSHOT_VERIFICATION in snapshot.c before > declare pkey_hash(). > > Reviewed-by: Jiri Kosina > Signed-off-by: Lee, Chun-Yi > --- > kernel/power/Kconfig | 46 ++++++++++++++++++++++++++++++++++++++++++++++ > kernel/power/snapshot.c | 27 ++++++++++++++++++++++----- > 2 files changed, 68 insertions(+), 5 deletions(-) > > diff --git a/kernel/power/Kconfig b/kernel/power/Kconfig > index b592d88..79b34fa 100644 > --- a/kernel/power/Kconfig > +++ b/kernel/power/Kconfig > @@ -78,6 +78,52 @@ config SNAPSHOT_VERIFICATION > dependent on UEFI environment. EFI bootloader should generate the > key-pair. > > +choice > + prompt "Which hash algorithm should snapshot be signed with?" > + depends on SNAPSHOT_VERIFICATION > + help > + This determines which sort of hashing algorithm will be used during > + signature generation of snapshot. This algorithm _must_ be built into > + the kernel directly so that signature verification can take place. > + It is not possible to load a signed snapshot containing the algorithm > + to check the signature on that module. Like if 1000 ifdefs you already added to the code are not enough, you make some new ones? Pavel -- (english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html