Repository: pyca/cryptography

Issue:
Bump BoringSSL and/or OpenSSL in CI
## BoringSSL
[Commit: e2e613c269a6bb3d7c0271150fff48d11fdbbace](https://boringssl.googlesource.com/boringssl/+/e2e613c269a6bb3d7c0271150fff48d11fdbbace)

[Diff](https://boringssl.googlesource.com/boringssl/+/d77fdbff010ee70776036c41155d1b3711ede548..e2e613c269a6bb3d7c0271150fff48d11fdbbace) between the last commit hash merged to this repository and the new commit.
## OpenSSL
[Commit: dc45d4c6faeb53bb68401141d899b9f857bbc51d](https://github.com/openssl/openssl/commit/dc45d4c6faeb53bb68401141d899b9f857bbc51d)

[Diff](https://github.com/openssl/openssl/compare/efec0f4611ee854f2b0b3da0c135e839bf8e7d04...dc45d4c6faeb53bb68401141d899b9f857bbc51d) between the last commit hash merged to this repository and the new commit.


Discussion:

Resolving patch:
diff --git a/src/_cffi_src/openssl/rsa.py b/src/_cffi_src/openssl/rsa.py
--- a/src/_cffi_src/openssl/rsa.py
+++ b/src/_cffi_src/openssl/rsa.py
@@ -16,6 +16,8 @@
 static const int RSA_PKCS1_PSS_PADDING;
 static const int RSA_F4;
 static const int RSA_PSS_SALTLEN_AUTO;
+
+static const int Cryptography_HAS_IMPLICIT_RSA_REJECTION;
 """
 
 FUNCTIONS = """
@@ -49,4 +51,10 @@
 #if !defined(RSA_PSS_SALTLEN_AUTO)
 #define RSA_PSS_SALTLEN_AUTO -2
 #endif
+
+#if defined(EVP_PKEY_CTRL_RSA_IMPLICIT_REJECTION)
+static const int Cryptography_HAS_IMPLICIT_RSA_REJECTION = 1;
+#else
+static const int Cryptography_HAS_IMPLICIT_RSA_REJECTION = 0;
+#endif
 """


Test patch:
diff --git a/tests/hazmat/primitives/test_rsa.py b/tests/hazmat/primitives/test_rsa.py
--- a/tests/hazmat/primitives/test_rsa.py
+++ b/tests/hazmat/primitives/test_rsa.py
@@ -1713,8 +1713,9 @@ def test_unsupported_padding(self, backend):
             private_key.decrypt(b"0" * 256, DummyAsymmetricPadding())
 
     @pytest.mark.supported(
-        only_if=lambda backend: backend.rsa_padding_supported(
-            padding.PKCS1v15()
+        only_if=lambda backend: (
+            backend.rsa_padding_supported(padding.PKCS1v15())
+            and not backend._lib.Cryptography_HAS_IMPLICIT_RSA_REJECTION
         ),
         skip_message="Does not support PKCS1v1.5.",
     )
diff --git a/tests/wycheproof/test_rsa.py b/tests/wycheproof/test_rsa.py
--- a/tests/wycheproof/test_rsa.py
+++ b/tests/wycheproof/test_rsa.py
@@ -240,8 +240,18 @@ def test_rsa_pkcs1_encryption(backend, wycheproof):
         )
         assert pt == binascii.unhexlify(wycheproof.testcase["msg"])
     else:
-        with pytest.raises(ValueError):
-            key.decrypt(
-                binascii.unhexlify(wycheproof.testcase["ct"]),
-                padding.PKCS1v15(),
-            )
+        if backend._lib.Cryptography_HAS_IMPLICIT_RSA_REJECTION:
+            try:
+                assert key.decrypt(
+                    binascii.unhexlify(wycheproof.testcase["ct"]),
+                    padding.PKCS1v15(),
+                ) != binascii.unhexlify(wycheproof.testcase["ct"])
+            except ValueError:
+                # Some raise ValueError due to length mismatch.
+                pass
+        else:
+            with pytest.raises(ValueError):
+                key.decrypt(
+                    binascii.unhexlify(wycheproof.testcase["ct"]),
+                    padding.PKCS1v15(),
+                )