summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYorhel <git@yorhel.nl>2019-05-16 09:28:05 +0200
committerYorhel <git@yorhel.nl>2019-05-16 09:28:07 +0200
commit28aee117368048cdf56879bf35243498abbe8b4f (patch)
tree9c14f7331a3836f86677980a81ffb9727eabfb94
parent1cbc5107f32ec744d1834569f3885146d7282974 (diff)
Actually make Unicode passwords work
Interestingly, Multi::API already did this correctly.
-rw-r--r--lib/VNDB/Util/Auth.pm2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/VNDB/Util/Auth.pm b/lib/VNDB/Util/Auth.pm
index bda13158..0093bf2d 100644
--- a/lib/VNDB/Util/Auth.pm
+++ b/lib/VNDB/Util/Auth.pm
@@ -72,7 +72,7 @@ sub _preparepass {
my($self, $pass, $salt, $N, $r, $p) = @_;
($N, $r, $p) = @{$self->{scrypt_args}} if !$N;
$salt ||= urandom(8);
- return pack 'NCCa8a*', $N, $r, $p, $salt, scrypt_raw($pass, $self->{scrypt_salt} . $salt, $N, $r, $p, 32);
+ return pack 'NCCa8a*', $N, $r, $p, $salt, scrypt_raw(encode_utf8($pass), $self->{scrypt_salt} . $salt, $N, $r, $p, 32);
}