Skip to content

Commit

Permalink
Merge branch 'master'
Browse files Browse the repository at this point in the history
  • Loading branch information
mvorisek committed Dec 13, 2023
2 parents 0fb413c + a2b5bb8 commit d5dfa92
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 16 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ jobs:
- name: Setup composer
run: |
cp composer.json-dist composer.json
composer require "kolab/net_ldap3:~1.1.1" --no-update
composer require "kolab/net_ldap3:~1.1.4" --no-update
- name: Install dependencies
run: composer install --prefer-dist --no-interaction --no-progress
Expand Down Expand Up @@ -86,7 +86,7 @@ jobs:
- name: Setup composer
run: |
cp composer.json-dist composer.json
composer require "kolab/net_ldap3:~1.1.1" --no-update
composer require "kolab/net_ldap3:~1.1.4" --no-update
- name: Install dependencies
run: composer install --prefer-dist --no-interaction --no-progress
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ complete: roundcubemail-git
cp -RH roundcubemail-git roundcubemail-$(VERSION)
(cd roundcubemail-$(VERSION); cp composer.json-dist composer.json)
(cd roundcubemail-$(VERSION); php /tmp/composer.phar config platform.php $(PHP_VERSION))
(cd roundcubemail-$(VERSION); php /tmp/composer.phar require "kolab/net_ldap3:~1.1.1" --no-update --no-install)
(cd roundcubemail-$(VERSION); php /tmp/composer.phar require "kolab/net_ldap3:~1.1.4" --no-update --no-install)
(cd roundcubemail-$(VERSION); php /tmp/composer.phar config --unset suggest.kolab/net_ldap3)
(cd roundcubemail-$(VERSION); php /tmp/composer.phar config --unset require-dev)
(cd roundcubemail-$(VERSION); php /tmp/composer.phar install --prefer-dist --no-dev --no-interaction)
Expand Down
2 changes: 1 addition & 1 deletion composer.json-dist
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
},
"suggest": {
"bjeavons/zxcvbn-php": "^1.0 required for Zxcvbn password strength driver",
"kolab/net_ldap3": "~1.1.1 required for connecting to LDAP"
"kolab/net_ldap3": "~1.1.4 required for connecting to LDAP"
},
"repositories": [
{
Expand Down
2 changes: 1 addition & 1 deletion program/lib/Roundcube/rcube.php
Original file line number Diff line number Diff line change
Expand Up @@ -965,7 +965,7 @@ public function decrypt($cipher, $key = 'des_key', $base64 = true)
$iv_size = openssl_cipher_iv_length($method);
$tag = null;

if (preg_match('/^##(.{16})##/', $cipher, $matches)) {
if (preg_match('/^##(.{16})##/s', $cipher, $matches)) {
$tag = $matches[1];
$cipher = substr($cipher, strlen($matches[0]));
}
Expand Down
19 changes: 8 additions & 11 deletions tests/Framework/Rcube.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,22 +46,19 @@ function test_list_languages()
function test_encrypt_and_decrypt()
{
$rcube = rcube::get_instance();
$result = $rcube->decrypt($rcube->encrypt('test'));

$result = $rcube->decrypt($rcube->encrypt('test'));
$this->assertSame('test', $result);

// The following tests fail quite often, therefore we disable them
$this->markTestSkipped();

// Test AEAD cipher method
$defaultCipherMethod = $rcube->config->get('cipher_method');
$rcube->config->set('cipher_method', 'aes-256-gcm');

$result = $rcube->decrypt($rcube->encrypt('test'));

$this->assertSame('test', $result);

// Back to the default
$rcube->config->set('cipher_method', 'DES-EDE3-CBC');
try {
$result = $rcube->decrypt($rcube->encrypt('test'));
$this->assertSame('test', $result);
} finally {
$rcube->config->set('cipher_method', $defaultCipherMethod);
}
}

/**
Expand Down

0 comments on commit d5dfa92

Please sign in to comment.