go/src/crypto/rsa
Roland Shoemaker 61ed6d5c33 crypto/rsa,crypto/internal/boring: fix PSS salt handling
Fix the coversion between our sentinel salt length variables and the
BoringSSL versions in SignRSAPSS. We previously set -1 (hash length
equals salt length) when 0 was passed when we should've been setting
-2. This now matches the conversion that happens in VerifyRSAPSS. Also
adds a note documenting why we do this.

Additionally in non-Boring mode, properly handle passing of salt lengths
with a negative value which aren't one of the magic constants, returning
an error instead of panicking.

See https://commondatastorage.googleapis.com/chromium-boringssl-docs/rsa.h.html#RSA_sign_pss_mgf1
for the BoringSSL docs.

Fixes #54803

Change-Id: Id1bd14dcf0ef4733867367257830ed43e25ef882
Reviewed-on: https://go-review.googlesource.com/c/go/+/426659
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Damien Neil <dneil@google.com>
Run-TryBot: Roland Shoemaker <roland@golang.org>
2022-09-27 23:19:20 +00:00
..
testdata
boring.go crypto/internal/boring/bcache: make Cache type-safe using generics 2022-08-18 00:30:19 +00:00
boring_test.go [dev.boringcrypto] crypto/ecdsa, crypto/rsa: use boring.Cache 2022-04-29 14:23:32 +00:00
equal_test.go
example_test.go
notboring.go [dev.boringcrypto] all: add boringcrypto build tags 2022-04-29 14:23:22 +00:00
pkcs1v15.go all: boringcrypto post-merge cleanup 2022-06-06 19:10:07 +00:00
pkcs1v15_test.go [dev.boringcrypto] all: merge master into dev.boringcrypto 2022-04-20 16:57:46 +02:00
pss.go crypto/rsa,crypto/internal/boring: fix PSS salt handling 2022-09-27 23:19:20 +00:00
pss_test.go crypto/rsa,crypto/internal/boring: fix PSS salt handling 2022-09-27 23:19:20 +00:00
rsa.go [dev.boringcrypto] crypto/ecdsa, crypto/rsa: use boring.Cache 2022-04-29 14:23:32 +00:00
rsa_test.go