]> Cypherpunks repositories - gostls13.git/commit
crypto/x509: avoid crypto/rand.Int to generate serial number
authorFilippo Valsorda <filippo@golang.org>
Wed, 22 Jan 2025 12:42:33 +0000 (13:42 +0100)
committerGopher Robot <gobot@golang.org>
Fri, 28 Feb 2025 16:54:13 +0000 (08:54 -0800)
commit6e8d7a113cc0f2cf59e0f67f86476cb003881a68
treee876710fc7ee0c58fb1839089205a80f8dea05c2
parent555974734fa9c6ed88fa16d25e2ad6ee398cf085
crypto/x509: avoid crypto/rand.Int to generate serial number

It's probabyl safe enough, but just reading bytes from rand and then
using SetBytes is simpler, and doesn't require allowing calls from
crypto into math/big's Lsh, Sub, and Cmp.

Change-Id: I6a6a4656761f7073f9e149f288c48e97048ab13c
Reviewed-on: https://go-review.googlesource.com/c/go/+/643278
Auto-Submit: Filippo Valsorda <filippo@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: Daniel McCarney <daniel@binaryparadox.net>
Reviewed-by: Roland Shoemaker <roland@golang.org>
src/crypto/x509/x509.go