Skip to content

Commit ff28cac

Browse files
committed
Bug fixed with Chacha20 Poly1305
1 parent c0c7378 commit ff28cac

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

src/Bundle/JoseFramework/DependencyInjection/Source/Encryption/EncryptionSource.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,9 +106,11 @@ private function getAlgorithmsFiles(): array
106106
RSA::class => 'encryption_rsa.yml',
107107
A128CTR::class => 'encryption_experimental.yml',
108108
];
109-
if (!in_array('chacha20-poly1305', openssl_get_cipher_methods())) {
109+
if (!\in_array('chacha20-poly1305', \openssl_get_cipher_methods(), true)) {
110110
$list[Chacha20Poly1305::class] = 'encryption_experimental_chacha20_poly1305.yml';
111111
}
112+
113+
return $list;
112114
}
113115

114116
/**

src/EncryptionAlgorithm/Experimental/KeyEncryption/Chacha20Poly1305.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ final class Chacha20Poly1305 implements KeyEncryption
2020
{
2121
public function __construct()
2222
{
23-
if (!in_array('chacha20-poly1305', openssl_get_cipher_methods())) {
23+
if (!\in_array('chacha20-poly1305', \openssl_get_cipher_methods(), true)) {
2424
throw new \RuntimeException('The algorithm "chacha20-poly1305" is not supported in this platform.');
2525
}
2626
}

src/EncryptionAlgorithm/Experimental/Tests/Chacha20Poly1305ContentEncryptionTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ class Chacha20Poly1305ContentEncryptionTest extends TestCase
2828
*/
2929
protected function setUp()
3030
{
31-
if (!in_array('chacha20-poly1305', openssl_get_cipher_methods())) {
31+
if (!\in_array('chacha20-poly1305', \openssl_get_cipher_methods(), true)) {
3232
$this->markTestSkipped('The algorithm "chacha20-poly1305" is not supported in this platform.');
3333
}
3434
}

0 commit comments

Comments
 (0)