8000 bug #26057 [SecurityBundle] use libsodium to run Argon2i related test… · symfony/symfony@717e1c3 · GitHub
[go: up one dir, main page]

Skip to content

Commit 717e1c3

Browse files
bug #26057 [SecurityBundle] use libsodium to run Argon2i related tests (xabbuh)
This PR was merged into the 3.4 branch. Discussion ---------- [SecurityBundle] use libsodium to run Argon2i related tests | Q | A | ------------- | --- | Branch? | 3.4 | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | #26038 | License | MIT | Doc PR | Commits ------- 5f9471e use libsodium to run Argon2i related tests
2 parents ae25291 + 5f9471e commit 717e1c3

File tree

3 files changed

+11
-3
lines changed

3 files changed

+11
-3
lines changed

.travis.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,15 @@ before_install:
149149
([[ $deps ]] || tfold ext.symfony_debug 'cd src/Symfony/Component/Debug/Resources/ext && phpize && ./configure && make && echo extension = $(pwd)/modules/symfony_debug.so >> '"$INI")
150150
tfold ext.apcu tpecl apcu-4.0.11 apcu.so
151151
elif [[ ! $skip && $PHP = 7.* ]]; then
152+
# install libsodium
153+
if [[ ! -e ~/php-ext/$(php -r "echo basename(ini_get('extension_dir'));")/libsodium/sodium.so ]]; then
154+
sudo add-apt-repository ppa:ondrej/php -y
155+
sudo apt-get update -q
156+
sudo apt-get install libsodium-dev -y
157+
fi
158+
152159
tfold ext.apcu tpecl apcu-5.1.6 apcu.so
160+
tfold ext.libsodium tpecl libsodium sodium.so
153161
tfold ext.mongodb tpecl mongodb-1.4.0RC1 mongodb.so
154162
fi
155163

src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Fixtures/yml/argon2i_encoder.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
security:
22
encoders:
3-
JMS\FooBundle\Entity\User6:
3+
JMS\FooBundle\Entity\User7:
44
algorithm: argon2i
55

66
providers:

src/Symfony/Bundle/SecurityBundle/Tests/Functional/UserPasswordEncoderCommandTest.php

Lines changed: 2 additions & 2 deletions
< AC07 /div>
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ public function testEncodePasswordArgon2i()
8686
$this->assertContains('Password encoding succeeded', $output);
8787

8888
$encoder = new Argon2iPasswordEncoder();
89-
preg_match('# Encoded password\s+(\$argon2i\$[\w\d,=\$+\/]+={0,2})\s+#', $output, $matches);
89+
preg_match('# Encoded password\s+(\$argon2id\$[\w\d,=\$+\/]+={0,2})\s+#', $output, $matches);
9090
$hash = $matches[1];
9191
$this->assertTrue($encoder->isPasswordValid($hash, 'password', null));
9292
}
@@ -272,7 +272,7 @@ protected function tearDown()
272272
private function setupArgon2i()
273273
{
274274
putenv('COLUMNS='.(119 + strlen(PHP_EOL)));
275-
$kernel = $this->createKernel(array('test_case' => 'PasswordEncode', 'root_config' => 'argon2i'));
275+
$kernel = $this->createKernel(array('test_case' => 'PasswordEncode', 'root_config' => 'argon2i.yml'));
276276
$kernel->boot();
277277

278278
$application = new Application($kernel);

0 commit comments

Comments
 (0)
0