Re: [PATCH] libceph: Use HMAC-SHA256 library instead of crypto_shash

Eric Biggers
2025-09-04T17:26:00Z

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.

- Eric