a6f99c
From 8177734d3b6c141c251c74ee29d223a7d414ab13 Mon Sep 17 00:00:00 2001
a6f99c
From: Alexander Bokovoy <abokovoy@redhat.com>
a6f99c
Date: Wed, 1 May 2019 21:25:31 +0300
a6f99c
Subject: [PATCH] Revert "Require a minimum SASL security factor of 56"
a6f99c
a6f99c
This reverts commit 350954589774499d99bf87cb5631c664bb0707c4.
a6f99c
---
a6f99c
 install/share/Makefile.am       |  1 -
a6f99c
 install/share/min-ssf.ldif      | 14 --------------
a6f99c
 ipalib/constants.py             |  3 ---
a6f99c
 ipapython/ipaldap.py            | 17 ++---------------
a6f99c
 ipaserver/install/dsinstance.py |  5 -----
a6f99c
 5 files changed, 2 insertions(+), 38 deletions(-)
a6f99c
 delete mode 100644 install/share/min-ssf.ldif
a6f99c
a6f99c
diff --git a/install/share/Makefile.am b/install/share/Makefile.am
a6f99c
index be83bdf75..8d039d95c 100644
a6f99c
--- a/install/share/Makefile.am
a6f99c
+++ b/install/share/Makefile.am
a6f99c
@@ -94,7 +94,6 @@ dist_app_DATA =				\
a6f99c
 	ipa-kdc-proxy.conf.template	\
a6f99c
 	ipa-pki-proxy.conf.template	\
a6f99c
 	ipa-rewrite.conf.template	\
a6f99c
-	min-ssf.ldif			\
a6f99c
 	ipaca_default.ini		\
a6f99c
 	ipaca_customize.ini		\
a6f99c
 	ipaca_softhsm2.ini		\
a6f99c
diff --git a/install/share/min-ssf.ldif b/install/share/min-ssf.ldif
a6f99c
deleted file mode 100644
a6f99c
index 1c2566f84..000000000
a6f99c
--- a/install/share/min-ssf.ldif
a6f99c
+++ /dev/null
a6f99c
@@ -1,14 +0,0 @@
a6f99c
-# config
a6f99c
-# pretend SSF for LDAPI connections
a6f99c
-# nsslapd-localssf must be equal to or greater than nsslapd-minssf
a6f99c
-dn: cn=config
a6f99c
-changetype: modify
a6f99c
-replace: nsslapd-localssf
a6f99c
-nsslapd-localssf: 256
a6f99c
-
a6f99c
-# minimum security strength factor for SASL and TLS
a6f99c
-# 56 is considered weak, but some old clients announce wrong SSF.
a6f99c
-dn: cn=config
a6f99c
-changetype: modify
a6f99c
-replace: nsslapd-minssf
a6f99c
-nsslapd-minssf: 56
a6f99c
diff --git a/ipalib/constants.py b/ipalib/constants.py
a6f99c
index bcf6f3373..c22dd26ae 100644
a6f99c
--- a/ipalib/constants.py
a6f99c
+++ b/ipalib/constants.py
a6f99c
@@ -311,9 +311,6 @@ TLS_VERSIONS = [
a6f99c
 ]
a6f99c
 TLS_VERSION_MINIMAL = "tls1.0"
a6f99c
 
a6f99c
-# minimum SASL secure strength factor for LDAP connections
a6f99c
-# 56 provides backwards compatibility with old libraries.
a6f99c
-LDAP_SSF_MIN_THRESHOLD = 56
a6f99c
 
a6f99c
 # Use cache path
a6f99c
 USER_CACHE_PATH = (
a6f99c
diff --git a/ipapython/ipaldap.py b/ipapython/ipaldap.py
a6f99c
index d9d67be1d..9ff443fe4 100644
a6f99c
--- a/ipapython/ipaldap.py
a6f99c
+++ b/ipapython/ipaldap.py
a6f99c
@@ -43,9 +43,7 @@ import six
a6f99c
 
a6f99c
 # pylint: disable=ipa-forbidden-import
a6f99c
 from ipalib import errors, x509, _
a6f99c
-from ipalib.constants import (
a6f99c
-    LDAP_GENERALIZED_TIME_FORMAT, LDAP_SSF_MIN_THRESHOLD
a6f99c
-)
a6f99c
+from ipalib.constants import LDAP_GENERALIZED_TIME_FORMAT
a6f99c
 # pylint: enable=ipa-forbidden-import
a6f99c
 from ipaplatform.paths import paths
a6f99c
 from ipapython.ipautil import format_netloc, CIDict
a6f99c
@@ -105,8 +103,7 @@ def realm_to_ldapi_uri(realm_name):
a6f99c
     return 'ldapi://' + ldapurl.ldapUrlEscape(socketname)
a6f99c
 
a6f99c
 
a6f99c
-def ldap_initialize(uri, cacertfile=None,
a6f99c
-                    ssf_min_threshold=LDAP_SSF_MIN_THRESHOLD):
a6f99c
+def ldap_initialize(uri, cacertfile=None):
a6f99c
     """Wrapper around ldap.initialize()
a6f99c
 
a6f99c
     The function undoes global and local ldap.conf settings that may cause
a6f99c
@@ -117,10 +114,6 @@ def ldap_initialize(uri, cacertfile=None,
a6f99c
       locations, also known as system-wide trust store.
a6f99c
     * Cert validation is enforced.
a6f99c
     * SSLv2 and SSLv3 are disabled.
a6f99c
-    * Require a minimum SASL security factor of 56. That level ensures
a6f99c
-      data integrity and confidentiality. Although at least AES128 is
a6f99c
-      enforced pretty much everywhere, 56 is required for backwards
a6f99c
-      compatibility with systems that announce wrong SSF.
a6f99c
     """
a6f99c
     conn = ldap.initialize(uri)
a6f99c
 
a6f99c
@@ -128,12 +121,6 @@ def ldap_initialize(uri, cacertfile=None,
a6f99c
     conn.set_option(ldap.OPT_X_SASL_NOCANON, ldap.OPT_ON)
a6f99c
 
a6f99c
     if not uri.startswith('ldapi://'):
a6f99c
-        # require a minimum SSF for TCP connections, but don't lower SSF_MIN
a6f99c
-        # if the current value is already larger.
a6f99c
-        cur_min_ssf = conn.get_option(ldap.OPT_X_SASL_SSF_MIN)
a6f99c
-        if cur_min_ssf < ssf_min_threshold:
a6f99c
-            conn.set_option(ldap.OPT_X_SASL_SSF_MIN, ssf_min_threshold)
a6f99c
-
a6f99c
         if cacertfile:
a6f99c
             if not os.path.isfile(cacertfile):
a6f99c
                 raise IOError(errno.ENOENT, cacertfile)
a6f99c
diff --git a/ipaserver/install/dsinstance.py b/ipaserver/install/dsinstance.py
a6f99c
index 8240e3043..9f05db1db 100644
a6f99c
--- a/ipaserver/install/dsinstance.py
a6f99c
+++ b/ipaserver/install/dsinstance.py
a6f99c
@@ -324,8 +324,6 @@ class DsInstance(service.Service):
a6f99c
         else:
a6f99c
             self.step("importing CA certificates from LDAP",
a6f99c
                       self.__import_ca_certs)
a6f99c
-        # set min SSF after DS is configured for TLS
a6f99c
-        self.step("require minimal SSF", self.__min_ssf)
a6f99c
         self.step("restarting directory server", self.__restart_instance)
a6f99c
 
a6f99c
         self.start_creation()
a6f99c
@@ -1243,9 +1241,6 @@ class DsInstance(service.Service):
a6f99c
             dm_password=self.dm_password
a6f99c
         )
a6f99c
 
a6f99c
-    def __min_ssf(self):
a6f99c
-        self._ldap_mod("min-ssf.ldif")
a6f99c
-
a6f99c
     def __add_sudo_binduser(self):
a6f99c
         self._ldap_mod("sudobind.ldif", self.sub_dict)
a6f99c
 
a6f99c
-- 
a6f99c
2.21.0
a6f99c