@@ -1679,7 +1679,7 @@ index 1226149321..befd1612b5 100644
16791679 }
16801680
16811681diff --git a/src/crypto/rsa/rsa.go b/src/crypto/rsa/rsa.go
1682- index bdd6d85c69..c6999a4a1f 100644
1682+ index ab56ccd1ed..dd79dc5439 100644
16831683--- a/src/crypto/rsa/rsa.go
16841684+++ b/src/crypto/rsa/rsa.go
16851685@@ -28,8 +28,8 @@ package rsa
@@ -1697,12 +1697,12 @@ index bdd6d85c69..c6999a4a1f 100644
16971697 func GenerateMultiPrimeKey(random io.Reader, nprimes int, bits int) (*PrivateKey, error) {
16981698 randutil.MaybeReadByte(random)
16991699
1700- - if boring.Enabled && random == boring.RandReader && nprimes == 2 && (bits == 2048 || bits == 3072) {
1701- + if boring.Enabled() && random == boring.RandReader && nprimes == 2 && (bits == 2048 || bits == 3072) {
1700+ - if boring.Enabled && random == boring.RandReader && nprimes == 2 &&
1701+ + if boring.Enabled() && random == boring.RandReader && nprimes == 2 &&
1702+ (bits == 2048 || bits == 3072 || bits == 4096) {
17021703 bN, bE, bD, bP, bQ, bDp, bDq, bQinv, err := boring.GenerateKeyRSA(bits)
17031704 if err != nil {
1704- return nil, err
1705- @@ -503,7 +503,7 @@ func EncryptOAEP(hash hash.Hash, random io.Reader, pub *PublicKey, msg []byte, l
1705+ @@ -504,7 +504,7 @@ func EncryptOAEP(hash hash.Hash, random io.Reader, pub *PublicKey, msg []byte, l
17061706 return nil, ErrMessageTooLong
17071707 }
17081708
@@ -1711,7 +1711,7 @@ index bdd6d85c69..c6999a4a1f 100644
17111711 bkey, err := boringPublicKey(pub)
17121712 if err != nil {
17131713 return nil, err
1714- @@ -532 ,7 +532 ,7 @@ func EncryptOAEP(hash hash.Hash, random io.Reader, pub *PublicKey, msg []byte, l
1714+ @@ -533 ,7 +533 ,7 @@ func EncryptOAEP(hash hash.Hash, random io.Reader, pub *PublicKey, msg []byte, l
17151715 mgf1XOR(db, hash, seed)
17161716 mgf1XOR(seed, hash, db)
17171717
@@ -1720,7 +1720,7 @@ index bdd6d85c69..c6999a4a1f 100644
17201720 var bkey *boring.PublicKeyRSA
17211721 bkey, err = boringPublicKey(pub)
17221722 if err != nil {
1723- @@ -674 ,7 +674 ,7 @@ func decryptOAEP(hash, mgfHash hash.Hash, random io.Reader, priv *PrivateKey, ci
1723+ @@ -675 ,7 +675 ,7 @@ func decryptOAEP(hash, mgfHash hash.Hash, random io.Reader, priv *PrivateKey, ci
17241724 return nil, ErrDecryption
17251725 }
17261726
@@ -2109,9 +2109,9 @@ index 7bfe3f9417..49702f59ba 100644
21092109 } else {
21102110 test("VersionTLS13", VersionTLS13, "")
21112111@@ -238,7 +238,7 @@ func TestBoringServerSignatureAndHash(t *testing.T) {
2112-
2112+
21132113 clientConfig := testConfig.Clone()
2114-
2114+
21152115- if boring.Enabled {
21162116+ if boring.Enabled() {
21172117 serverConfig.Rand = boring.RandReader
@@ -2120,7 +2120,7 @@ index 7bfe3f9417..49702f59ba 100644
21202120@@ -369,7 +369,7 @@ func TestBoringCertAlgs(t *testing.T) {
21212121 serverConfig.Certificates = []Certificate{{Certificate: list, PrivateKey: key}}
21222122 serverConfig.BuildNameToCertificate()
2123-
2123+
21242124- if boring.Enabled {
21252125+ if boring.Enabled() {
21262126 serverConfig.Rand = boring.RandReader
@@ -2136,7 +2136,7 @@ index 7bfe3f9417..49702f59ba 100644
21362136 serverConfig.Certificates[0].PrivateKey = testRSA2048PrivateKey
21372137 serverConfig.BuildNameToCertificate()
21382138 }
2139-
2139+
21402140- if boring.Enabled {
21412141+ if boring.Enabled() {
21422142 serverConfig.Rand = boring.RandReader
@@ -3539,7 +3539,7 @@ index 0000000000..a900b3f9e7
35393539+ #endif
35403540+ #if OPENSSL_VERSION_NUMBER < 0x10100000L
35413541+ DEFINEFUNC(void, CRYPTO_set_locking_callback,
3542- + (void (*locking_function)(int mode, int n, const char *file, int line)),
3542+ + (void (*locking_function)(int mode, int n, const char *file, int line)),
35433543+ (locking_function))
35443544+ #else
35453545+ static inline void
@@ -3916,11 +3916,11 @@ index 0000000000..a900b3f9e7
39163916+ DEFINEFUNC(int, ECDSA_do_verify, (const uint8_t *arg0, size_t arg1, const GO_ECDSA_SIG *arg2, GO_EC_KEY *arg3), (arg0, arg1, arg2, arg3))
39173917+ DEFINEFUNC(size_t, ECDSA_size, (const GO_EC_KEY *arg0), (arg0))
39183918+
3919- + DEFINEFUNCINTERNAL(int, ECDSA_sign,
3919+ + DEFINEFUNCINTERNAL(int, ECDSA_sign,
39203920+ (int type, const unsigned char *dgst, size_t dgstlen, unsigned char *sig, unsigned int *siglen, EC_KEY *eckey),
39213921+ (type, dgst, dgstlen, sig, siglen, eckey))
39223922+
3923- + DEFINEFUNCINTERNAL(int, ECDSA_verify,
3923+ + DEFINEFUNCINTERNAL(int, ECDSA_verify,
39243924+ (int type, const unsigned char *dgst, size_t dgstlen, const unsigned char *sig, unsigned int siglen, EC_KEY *eckey),
39253925+ (type, dgst, dgstlen, sig, siglen, eckey))
39263926+
@@ -4131,7 +4131,7 @@ index 0000000000..a900b3f9e7
41314131+ DEFINEFUNCINTERNAL(void, RSA_get0_factors,
41324132+ (const GO_RSA *rsa, const GO_BIGNUM **p, const GO_BIGNUM **q),
41334133+ (rsa, p, q))
4134- + static inline void
4134+ + static inline void
41354135+ _goboringcrypto_RSA_get0_factors(const GO_RSA *rsa, const GO_BIGNUM **p, const GO_BIGNUM **q) {
41364136+ #if OPENSSL_VERSION_NUMBER < 0x10100000L
41374137+ if (p)
@@ -4146,7 +4146,7 @@ index 0000000000..a900b3f9e7
41464146+ DEFINEFUNCINTERNAL(void, RSA_get0_key,
41474147+ (const GO_RSA *rsa, const GO_BIGNUM **n, const GO_BIGNUM **e, const GO_BIGNUM **d),
41484148+ (rsa, n, e, d))
4149- + static inline void
4149+ + static inline void
41504150+ _goboringcrypto_RSA_get0_key(const GO_RSA *rsa, const GO_BIGNUM **n, const GO_BIGNUM **e, const GO_BIGNUM **d) {
41514151+ #if OPENSSL_VERSION_NUMBER < 0x10100000L
41524152+ if (n)
@@ -4281,9 +4281,9 @@ index 0000000000..a900b3f9e7
42814281+
42824282+ static inline int
42834283+ _goboringcrypto_EVP_PKEY_CTX_set_rsa_pss_saltlen(GO_EVP_PKEY_CTX * arg0, int arg1) {
4284- + return _goboringcrypto_EVP_PKEY_CTX_ctrl(arg0, EVP_PKEY_RSA,
4285- + (EVP_PKEY_OP_SIGN|EVP_PKEY_OP_VERIFY),
4286- + EVP_PKEY_CTRL_RSA_PSS_SALTLEN,
4284+ + return _goboringcrypto_EVP_PKEY_CTX_ctrl(arg0, EVP_PKEY_RSA,
4285+ + (EVP_PKEY_OP_SIGN|EVP_PKEY_OP_VERIFY),
4286+ + EVP_PKEY_CTRL_RSA_PSS_SALTLEN,
42874287+ arg1, NULL);
42884288+ }
42894289+
0 commit comments