krb5 commit: Add regression test for LDAP key fencepost bug

Greg Hudson ghudson at MIT.EDU
Thu Aug 7 18:20:44 EDT 2014


https://github.com/krb5/krb5/commit/0d78da225612e13d0b1cf515987305535d2f9dce
commit 0d78da225612e13d0b1cf515987305535d2f9dce
Author: Greg Hudson <ghudson at mit.edu>
Date:   Fri Aug 1 22:10:35 2014 -0400

    Add regression test for LDAP key fencepost bug
    
    ticket: 7980

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

diff --git a/src/tests/t_kdb.py b/src/tests/t_kdb.py
index 1426990..b310ccf 100644
--- a/src/tests/t_kdb.py
+++ b/src/tests/t_kdb.py
@@ -297,6 +297,17 @@ realm.run([kvno, 'alias'])
 realm.kinit(realm.user_princ, flags=['-R', '-S', 'alias'])
 realm.klist(realm.user_princ, 'alias at KRBTEST.COM')
 
+# Regression test for #7980 (fencepost when dividing keys up by kvno).
+realm.run_kadminl('addprinc -randkey -e aes256-cts,aes128-cts kvnoprinc')
+realm.run_kadminl('cpw -randkey -keepold -e aes256-cts,aes128-cts kvnoprinc')
+out = realm.run_kadminl('getprinc kvnoprinc')
+if 'Number of keys: 4' not in out:
+    fail('After cpw -keepold, wrong number of keys')
+realm.run_kadminl('cpw -randkey -keepold -e aes256-cts,aes128-cts kvnoprinc')
+out = realm.run_kadminl('getprinc kvnoprinc')
+if 'Number of keys: 6' not in out:
+    fail('After cpw -keepold, wrong number of keys')
+
 realm.stop()
 
 # Briefly test dump and load.


More information about the cvs-krb5 mailing list