git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH v4 2/3] t/lib-httpd: stop using legacy crypt(3) for authentication

From
Patrick Steinhardt <ps@pks.im>
Date
Nov 10, 2023, 08:17 UTC
Message-ID
<7d28c32feaaadb411f4d2b0f37b38acdab9e4a58.1699596457.git.ps@pks.im>
In-Reply-To
<cover.1699596457.git.ps@pks.im>

When setting up httpd for our tests, we also install a passwd and proxy-passwd file that contain the test user's credentials. These credentials currently use crypt(3) as the password encryption schema.

This schema can be considered deprecated nowadays as it is not safe anymore. Quoting Apache httpd's documentation [1]:

> Unix only. Uses the traditional Unix crypt(3) function with a
> randomly-generated 32-bit salt (only 12 bits used) and the first 8
> characters of the password. Insecure.

This is starting to cause issues in modern Linux distributions. glibc has deprecated its libcrypt library that used to provide crypt(3) in favor of the libxcrypt library. This newer replacement provides a compile time switch to disable insecure password encryption schemata, which causes crypt(3) to always return `EINVAL`. The end result is that httpd tests that exercise authentication will fail on distros that use libxcrypt without these insecure encryption schematas.

Regenerate the passwd files to instead use the default password encryption schema, which is md5. While it feels kind of funny that an MD5-based encryption schema should be more secure than anything else, it is the current default and supported by all platforms. Furthermore, it really doesn't matter all that much given that these files are only used for testing purposes anyway.

[1]: https://httpd.apache.org/docs/2.4/misc/password_encryptions.html
Signed-off-by: Patrick Steinhardt <ps@pks.im>
---
 t/lib-httpd/passwd       | 2 +-
 t/lib-httpd/proxy-passwd | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/t/lib-httpd/passwd b/t/lib-httpd/passwd
index 99a34d64874..d9c122f3482 100644
--- a/t/lib-httpd/passwd
+++ b/t/lib-httpd/passwd
@@ -1 +1 @@
-user@host:xb4E8pqD81KQs
+user@host:$apr1$LGPmCZWj$9vxEwj5Z5GzQLBMxp3mCx1
diff --git a/t/lib-httpd/proxy-passwd b/t/lib-httpd/proxy-passwd
index 77c25138e07..2ad7705d9a3 100644
--- a/t/lib-httpd/proxy-passwd
+++ b/t/lib-httpd/proxy-passwd
@@ -1 +1 @@
-proxuser:2x7tAukjAED5M
+proxuser:$apr1$RxS6MLkD$DYsqQdflheq4GPNxzJpx5.
-- 
2.42.0
Previous: Patrick SteinhardtNext: Patrick Steinhardt
Message 36 of 41 in “t: improve compatibility with NixOS”
  1. 0/3 t: improve compatibility with NixOSPatrick Steinhardt, Nov 8, 2023
  2. 1/3 t/lib-httpd: dynamically detect httpd and modules pathPatrick Steinhardt, Nov 8, 2023
  3. Junio C HamanoNov 8, 2023
  4. Patrick SteinhardtNov 8, 2023
  5. Jeff KingNov 8, 2023
  6. 2/3 t/lib-httpd: stop using legacy crypt(3) for authenticationPatrick Steinhardt, Nov 8, 2023
  7. Junio C HamanoNov 8, 2023
  8. 3/3 t9164: fix inability to find basename(1) in hooksPatrick Steinhardt, Nov 8, 2023
  9. 0/3 t: improve compatibility with NixOSPatrick Steinhardt, Nov 8, 2023
  10. 1/3 t/lib-httpd: dynamically detect httpd and modules pathPatrick Steinhardt, Nov 8, 2023
  11. Jeff KingNov 8, 2023
  12. Junio C HamanoNov 9, 2023
  13. Patrick SteinhardtNov 9, 2023
  14. 2/3 t/lib-httpd: stop using legacy crypt(3) for authenticationPatrick Steinhardt, Nov 8, 2023
  15. Jeff KingNov 8, 2023
  16. 3/3 t9164: fix inability to find basename(1) in hooksPatrick Steinhardt, Nov 8, 2023
  17. Jeff KingNov 8, 2023
  18. Junio C HamanoNov 8, 2023
  19. Patrick SteinhardtNov 9, 2023
  20. Patrick SteinhardtNov 9, 2023
  21. 0/3 t: improve compatibility with NixOSPatrick Steinhardt, Nov 9, 2023
  22. 1/3 t/lib-httpd: dynamically detect httpd and modules pathPatrick Steinhardt, Nov 9, 2023
  23. Jeff KingNov 9, 2023
  24. Patrick SteinhardtNov 9, 2023
  25. Junio C HamanoNov 9, 2023
  26. Patrick SteinhardtNov 9, 2023
  27. Jeff KingNov 9, 2023
  28. 2/3 t/lib-httpd: stop using legacy crypt(3) for authenticationPatrick Steinhardt, Nov 9, 2023
  29. 3/3 t9164: fix inability to find basename(1) in Subversion hooksPatrick Steinhardt, Nov 9, 2023
  30. Jeff KingNov 9, 2023
  31. Jeff KingNov 9, 2023
  32. 0/3 t: improve compatibility with NixOSPatrick Steinhardt, Nov 10, 2023
  33. 1/3 t/lib-httpd: dynamically detect httpd and modules pathPatrick Steinhardt, Nov 10, 2023
  34. Junio C HamanoNov 11, 2023
  35. Patrick SteinhardtNov 13, 2023
  36. 2/3 t/lib-httpd: stop using legacy crypt(3) for authenticationPatrick Steinhardt, Nov 10, 2023
  37. 3/3 t9164: fix inability to find basename(1) in Subversion hooksPatrick Steinhardt, Nov 10, 2023
  38. Jeff KingNov 10, 2023
  39. Junio C HamanoNov 11, 2023
  40. Patrick SteinhardtNov 13, 2023
  41. Junio C HamanoNov 13, 2023

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.