depot/third_party/nixpkgs/pkgs/development/tools/misc/hydra/crypt-passphrase-argon2-fix-output-len.patch
Default email 2c76a4cb41 Project import generated by Copybara.
GitOrigin-RevId: c757e9bd77b16ca2e03c89bf8bc9ecb28e0c06ad
2023-11-16 04:20:00 +00:00

28 lines
988 B
Diff

From 6a5fb9efaea35ca29836371307f5083576f421ab Mon Sep 17 00:00:00 2001
From: Stig Palmquist <git@stig.io>
Date: Fri, 20 Oct 2023 00:09:28 +0200
Subject: [PATCH] Set output length of C::P::Argon2 hashes to 16
Since the default lengths in Crypt::Passphrase::Argon2 changed from 16
to 32 in in 0.009, some tests that expected the passphrase to be
unchanged started failing.
---
src/lib/Hydra/Schema/Result/Users.pm | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/lib/Hydra/Schema/Result/Users.pm b/src/lib/Hydra/Schema/Result/Users.pm
index b3de6543..c28ae931 100644
--- a/src/lib/Hydra/Schema/Result/Users.pm
+++ b/src/lib/Hydra/Schema/Result/Users.pm
@@ -216,7 +216,7 @@ sub json_hint {
sub _authenticator() {
my $authenticator = Crypt::Passphrase->new(
- encoder => 'Argon2',
+ encoder => { module => 'Argon2', output_size => 16 },
validators => [
(sub {
my ($password, $hash) = @_;
--
2.42.0