[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAOi1vP8DuaVr=A7gg54RutSgoudOjnH70n9Q4=gLukRWJ5OHiA@mail.gmail.com>
Date: Mon, 8 Sep 2025 11:32:34 +0200
From: Ilya Dryomov <idryomov@...il.com>
To: Eric Biggers <ebiggers@...nel.org>
Cc: ceph-devel@...r.kernel.org, Xiubo Li <xiubli@...hat.com>,
linux-crypto@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] libceph: Use HMAC-SHA256 library instead of crypto_shash
On Thu, Sep 4, 2025 at 7:26 PM Eric Biggers <ebiggers@...nel.org> wrote:
>
> On Thu, Sep 04, 2025 at 12:24:08PM +0200, Ilya Dryomov wrote:
> > > - if (con->v2.hmac_tfm) {
> > > - crypto_free_shash(con->v2.hmac_tfm);
> > > - con->v2.hmac_tfm = NULL;
> > > - }
> > > + memzero_explicit(&con->v2.hmac_key, sizeof(con->v2.hmac_key));
> > > + con->v2.hmac_key_set = false;
> >
> > Hi Eric,
> >
> > Since we have hmac_key_set anyway, could the call to memzero_explicit()
> > be conditioned on it?
>
> If you want. It's less code to just do it unconditionally.
Double checking the surrounding code, the only case where hmac_key_set
would remain false is auth_none protocol (i.e. no authentication at the
Ceph level at all). This is extremely rare, so I'm leaving the patch
as is.
Thanks,
Ilya
Powered by blists - more mailing lists