]> Cypherpunks repositories - gostls13.git/commit
crypto/rsa: check CRT result.
authorAdam Langley <agl@golang.org>
Wed, 16 Dec 2015 00:07:47 +0000 (19:07 -0500)
committerAdam Langley <agl@golang.org>
Thu, 17 Dec 2015 00:00:33 +0000 (00:00 +0000)
commit40ac3690efe420ff7665c6fe1eec0933c41d1413
treee85810f95707591fd099f749640a1bc5c538a5ac
parentf33f9b2ceeaa96df617871dee77fd52e94e4fc3e
crypto/rsa: check CRT result.

This change adds a check after computing an RSA signature that the
signature is correct. This prevents an error in the CRT computation from
leaking the private key. See references in the linked bug.

benchmark                  old ns/op     new ns/op     delta
BenchmarkRSA2048Sign-3     5713305       6225215       +8.96%

Fixes #12453

Change-Id: I1f24e0b542f7c9a3f7e7ad4e971db3dc440ed3c1
Reviewed-on: https://go-review.googlesource.com/17862
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Robert Griesemer <gri@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
src/crypto/rsa/pkcs1v15.go
src/crypto/rsa/pss.go
src/crypto/rsa/rsa.go
src/crypto/rsa/rsa_test.go