]> git.ipfire.org Git - thirdparty/krb5.git/commitdiff
Add tests for LDAP ticket/policy name misuse
authorGreg Hudson <ghudson@mit.edu>
Fri, 5 Dec 2014 19:02:04 +0000 (14:02 -0500)
committerTom Yu <tlyu@mit.edu>
Tue, 10 Feb 2015 03:16:26 +0000 (22:16 -0500)
(cherry picked from commit e8df0458673071e56346730fa843c83aca88631f)

ticket: 8137
version_fixed: 1.12.3
status: resolved

src/tests/t_kdb.py

index 4ad4b153f0959f1466f04a2dbcb8ffe44c692af4..99f043da6fb5721fc4f45ae69550e29a29dd24a6 100644 (file)
@@ -228,6 +228,27 @@ if out:
 # Create another ticket policy to be destroyed with the realm.
 kldaputil(['create_policy', 'tktpol2'])
 
+# Try to create a password policy conflicting with a ticket policy.
+out = realm.run_kadminl('addpol tktpol2')
+if 'Already exists while creating policy "tktpol2"' not in out:
+    fail('Expected error not seen in kadmin.local output')
+
+# Try to create a ticket policy conflicting with a password policy.
+realm.run_kadminl('addpol pwpol')
+out = kldaputil(['create_policy', 'pwpol'], expected_code=1)
+if 'Already exists while creating policy object' not in out:
+    fail('Expected error not seen in kdb5_ldap_util output')
+
+# Try to use a password policy as a ticket policy.
+out = realm.run_kadminl('modprinc -x tktpolicy=pwpol princ4')
+if 'Object class violation' not in out:
+    fail('Expected error not seem in kadmin.local output')
+
+# Try to use a ticket policy as a password policy (CVE-2014-5353).
+out = realm.run_kadminl('modprinc -policy tktpol2 princ4')
+if 'WARNING: policy "tktpol2" does not exist' not in out:
+    fail('Expected error not seen in kadmin.local output')
+
 # Do some basic tests with a KDC against the LDAP module, exercising the
 # db_args processing code.
 realm.start_kdc(['-x', 'nconns=3', '-x', 'host=' + ldap_uri,