]> Cypherpunks.ru repositories - gostls13.git/commit
crypto: allow hash.Hash for OAEP and MGF1 to be specified independently
authorAleks Rudzitis <arudzitis@stripe.com>
Thu, 21 Jul 2022 18:19:42 +0000 (11:19 -0700)
committerGopher Robot <gobot@golang.org>
Wed, 9 Nov 2022 23:51:34 +0000 (23:51 +0000)
commite48fc2665e2e95eddea612fa315403d50c7beb2b
tree4906a2b1fe4f7602955e272f23753fde4f02affd
parent89332e037aeaf1223de4c24805719f733e4c0977
crypto: allow hash.Hash for OAEP and MGF1 to be specified independently

crypto/rsa assumes RSA OAEP uses the same hash to be used for both the label
and the mask generation function. However, implementations in other languages,
such as Java and Python, allow these parameters to be specified independently.

This change allows the MGF hash to be specified independently for decrypt
operations in order to allow decrypting ciphertexts generated in other
environments.

Fixes: #19974
Change-Id: If453d628f0da354ceb3b52863f30087471670f7b
Reviewed-on: https://go-review.googlesource.com/c/go/+/418874
Auto-Submit: Andrew Bonventre <andybons@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
Reviewed-by: Robert Griesemer <gri@google.com>
Reviewed-by: Andrew Bonventre <andybons@golang.org>
Run-TryBot: Andrew Bonventre <andybons@golang.org>
api/next/19974.txt [new file with mode: 0644]
src/crypto/internal/boring/notboring.go
src/crypto/internal/boring/rsa.go
src/crypto/rsa/rsa.go
src/crypto/rsa/rsa_test.go