changeset 7702:70a6ee453ddc

fix: fix failing test when crypt is missing. In 3.13 crypt is gone and there is no replacement as it's supplied by a .so as _crypt. Don't hardcode the crypt method in the array, add it (next to last) only if crypt was detected.
author John Rouillard <rouilj@ieee.org>
date Mon, 20 Nov 2023 17:12:46 -0500
parents 5a35cfee727a
children 69e6bcb39f90
files roundup/password.py
diffstat 1 files changed, 4 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/roundup/password.py	Tue Nov 14 16:53:56 2023 -0500
+++ b/roundup/password.py	Mon Nov 20 17:12:46 2023 -0500
@@ -395,7 +395,10 @@
     1
     """
 
-    deprecated_schemes = ["SSHA", "SHA", "MD5", "crypt", "plaintext"]
+    deprecated_schemes = ["SSHA", "SHA", "MD5", "plaintext"]
+    if crypt:
+        # place just before plaintext if crypt is available
+        deprecated_schemes.insert(-1, "crypt")
     experimental_schemes = ["PBKDF2S5"]
     known_schemes = ["PBKDF2"] + experimental_schemes + \
         deprecated_schemes

Roundup Issue Tracker: http://roundup-tracker.org/