]> Cypherpunks repositories - gostls13.git/commit
crypto/rsa: add a test walking through every key size
authorFilippo Valsorda <filippo@golang.org>
Sat, 15 Oct 2022 10:06:48 +0000 (12:06 +0200)
committerGopher Robot <gobot@golang.org>
Tue, 15 Nov 2022 17:33:41 +0000 (17:33 +0000)
commit1fcd4e9099c33b4baa74713d5639e61158d10b49
treeaa8e8124734d11e5bb350600c721376a5404873b
parent30b1af00ff142a3f1a5e2a0f32cf04a649bd5e65
crypto/rsa: add a test walking through every key size

We already had some tests for special cases such as PSS with 513 bit
keys. The upcoming backend rewrite also happened to crash at 63 and 504
bits for different reasons. Might as well be systematic about it.

Also, make sure SignPSS returns ErrMessageTooLong like SignPKCS1v15 when
the key is too small, instead of panicking or returning an unnamed error.

-all takes a couple minutes on my M1.

Change-Id: I656239a00d0831fa7d187a6d3bb30341d41602f7
Reviewed-on: https://go-review.googlesource.com/c/go/+/443195
Reviewed-by: Roland Shoemaker <roland@golang.org>
Run-TryBot: Filippo Valsorda <filippo@golang.org>
Reviewed-by: Joedian Reid <joedian@golang.org>
Auto-Submit: Filippo Valsorda <filippo@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
src/crypto/rsa/pss.go
src/crypto/rsa/rsa.go
src/crypto/rsa/rsa_test.go