Blame SOURCES/0005-Issue-5565-Change-default-password-storage-scheme.patch

8505bd
From 1a192048a49fcdfa8bcfe79e2fa86153b339fac1 Mon Sep 17 00:00:00 2001
8505bd
From: Mark Reynolds <mreynolds@redhat.com>
8505bd
Date: Tue, 13 Dec 2022 17:00:28 -0500
8505bd
Subject: [PATCH 2/2] Issue 5565 - Change default password storage scheme
8505bd
8505bd
Descriptrion:  Becuase of replication we need to use a default storage scheme
8505bd
that works on 389-ds-base-1.3.10
8505bd
8505bd
relates: https://github.com/389ds/389-ds-base/issues/5565
8505bd
8505bd
Reviewed by: spichugi & firstyear(thanks!!)
8505bd
---
8505bd
 .../tests/suites/healthcheck/health_security_test.py      | 8 ++++----
8505bd
 dirsrvtests/tests/suites/password/pwp_test.py             | 2 +-
8505bd
 ldap/servers/slapd/pw.c                                   | 3 ++-
8505bd
 src/lib389/lib389/config.py                               | 2 +-
8505bd
 4 files changed, 8 insertions(+), 7 deletions(-)
8505bd
8505bd
diff --git a/dirsrvtests/tests/suites/healthcheck/health_security_test.py b/dirsrvtests/tests/suites/healthcheck/health_security_test.py
8505bd
index 519107365..d14b52c7a 100644
8505bd
--- a/dirsrvtests/tests/suites/healthcheck/health_security_test.py
8505bd
+++ b/dirsrvtests/tests/suites/healthcheck/health_security_test.py
8505bd
@@ -1,5 +1,5 @@
8505bd
 # --- BEGIN COPYRIGHT BLOCK ---
8505bd
-# Copyright (C) 2020 Red Hat, Inc.
8505bd
+# Copyright (C) 2022 Red Hat, Inc.
8505bd
 # All rights reserved.
8505bd
 #
8505bd
 # License: GPL (version 3 or any later version).
8505bd
@@ -113,9 +113,9 @@ def test_healthcheck_insecure_pwd_hash_configured(topology_st):
8505bd
         standalone.config.set('passwordStorageScheme', 'SSHA512')
8505bd
         standalone.config.set('nsslapd-rootpwstoragescheme', 'SSHA512')
8505bd
     else:
8505bd
-        log.info('Set passwordStorageScheme and nsslapd-rootpwstoragescheme to PBKDF2-SHA512')
8505bd
-        standalone.config.set('passwordStorageScheme', 'PBKDF2-SHA512')
8505bd
-        standalone.config.set('nsslapd-rootpwstoragescheme', 'PBKDF2-SHA512')
8505bd
+        log.info('Set passwordStorageScheme and nsslapd-rootpwstoragescheme to PBKDF2_SHA256')
8505bd
+        standalone.config.set('passwordStorageScheme', 'PBKDF2_SHA256')
8505bd
+        standalone.config.set('nsslapd-rootpwstoragescheme', 'PBKDF2_SHA256')
8505bd
 
8505bd
     run_healthcheck_and_flush_log(topology_st, standalone, json=False, searched_code=CMD_OUTPUT)
8505bd
     run_healthcheck_and_flush_log(topology_st, standalone, json=True, searched_code=JSON_OUTPUT)
8505bd
diff --git a/dirsrvtests/tests/suites/password/pwp_test.py b/dirsrvtests/tests/suites/password/pwp_test.py
8505bd
index ce45bc364..190881222 100644
8505bd
--- a/dirsrvtests/tests/suites/password/pwp_test.py
8505bd
+++ b/dirsrvtests/tests/suites/password/pwp_test.py
8505bd
@@ -27,7 +27,7 @@ else:
8505bd
     if is_fips():
8505bd
         DEFAULT_PASSWORD_STORAGE_SCHEME = 'SSHA512'
8505bd
     else:
8505bd
-        DEFAULT_PASSWORD_STORAGE_SCHEME = 'PBKDF2-SHA512'
8505bd
+        DEFAULT_PASSWORD_STORAGE_SCHEME = 'PBKDF2_SHA256'
8505bd
 
8505bd
 
8505bd
 def _create_user(topo, uid, cn, uidNumber, userpassword):
8505bd
diff --git a/ldap/servers/slapd/pw.c b/ldap/servers/slapd/pw.c
8505bd
index 825498858..566ba87dd 100644
8505bd
--- a/ldap/servers/slapd/pw.c
8505bd
+++ b/ldap/servers/slapd/pw.c
8505bd
@@ -280,7 +280,8 @@ pw_name2scheme(char *name)
8505bd
         } else {
8505bd
             /* if not, let's setup pbkdf2 */
8505bd
 #ifdef RUST_ENABLE
8505bd
-            char *pbkdf = "PBKDF2-SHA512";
8505bd
+            /* until 1.3.10 supports Rust hashers we can't use PBKDF2-SHA512 by default */
8505bd
+            char *pbkdf = "PBKDF2_SHA256";
8505bd
 #else
8505bd
             char *pbkdf = "PBKDF2_SHA256";
8505bd
 #endif
8505bd
diff --git a/src/lib389/lib389/config.py b/src/lib389/lib389/config.py
8505bd
index c7abdf778..c178eb02f 100644
8505bd
--- a/src/lib389/lib389/config.py
8505bd
+++ b/src/lib389/lib389/config.py
8505bd
@@ -209,7 +209,7 @@ class Config(DSLdapObject):
8505bd
             yield report
8505bd
 
8505bd
     def _lint_passwordscheme(self):
8505bd
-        allowed_schemes = ['SSHA512', 'PBKDF2-SHA512', 'GOST_YESCRYPT']
8505bd
+        allowed_schemes = ['SSHA512', 'PBKDF2_SHA256', 'GOST_YESCRYPT']
8505bd
         u_password_scheme = self.get_attr_val_utf8('passwordStorageScheme')
8505bd
         u_root_scheme = self.get_attr_val_utf8('nsslapd-rootpwstoragescheme')
8505bd
         if u_root_scheme not in allowed_schemes or u_password_scheme not in allowed_schemes:
8505bd
-- 
8505bd
2.38.1
8505bd