Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
crypto/rsa: check for primes ≤ 1 in Validate
Change 7c7126c removed the primality checking in Validate to save CPU time. That check happened to be filtering out private keys with primes that were zero or one. Without that filtering, such primes cause a panic when trying to use such a private key. This change specifically checks for and rejects primes ≤ 1 in Validate. Fixes golang#11233. Change-Id: Ie6537edb8250c07a45aaf50dab43227002ee7386 Reviewed-on: https://go-review.googlesource.com/11611 Reviewed-by: Brad Fitzpatrick <[email protected]> Reviewed-by: Russ Cox <[email protected]>
- Loading branch information