From f8af7d5b1cdd83c13e77142750fe90434176f22f Mon Sep 17 00:00:00 2001 From: Stig Palmquist Date: Sun, 26 Mar 2023 04:12:51 +0200 Subject: [PATCH 1/2] perlPackages.AuthenHtpasswd: removed failing DES crypt() tests --- pkgs/top-level/perl-packages.nix | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pkgs/top-level/perl-packages.nix b/pkgs/top-level/perl-packages.nix index 8b466e0ae38d..f86af1c78287 100644 --- a/pkgs/top-level/perl-packages.nix +++ b/pkgs/top-level/perl-packages.nix @@ -1180,6 +1180,10 @@ let hash = "sha256-tfr0fj+UikUoEGzLiMxxBIz+WY5bAmpEQ2i8fjk0gGc="; }; propagatedBuildInputs = [ ClassAccessor CryptPasswdMD5 DigestSHA1 IOLockedFile ]; + # Remove test files that fail after DES support was removed from crypt() + postPatch = '' + rm t/04core.t t/05edit.t + ''; meta = { description = "Interface to read and modify Apache .htpasswd files"; license = with lib.licenses; [ artistic1 gpl1Plus ]; From 33b7b0bf88d7d5ee13a7072b5b582b640babac61 Mon Sep 17 00:00:00 2001 From: Stig Palmquist Date: Sun, 26 Mar 2023 04:14:40 +0200 Subject: [PATCH 2/2] perlPackages.CatalystAuthenticationStoreHtpasswd: add patch to avoid DES encrypted passwords in tests --- ...eHtpasswd-test-replace-DES-hash-with-bcrypt.patch | 12 ++++++++++++ pkgs/top-level/perl-packages.nix | 3 +++ 2 files changed, 15 insertions(+) create mode 100644 pkgs/development/perl-modules/CatalystAuthenticationStoreHtpasswd-test-replace-DES-hash-with-bcrypt.patch diff --git a/pkgs/development/perl-modules/CatalystAuthenticationStoreHtpasswd-test-replace-DES-hash-with-bcrypt.patch b/pkgs/development/perl-modules/CatalystAuthenticationStoreHtpasswd-test-replace-DES-hash-with-bcrypt.patch new file mode 100644 index 000000000000..f3ce028ca59a --- /dev/null +++ b/pkgs/development/perl-modules/CatalystAuthenticationStoreHtpasswd-test-replace-DES-hash-with-bcrypt.patch @@ -0,0 +1,12 @@ +Replaces the legacy DES crypt hash used in tests with a stronger +bcrypt function, as crypt() in pkgs.perl no longer supports DES + +# htpasswd -nbB mufasa "Circle of Life" + +diff --git a/t/lib/TestApp/htpasswd b/t/lib/TestApp/htpasswd +index 6cec784..91e5375 100644 +--- a/t/lib/TestApp/htpasswd ++++ b/t/lib/TestApp/htpasswd +@@ -1 +1 @@ +-mufasa:Y7hn4ncIVPOuI ++mufasa:$2y$05$.KPC4Gja9L5AxJATDQBzs.lCHkm49l/9dcoyPcJg0JhyIvsD6Gqza diff --git a/pkgs/top-level/perl-packages.nix b/pkgs/top-level/perl-packages.nix index f86af1c78287..71772fe38fe3 100644 --- a/pkgs/top-level/perl-packages.nix +++ b/pkgs/top-level/perl-packages.nix @@ -2256,6 +2256,9 @@ let }; buildInputs = [ ModuleBuildTiny TestLongString TestSimple13 TestWWWMechanize TestWWWMechanizeCatalyst ]; propagatedBuildInputs = [ AuthenHtpasswd CatalystPluginAuthentication ]; + patches = [ + ../development/perl-modules/CatalystAuthenticationStoreHtpasswd-test-replace-DES-hash-with-bcrypt.patch + ]; meta = { description = "Authen::Htpasswd based user storage/authentication"; license = with lib.licenses; [ artistic1 gpl1Plus ];