[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAMj1kXHg2RDgwmOhJkaAPoWeHpxnd6tixp94Kha1-bzNvCaQUg@mail.gmail.com>
Date: Tue, 30 Mar 2021 21:45:18 +0200
From: Ard Biesheuvel <ardb@...nel.org>
To: Simo Sorce <simo@...hat.com>
Cc: "Rafael J. Wysocki" <rafael@...nel.org>,
Dexuan Cui <decui@...rosoft.com>,
"linux-pm@...r.kernel.org" <linux-pm@...r.kernel.org>,
"crecklin@...hat.com" <crecklin@...hat.com>,
"linux-crypto@...r.kernel.org" <linux-crypto@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: Fix hibernation in FIPS mode?
On Tue, 30 Mar 2021 at 20:05, Simo Sorce <simo@...hat.com> wrote:
>
> On Tue, 2021-03-30 at 16:46 +0200, Rafael J. Wysocki wrote:
> > On Tue, Mar 30, 2021 at 12:14 AM Dexuan Cui <decui@...rosoft.com> wrote:
> > > Hi,
> > > MD5 was marked incompliant with FIPS in 2009:
> > > a3bef3a31a19 ("crypto: testmgr - Skip algs not flagged fips_allowed in fips mode")
> > > a1915d51e8e7 ("crypto: testmgr - Mark algs allowed in fips mode")
> > >
> > > But hibernation_e820_save() is still using MD5, and fails in FIPS mode
> > > due to the 2018 patch:
> > > 749fa17093ff ("PM / hibernate: Check the success of generating md5 digest before hibernation")
> > >
> > > As a result, hibernation doesn't work when FIPS is on.
> > >
> > > Do you think if hibernation_e820_save() should be changed to use a
> > > FIPS-compliant algorithm like SHA-1?
> >
> > I would say yes, it should.
> >
> > > PS, currently it looks like FIPS mode is broken in the mainline:
> > > https://www.mail-archive.com/linux-crypto@vger.kernel.org/msg49414.html
>
>
> FYI, SHA-1 is not a good choice, it is only permitted in HMAC
> constructions and only for specified uses. If you need to change
> algorithm you should go straight to SHA-2 or SHA-3 based hashes.
>
What is the reason for using a [broken] cryptographic hash here? if
this is just an integrity check, better use CRC32
Powered by blists - more mailing lists