From de6b335d023bc236e3949dcf7376ffd4aca0b35e Mon Sep 17 00:00:00 2001 From: Tim van Dijen Date: Tue, 19 Mar 2024 09:40:00 +0100 Subject: [PATCH] Fix decryption-test --- tests/Backend/OpenSSLTest.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/tests/Backend/OpenSSLTest.php b/tests/Backend/OpenSSLTest.php index 9b28151a..eab0a22d 100644 --- a/tests/Backend/OpenSSLTest.php +++ b/tests/Backend/OpenSSLTest.php @@ -200,9 +200,11 @@ public function testEncryptOAEPDecryptRSA15(): void self::$backend->setCipher(C::KEY_TRANSPORT_OAEP); $ciphertext = self::$backend->encrypt(self::$pubKey, 'Plaintext'); self::$backend->setCipher(C::KEY_TRANSPORT_RSA_1_5); - $this->expectException(RuntimeException::class); - $this->expectExceptionMessageMatches('/^Cannot decrypt data:/'); - self::$backend->decrypt(self::$privKey, $ciphertext); +// As of March 2024 the openssl_decrypt function no longer throws an exception +// $this->expectException(RuntimeException::class); +// $this->expectExceptionMessageMatches('/^Cannot decrypt data:/'); + $plaintext = self::$backend->decrypt(self::$privKey, $ciphertext); + $this->assertNotEquals('Plaintext', $plaintext); }