Skip to content

Commit f8d7819

Browse files
committed
Fix for ARGON2 passwords, they shouldnt be base64 encoded. Fixes #316
1 parent 75dbb37 commit f8d7819

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

app/Classes/LDAP/Attribute/Password/Argon2i.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,16 @@ final class Argon2i extends Base
1010

1111
public static function subid(string $password): bool
1212
{
13-
return str_starts_with(base64_decode(self::password($password)),self::identifier.'$');
13+
return str_starts_with(self::password($password),self::identifier.'$');
1414
}
1515

1616
public function compare(string $source,string $compare): bool
1717
{
18-
return password_verify($compare,base64_decode($this->password($source)));
18+
return password_verify($compare,$this->password($source));
1919
}
2020

2121
public function encode(string $password): string
2222
{
23-
return sprintf('{%s}%s',self::key,base64_encode(password_hash($password,PASSWORD_ARGON2I)));
23+
return sprintf('{%s}%s',self::key,password_hash($password,PASSWORD_ARGON2I));
2424
}
2525
}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
dn: cn=z-module{0},cn=config
2+
changetype: modify
3+
add: olcModuleLoad
4+
olcModuleLoad: argon2

0 commit comments

Comments
 (0)