]> Cypherpunks repositories - gostls13.git/commit
crypto/internal/fips140/aes/gcm: don't panic on bad nonces out of FIPS 140-3 mode
authorFilippo Valsorda <filippo@golang.org>
Mon, 8 Dec 2025 23:47:26 +0000 (00:47 +0100)
committerFilippo Valsorda <filippo@golang.org>
Wed, 10 Dec 2025 21:41:55 +0000 (13:41 -0800)
commitcd873cf7e98c3fd3e8138e9d97d6a974a1ee0b53
tree03ddf8ef7d31c4dbdd57ef3d8f1b3472c90ab28d
parent550c0c898b61628aed108aca7d8dbef32458bc09
crypto/internal/fips140/aes/gcm: don't panic on bad nonces out of FIPS 140-3 mode

The enforcement is good beyond compliance if it is correct, but I am
more nervous about accidental DoS due to mismatches between how the
caller calculates a nonce and how the enforcement expects it to be
calculated.

We need to have this enforcement in FIPS 140-3 mode, but no need to blow
ourselves up when it's off.

If all goes well, this code is unreachable anyway.

Change-Id: If73ec59ebbd283b0e5506354961a87a06a6a6964
Reviewed-on: https://go-review.googlesource.com/c/go/+/728504
Auto-Submit: Filippo Valsorda <filippo@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Roland Shoemaker <roland@golang.org>
Reviewed-by: David Chase <drchase@google.com>
src/crypto/cipher/gcm_fips140v2.0_test.go
src/crypto/cipher/gcm_test.go
src/crypto/internal/fips140/aes/gcm/gcm_nonces.go