svn rev #22100: trunk/src/kdc/

tsitkova@MIT.EDU tsitkova at MIT.EDU
Mon Mar 16 14:00:07 EDT 2009


http://src.mit.edu/fisheye/changelog/krb5/?cs=22100
Commit By: tsitkova
Log Message:
Verify return code from krb5_db_set_mkey_list.



Changed Files:
U   trunk/src/kdc/kdc_util.c
U   trunk/src/kdc/main.c
Modified: trunk/src/kdc/kdc_util.c
===================================================================
--- trunk/src/kdc/kdc_util.c	2009-03-16 17:58:53 UTC (rev 22099)
+++ trunk/src/kdc/kdc_util.c	2009-03-16 18:00:06 UTC (rev 22100)
@@ -454,7 +454,9 @@
                                     &master_keyblock, 0, &tmp_mkey_list) == 0) {
             krb5_dbe_free_key_list(kdc_context, master_keylist);
             master_keylist = tmp_mkey_list;
-	    krb5_db_set_mkey_list(kdc_context, master_keylist);
+	    retval = krb5_db_set_mkey_list(kdc_context, master_keylist);
+            if (retval)
+                goto errout;
             if ((retval = krb5_dbe_find_mkey(kdc_context, master_keylist,
                                              server, &mkey_ptr))) {
                 goto errout;
@@ -469,10 +471,10 @@
 				   -1, (krb5_int32)ticket->enc_part.kvno,
 				   &server_key);
     if (retval)
-	goto errout;
+        goto errout;
     if (!server_key) {
-	retval = KRB5KDC_ERR_S_PRINCIPAL_UNKNOWN;
-	goto errout;
+        retval = KRB5KDC_ERR_S_PRINCIPAL_UNKNOWN;
+        goto errout;
     }
     if ((*key = (krb5_keyblock *)malloc(sizeof **key))) {
 	retval = krb5_dbekd_decrypt_key_data(kdc_context, mkey_ptr,

Modified: trunk/src/kdc/main.c
===================================================================
--- trunk/src/kdc/main.c	2009-03-16 17:58:53 UTC (rev 22099)
+++ trunk/src/kdc/main.c	2009-03-16 18:00:06 UTC (rev 22100)
@@ -444,7 +444,12 @@
 		"while setting master key for realm %s", realm);
 	goto whoops;
     }
-    krb5_db_set_mkey_list(rdp->realm_context, rdp->mkey_list);
+    kret = krb5_db_set_mkey_list(rdp->realm_context, rdp->mkey_list);
+    if (kret) {
+        kdc_err(rdp->realm_context, kret,
+                "while setting master key list for realm %s", realm);
+        goto whoops;
+    }
 
     /* Set up the keytab */
     if ((kret = krb5_ktkdb_resolve(rdp->realm_context, NULL,




More information about the cvs-krb5 mailing list