summary refs log tree commit diff
path: root/pkgs/development/tools/misc/hydra/crypt-passphrase-argon2-fix-output-len.patch
blob: 0c8e6ae434d60037ee5dc695a5b92967c6e15ad8 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
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