Skip to content

hmac: clearing key material for secret keys — is there an upstream way? #289

Open

Description

@arynyklas

Hi! In OpenNCALayer we use hmac with streebog for GOST key agreement and key wrap, where the HMAC key is a secret. We currently carry a patch (commit) that adds a secret-input feature: an HMAC core variant that clears the normalized key block, the ipad/opad block and the inner digest on drop. The normal Hmac path is unchanged.

We would much rather not keep a fork of a crypto crate. I saw #287 (ZeroizeOnDrop for HMAC cores). Questions:

  • With zeroize enabled and a hash core that zeroizes on drop, is the key material (normalized key, ipad/opad) already cleared, so our variant is unnecessary?
  • If not, is this something you'd want upstream, and in what shape?

Any reasons why this approach is a bad idea are very welcome too.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions