Skip to content

Commit fce17b0

Browse files
tmthrgdgopherbot
authored andcommitted
crypto/internal/fips140/ecdsa: fix reseed_counter check for HMAC_DRBG_Generate_algorithm
SP 800-90A Rev. 1 10.1.2.5 step 7 requires reseed_counter = reseed_counter + 1 as the final step before returning SUCCESS. This increment of reseedCounter was missing, meaning the reseed interval check at the start of Generate wasn't actually functional. Given how it's used, and that it has a reseed interval of 2^48, this condition will never actually occur but the check is still required by the standard. For #69536 Change-Id: I314a7eee5852e6d0fa1a0a04842003553cd803e7 Reviewed-on: https://go-review.googlesource.com/c/go/+/634775 Reviewed-by: Carlos Amedee <[email protected]> LUCI-TryBot-Result: Go LUCI <[email protected]> Auto-Submit: Filippo Valsorda <[email protected]> Reviewed-by: Filippo Valsorda <[email protected]> Reviewed-by: Michael Knyszek <[email protected]>
1 parent d87878c commit fce17b0

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/crypto/internal/fips140/ecdsa/hmacdrbg.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,4 +160,6 @@ func (d *hmacDRBG) Generate(out []byte) {
160160
d.hK = d.newHMAC(K)
161161
d.hK.Write(d.V)
162162
d.V = d.hK.Sum(d.V[:0])
163+
164+
d.reseedCounter++
163165
}

0 commit comments

Comments
 (0)