[28554] in CVS-changelog-for-Kerberos-V5

home help back first fref pref prev next nref lref last post

krb5 commit: Make randkey update principal mkvno

daemon@ATHENA.MIT.EDU (Greg Hudson)
Fri Aug 22 11:09:41 2014

Date: Fri, 22 Aug 2014 11:09:23 -0400
From: Greg Hudson <ghudson@mit.edu>
Message-Id: <201408221509.s7MF9NhM028301@drugstore.mit.edu>
To: cvs-krb5@mit.edu
Reply-To: krbdev@mit.edu
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Errors-To: cvs-krb5-bounces@mit.edu

https://github.com/krb5/krb5/commit/05a3b205c5d7ee491a64e24581cb4def3814c05b
commit 05a3b205c5d7ee491a64e24581cb4def3814c05b
Author: Greg Hudson <ghudson@mit.edu>
Date:   Mon Aug 18 15:09:41 2014 -0400

    Make randkey update principal mkvno
    
    In kadm5_randkey_principal_3, after updating the principal's keys,
    update its mkvno tl-data to indicate the master key version we
    encrypted the new keys with.
    
    ticket: 7994
    target_version: 1.13
    tags: pullup

 src/lib/kadm5/srv/svr_principal.c |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/src/lib/kadm5/srv/svr_principal.c b/src/lib/kadm5/srv/svr_principal.c
index bc66d5c..5d358bd 100644
--- a/src/lib/kadm5/srv/svr_principal.c
+++ b/src/lib/kadm5/srv/svr_principal.c
@@ -1597,6 +1597,7 @@ kadm5_randkey_principal_3(void *server_handle,
     krb5_boolean                have_pol = FALSE;
     kadm5_server_handle_t       handle = server_handle;
     krb5_keyblock               *act_mkey;
+    krb5_kvno                   act_kvno;
     int                         new_n_ks_tuple = 0;
     krb5_key_salt_tuple         *new_ks_tuple = NULL;
 
@@ -1626,7 +1627,7 @@ kadm5_randkey_principal_3(void *server_handle,
         new_n_ks_tuple = 1;
     }
 
-    ret = kdb_get_active_mkey(handle, NULL, &act_mkey);
+    ret = kdb_get_active_mkey(handle, &act_kvno, &act_mkey);
     if (ret)
         goto done;
 
@@ -1635,6 +1636,10 @@ kadm5_randkey_principal_3(void *server_handle,
     if (ret)
         goto done;
 
+    ret = krb5_dbe_update_mkvno(handle->context, kdb, act_kvno);
+    if (ret)
+        goto done;
+
     kdb->attributes &= ~KRB5_KDB_REQUIRES_PWCHANGE;
 
     ret = krb5_timeofday(handle->context, &now);
_______________________________________________
cvs-krb5 mailing list
cvs-krb5@mit.edu
https://mailman.mit.edu/mailman/listinfo/cvs-krb5

home help back first fref pref prev next nref lref last post