krb5 commit: Test the minclasses policy field in LDAP

Greg Hudson ghudson at mit.edu
Mon Aug 22 11:53:27 EDT 2016


https://github.com/krb5/krb5/commit/058a688335019709a9135f5c6377bb41f7eac5c9
commit 058a688335019709a9135f5c6377bb41f7eac5c9
Author: Sarah Day <sarahday at mit.edu>
Date:   Fri Aug 19 16:06:48 2016 -0400

    Test the minclasses policy field in LDAP
    
    [ghudson at mit.edu: added reference to ticket 8193 in comment]

 src/tests/t_kdb.py |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/src/tests/t_kdb.py b/src/tests/t_kdb.py
index 46a051c..5c17257 100755
--- a/src/tests/t_kdb.py
+++ b/src/tests/t_kdb.py
@@ -384,6 +384,15 @@ def test_pwhist(nhist):
 for n in (1, 2, 3, 4, 5):
     test_pwhist(n)
 
+# Regression test for #8193: test password character class requirements.
+princ = 'charclassprinc'
+pol = 'charclasspol'
+realm.run([kadminl, 'addpol', '-minclasses', '3', pol])
+realm.run([kadminl, 'addprinc', '-policy', pol, '-nokey', princ])
+realm.run([kadminl, 'cpw', '-pw', 'abcdef', princ], expected_code=1)
+realm.run([kadminl, 'cpw', '-pw', 'Abcdef', princ], expected_code=1)
+realm.run([kadminl, 'cpw', '-pw', 'Abcdef1', princ])
+
 # Test principal renaming and make sure last modified is changed
 def get_princ(princ):
     out = realm.run([kadminl, 'getprinc', princ])


More information about the cvs-krb5 mailing list