8000 use libsodium to run Argon2i related tests · symfony/symfony@62d28a1 · GitHub
[go: up one dir, main page]

Skip to content

Commit 62d28a1

Browse files
committed
use libsodium to run Argon2i related tests
1 parent ae25291 commit 62d28a1

File tree

3 files changed

+9
-3
lines changed

3 files changed

+9
-3
lines changed

.travis.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,13 @@ 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+
sudo add-apt-repository ppa:ondrej/php -y
154+
sudo apt-get update -q
155+
sudo apt-get install libsodium-dev -y
156+
152157
tfold ext.apcu tpecl apcu-5.1.6 apcu.so
158+
tfold ext.libsodium tpecl libsodium sodium.so
153159
tfold ext.mongodb tpecl mongodb-1.4.0RC1 mongodb.so
154160
fi
155161

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
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