Skip to content

FIPS refusals returned as success: short-key HMAC forgery #90

Closed

Description

@MarkAtwood

On FIPS builds, refused operations (GNUTLS_FIPS140_OP_NOT_APPROVED and other positive values) are returned to gnutls as success.

  • With an HMAC key under 14 bytes, gnutls_hmac returns 0 without computing a MAC. The output equals HMAC with an all-zero key: keys "Jefe", "Jeff" and "anything" give the same tag, so a forged tag verifies.
  • The same flaw is in the HKDF, PBKDF2 and RSA keygen error paths, and four curve checks return 0.
  • Separately, CMAC/GMAC setkey frees a context that gnutls frees again (use-after-free and double free on a failed key setup).

Fixes and test (RFC 4231 TC2 with a 4-byte key): #87 (closed in favour of this issue).

Activity

  1. self-assigned this
    on Oct 8, 2026
  2. gasbytes commented on Oct 15, 2026

    @gasbytes
    Contributor

    fixed by #92

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

Metadata

Metadata

Assignees

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