mirror of
https://github.com/refraction-networking/utls.git
synced 2025-04-03 20:17:36 +03:00
crypto: fix PKCS space in docs
Change-Id: Iee53acb963a889410f8c6daaa9a7841f1b12c6fb Reviewed-on: https://go-review.googlesource.com/c/go/+/241497 Run-TryBot: Katie Hockman <katie@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Filippo Valsorda <filippo@golang.org>
This commit is contained in:
parent
f52d192015
commit
3017dd3e97
4 changed files with 6 additions and 6 deletions
4
auth.go
4
auth.go
|
@ -155,9 +155,9 @@ var rsaSignatureSchemes = []struct {
|
|||
{PSSWithSHA256, crypto.SHA256.Size()*2 + 2, VersionTLS13},
|
||||
{PSSWithSHA384, crypto.SHA384.Size()*2 + 2, VersionTLS13},
|
||||
{PSSWithSHA512, crypto.SHA512.Size()*2 + 2, VersionTLS13},
|
||||
// PKCS#1 v1.5 uses prefixes from hashPrefixes in crypto/rsa, and requires
|
||||
// PKCS #1 v1.5 uses prefixes from hashPrefixes in crypto/rsa, and requires
|
||||
// emLen >= len(prefix) + hLen + 11
|
||||
// TLS 1.3 dropped support for PKCS#1 v1.5 in favor of RSA-PSS.
|
||||
// TLS 1.3 dropped support for PKCS #1 v1.5 in favor of RSA-PSS.
|
||||
{PKCS1WithSHA256, 19 + crypto.SHA256.Size() + 11, VersionTLS12},
|
||||
{PKCS1WithSHA384, 19 + crypto.SHA384.Size() + 11, VersionTLS12},
|
||||
{PKCS1WithSHA512, 19 + crypto.SHA512.Size() + 11, VersionTLS12},
|
||||
|
|
|
@ -40,7 +40,7 @@ func (ka rsaKeyAgreement) processClientKeyExchange(config *Config, cert *Certifi
|
|||
if !ok {
|
||||
return nil, errors.New("tls: certificate private key does not implement crypto.Decrypter")
|
||||
}
|
||||
// Perform constant time RSA PKCS#1 v1.5 decryption
|
||||
// Perform constant time RSA PKCS #1 v1.5 decryption
|
||||
preMasterSecret, err := priv.Decrypt(config.rand(), ciphertext, &rsa.PKCS1v15DecryptOptions{SessionKeyLen: 48})
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
|
2
tls.go
2
tls.go
|
@ -365,7 +365,7 @@ func X509KeyPair(certPEMBlock, keyPEMBlock []byte) (Certificate, error) {
|
|||
}
|
||||
|
||||
// Attempt to parse the given private key DER block. OpenSSL 0.9.8 generates
|
||||
// PKCS#1 private keys by default, while OpenSSL 1.0.0 generates PKCS#8 keys.
|
||||
// PKCS #1 private keys by default, while OpenSSL 1.0.0 generates PKCS #8 keys.
|
||||
// OpenSSL ecparam generates SEC1 EC private keys for ECDSA. We try all three.
|
||||
func parsePrivateKey(der []byte) (crypto.PrivateKey, error) {
|
||||
if key, err := x509.ParsePKCS1PrivateKey(der); err == nil {
|
||||
|
|
|
@ -1443,7 +1443,7 @@ func (s brokenSigner) Sign(rand io.Reader, digest []byte, opts crypto.SignerOpts
|
|||
}
|
||||
|
||||
// TestPKCS1OnlyCert uses a client certificate with a broken crypto.Signer that
|
||||
// always makes PKCS#1 v1.5 signatures, so can't be used with RSA-PSS.
|
||||
// always makes PKCS #1 v1.5 signatures, so can't be used with RSA-PSS.
|
||||
func TestPKCS1OnlyCert(t *testing.T) {
|
||||
clientConfig := testConfig.Clone()
|
||||
clientConfig.Certificates = []Certificate{{
|
||||
|
@ -1451,7 +1451,7 @@ func TestPKCS1OnlyCert(t *testing.T) {
|
|||
PrivateKey: brokenSigner{testRSAPrivateKey},
|
||||
}}
|
||||
serverConfig := testConfig.Clone()
|
||||
serverConfig.MaxVersion = VersionTLS12 // TLS 1.3 doesn't support PKCS#1 v1.5
|
||||
serverConfig.MaxVersion = VersionTLS12 // TLS 1.3 doesn't support PKCS #1 v1.5
|
||||
serverConfig.ClientAuth = RequireAnyClientCert
|
||||
|
||||
// If RSA-PSS is selected, the handshake should fail.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue