crypto/hkdf: check error in TestFIPSServiceIndicator

I don't know why this code calls panic(err) rather than
t.Fatal(err), but I didn't change it.

Change-Id: I9aa7503c604bd8d4f27cc295e2ec742446906df9
Reviewed-on: https://go-review.googlesource.com/c/go/+/643995
Reviewed-by: Daniel McCarney <daniel@binaryparadox.net>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Reviewed-by: Roland Shoemaker <roland@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Filippo Valsorda <filippo@golang.org>
This commit is contained in:
Ian Lance Taylor 2025-01-23 15:50:32 -08:00 committed by Gopher Robot
parent 7764c502e2
commit 62cd7cb6cd

View file

@ -404,6 +404,9 @@ func TestFIPSServiceIndicator(t *testing.T) {
// Salt and info are short, which is ok, but translates to a short HMAC key. // Salt and info are short, which is ok, but translates to a short HMAC key.
fips140.ResetServiceIndicator() fips140.ResetServiceIndicator()
_, err = Key(sha256.New, []byte("YELLOW SUBMARINE"), []byte("salt"), "info", 32) _, err = Key(sha256.New, []byte("YELLOW SUBMARINE"), []byte("salt"), "info", 32)
if err != nil {
panic(err)
}
if !fips140.ServiceIndicator() { if !fips140.ServiceIndicator() {
t.Error("FIPS service indicator should be set") t.Error("FIPS service indicator should be set")
} }