]> Cypherpunks repositories - gostls13.git/commit
crypto/internal/fips140/rsa: check that e and N are odd
authorFilippo Valsorda <filippo@golang.org>
Thu, 28 Nov 2024 18:55:53 +0000 (19:55 +0100)
committerGopher Robot <gobot@golang.org>
Sat, 30 Nov 2024 01:47:06 +0000 (01:47 +0000)
commitfa38b41be94f66d3d49e10f673643105f44fe540
treebcb714efdd368c728ea7b4a079f06353a0e7a8fc
parentf7475a0af3169d3d91f6071646defcf103393cc0
crypto/internal/fips140/rsa: check that e and N are odd

N needs to be odd or we can't call Nat.Exp with it. This was previously
enforced at the Modulus level, but was relaxed in CL 630515.

While at it, also assert that e is odd. If it's even, there is no
possible corresponding private key, and we might as well error out.

Change-Id: I43a6c6e5789683854e4aece650fbf85166b6c318
Reviewed-on: https://go-review.googlesource.com/c/go/+/632475
Reviewed-by: Russ Cox <rsc@golang.org>
Reviewed-by: Daniel McCarney <daniel@binaryparadox.net>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Roland Shoemaker <roland@golang.org>
Auto-Submit: Filippo Valsorda <filippo@golang.org>
src/crypto/internal/fips140/rsa/rsa.go
src/crypto/rsa/rsa.go