Blame SOURCES/openldap-tlso-dont-check-cn-when-bad-san.patch

674599
Do not check CN when checking SAN failed
674599
674599
This is to make it compliant with RFC 6125:
674599
https://tools.ietf.org/html/rfc6125#section-6.4.4
674599
674599
Author: Matus Honek <mhonek@redhat.com>
674599
674599
diff --git a/libraries/libldap/tls_o.c b/libraries/libldap/tls_o.c
674599
index 92c708be0..46b48a3fb 100644
674599
--- a/libraries/libldap/tls_o.c
674599
+++ b/libraries/libldap/tls_o.c
674599
@@ -675,11 +675,16 @@ tlso_session_chkhost( LDAP *ld, tls_session *sess, const char *name_in )
674599
 			GENERAL_NAMES_free(alt);
674599
 			if (i < n) {	/* Found a match */
674599
 				ret = LDAP_SUCCESS;
674599
+			} else {	/* None matched */
674599
+				Debug( LDAP_DEBUG_ANY, "TLS: hostname (%s) does not match any "
674599
+					"SAN in certificate.\n", 
674599
+					name, NULL, NULL );
674599
+				ret = LDAP_CONNECT_ERROR;
674599
 			}
674599
 		}
674599
 	}
674599
 
674599
-	if (ret != LDAP_SUCCESS) {
674599
+	if (ret == LDAP_LOCAL_ERROR) {
674599
 		X509_NAME *xn;
674599
 		X509_NAME_ENTRY *ne;
674599
 		ASN1_OBJECT *obj;