]> Cypherpunks repositories - gostls13.git/commit
crypto: use rand.IsDefaultReader instead of comparing to boring.RandReader
authorqmuntal <quimmuntal@gmail.com>
Wed, 3 Dec 2025 10:20:41 +0000 (11:20 +0100)
committerQuim Muntal <quimmuntal@gmail.com>
Thu, 4 Dec 2025 16:39:49 +0000 (08:39 -0800)
commit1681c3b67fe5f95377fd33b98dc1f7007cf28acf
treed253b53b54c6de218266a68d6b10cb2f26078a58
parent7b67b68a0da091be2d7dc3e69c4df9a1a080d0de
crypto: use rand.IsDefaultReader instead of comparing to boring.RandReader

Several crypto functions accepting a rand parameter skip calling
boringcrypto when the rand is not boring.RandReader.

The new crypto/internal/rand package currently defines its own Reader
that wraps boring.RandReader. That will unintentionally bypass
boringcrypto when used with the aforementioned functions.

Fixes #76672

Change-Id: Ie0c1345530c734a23815f9593590b5d32604f54d
Reviewed-on: https://go-review.googlesource.com/c/go/+/726220
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: Filippo Valsorda <filippo@golang.org>
Reviewed-by: Roland Shoemaker <roland@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
src/crypto/ecdh/nist.go
src/crypto/ecdsa/ecdsa.go
src/crypto/ed25519/ed25519.go
src/crypto/internal/rand/rand.go
src/crypto/rand/rand.go
src/crypto/rsa/fips.go
src/crypto/rsa/pkcs1v15.go
src/crypto/rsa/rsa.go