From ba7e5df19433faddc1369a26824e7fc6efd7f983 Mon Sep 17 00:00:00 2001 From: Fraser Tweedale Date: Sun, 9 Aug 2015 05:55:04 -0400 Subject: [PATCH] Fix KRB5PrincipalName / UPN SAN comparison Depending on how the target principal name is conveyed to the command (i.e. with / without realm), the KRB5PrincipalName / UPN subjectAltName validation could be comparing unequal strings and erroneously rejecting a valid request. Normalise both side of the comparison to ensure that the principal names contain realm information. Fixes: https://fedorahosted.org/freeipa/ticket/5191 Reviewed-By: Martin Babinsky --- ipalib/plugins/cert.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ipalib/plugins/cert.py b/ipalib/plugins/cert.py index b6e6d7981..610f21493 100644 --- a/ipalib/plugins/cert.py +++ b/ipalib/plugins/cert.py @@ -474,7 +474,7 @@ class cert_request(VirtualCommand): principal_type, alt_principal_string, ca, profile_id) elif name_type in (pkcs10.SAN_OTHERNAME_KRB5PRINCIPALNAME, pkcs10.SAN_OTHERNAME_UPN): - if name != principal_string: + if split_any_principal(name) != principal: raise errors.ACIError( info=_("Principal '%s' in subject alt name does not " "match requested principal") % name)