Skip to content

Commit

Permalink
Fix decryption-test
Browse files Browse the repository at this point in the history
  • Loading branch information
tvdijen committed Mar 19, 2024
1 parent 22a8db4 commit de6b335
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions tests/Backend/OpenSSLTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}


Expand Down

0 comments on commit de6b335

Please sign in to comment.