svn rev #21802: branches/mkey_migrate/src/ include/ kadmin/dbutil/ lib/kadm5/ ...

wfiveash@MIT.EDU wfiveash at MIT.EDU
Mon Jan 26 16:42:25 EST 2009


http://src.mit.edu/fisheye/changelog/krb5/?cs=21802
Commit By: wfiveash
Log Message:
Restore krb5_free_key_data_contents() as it was in
src/lib/kadm5/misc_free.c and rename the version of that function in
kdb5.c to krb5_dbe_free_key_data_contents.  Eventually this needs to be
consolidated somewhere.



Changed Files:
U   branches/mkey_migrate/src/include/kdb.h
U   branches/mkey_migrate/src/kadmin/dbutil/kdb5_mkey.c
U   branches/mkey_migrate/src/kadmin/dbutil/kdb5_util.c
U   branches/mkey_migrate/src/lib/kadm5/clnt/libkadm5clnt.exports
U   branches/mkey_migrate/src/lib/kadm5/misc_free.c
U   branches/mkey_migrate/src/lib/kadm5/server_internal.h
U   branches/mkey_migrate/src/lib/kadm5/srv/libkadm5srv.exports
U   branches/mkey_migrate/src/lib/kadm5/srv/server_kdb.c
U   branches/mkey_migrate/src/lib/kdb/kdb5.c
U   branches/mkey_migrate/src/lib/kdb/libkdb5.exports
Modified: branches/mkey_migrate/src/include/kdb.h
===================================================================
--- branches/mkey_migrate/src/include/kdb.h	2009-01-26 21:26:33 UTC (rev 21801)
+++ branches/mkey_migrate/src/include/kdb.h	2009-01-26 21:42:23 UTC (rev 21802)
@@ -53,6 +53,11 @@
  * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  */
 
+/*
+ * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
+ * Use is subject to license terms.
+ */
+
 #ifndef KRB5_KDB5__
 #define KRB5_KDB5__
 
@@ -655,7 +660,7 @@
 	(krb5_context, void **db_context);
 
 void
-krb5_free_key_data_contents(krb5_context, krb5_key_data *);
+krb5_dbe_free_key_data_contents(krb5_context, krb5_key_data *);
 
 #define KRB5_KDB_DEF_FLAGS	0
 

Modified: branches/mkey_migrate/src/kadmin/dbutil/kdb5_mkey.c
===================================================================
--- branches/mkey_migrate/src/kadmin/dbutil/kdb5_mkey.c	2009-01-26 21:26:33 UTC (rev 21801)
+++ branches/mkey_migrate/src/kadmin/dbutil/kdb5_mkey.c	2009-01-26 21:42:23 UTC (rev 21802)
@@ -312,7 +312,7 @@
     for (cur_mkey_aux_data = mkey_aux_data_head; cur_mkey_aux_data != NULL;
          cur_mkey_aux_data = next_mkey_aux_data) {
         next_mkey_aux_data = cur_mkey_aux_data->next;
-        krb5_free_key_data_contents(util_context, &(cur_mkey_aux_data->latest_mkey));
+        krb5_dbe_free_key_data_contents(util_context, &(cur_mkey_aux_data->latest_mkey));
         free(cur_mkey_aux_data);
     }
     return;

Modified: branches/mkey_migrate/src/kadmin/dbutil/kdb5_util.c
===================================================================
--- branches/mkey_migrate/src/kadmin/dbutil/kdb5_util.c	2009-01-26 21:26:33 UTC (rev 21801)
+++ branches/mkey_migrate/src/kadmin/dbutil/kdb5_util.c	2009-01-26 21:42:23 UTC (rev 21802)
@@ -53,6 +53,11 @@
  * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  */
 
+/*
+ * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
+ * Use is subject to license terms.
+ */
+
 #include <stdio.h>
 #include <k5-int.h>
 #include <kadm5/admin.h>

Modified: branches/mkey_migrate/src/lib/kadm5/clnt/libkadm5clnt.exports
===================================================================
--- branches/mkey_migrate/src/lib/kadm5/clnt/libkadm5clnt.exports	2009-01-26 21:26:33 UTC (rev 21801)
+++ branches/mkey_migrate/src/lib/kadm5/clnt/libkadm5clnt.exports	2009-01-26 21:42:23 UTC (rev 21802)
@@ -46,6 +46,7 @@
 krb5_aprof_getvals
 krb5_aprof_init
 krb5_flags_to_string
+krb5_free_key_data_contents
 krb5_free_realm_params
 krb5_input_flag_to_string
 krb5_keysalt_is_present

Modified: branches/mkey_migrate/src/lib/kadm5/misc_free.c
===================================================================
--- branches/mkey_migrate/src/lib/kadm5/misc_free.c	2009-01-26 21:26:33 UTC (rev 21801)
+++ branches/mkey_migrate/src/lib/kadm5/misc_free.c	2009-01-26 21:42:23 UTC (rev 21802)
@@ -39,6 +39,23 @@
     return KADM5_OK;
 }
 
+/* XXX this ought to be in libkrb5.a, but isn't */
+kadm5_ret_t krb5_free_key_data_contents(context, key)
+   krb5_context context;
+   krb5_key_data *key;
+{
+     int i, idx;
+     
+     idx = (key->key_data_ver == 1 ? 1 : 2);
+     for (i = 0; i < idx; i++) {
+	  if (key->key_data_contents[i]) {
+	       memset(key->key_data_contents[i], 0, key->key_data_length[i]);
+	       free(key->key_data_contents[i]);
+	  }
+     }
+     return KADM5_OK;
+}
+
 kadm5_ret_t kadm5_free_key_data(void *server_handle,
 				krb5_int16 *n_key_data,
 				krb5_key_data *key_data)

Modified: branches/mkey_migrate/src/lib/kadm5/server_internal.h
===================================================================
--- branches/mkey_migrate/src/lib/kadm5/server_internal.h	2009-01-26 21:26:33 UTC (rev 21801)
+++ branches/mkey_migrate/src/lib/kadm5/server_internal.h	2009-01-26 21:42:23 UTC (rev 21802)
@@ -85,11 +85,8 @@
 kadm5_ret_t krb5_copy_key_data_contents(krb5_context context,
 					krb5_key_data *from, 
 					krb5_key_data *to);
-/* XXX WAF: maybe delete this if all compiles */
-#if 0 /************** Begin IFDEF'ed OUT *******************************/
 kadm5_ret_t krb5_free_key_data_contents(krb5_context context, 
 					krb5_key_data *key);
-#endif /**************** END IFDEF'ed OUT *******************************/
 
 /*
  * *Warning* 

Modified: branches/mkey_migrate/src/lib/kadm5/srv/libkadm5srv.exports
===================================================================
--- branches/mkey_migrate/src/lib/kadm5/srv/libkadm5srv.exports	2009-01-26 21:26:33 UTC (rev 21801)
+++ branches/mkey_migrate/src/lib/kadm5/srv/libkadm5srv.exports	2009-01-26 21:42:23 UTC (rev 21802)
@@ -71,6 +71,7 @@
 krb5_aprof_init
 krb5_copy_key_data_contents
 krb5_flags_to_string
+krb5_free_key_data_contents
 krb5_free_realm_params
 krb5_input_flag_to_string
 krb5_keysalt_is_present

Modified: branches/mkey_migrate/src/lib/kadm5/srv/server_kdb.c
===================================================================
--- branches/mkey_migrate/src/lib/kadm5/srv/server_kdb.c	2009-01-26 21:26:33 UTC (rev 21801)
+++ branches/mkey_migrate/src/lib/kadm5/srv/server_kdb.c	2009-01-26 21:42:23 UTC (rev 21802)
@@ -4,6 +4,11 @@
  * $Header$
  */
 
+/*
+ * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
+ * Use is subject to license terms.
+ */
+
 #if !defined(lint) && !defined(__CODECENTER__)
 static char *rcsid = "$Header$";
 #endif

Modified: branches/mkey_migrate/src/lib/kdb/kdb5.c
===================================================================
--- branches/mkey_migrate/src/lib/kdb/kdb5.c	2009-01-26 21:26:33 UTC (rev 21801)
+++ branches/mkey_migrate/src/lib/kdb/kdb5.c	2009-01-26 21:42:23 UTC (rev 21802)
@@ -106,6 +106,26 @@
     return k5_mutex_unlock(&db_lock);
 }
 
+/*
+ * XXX eventually this should be consolidated with krb5_free_key_data_contents
+ * so there is only a single version.
+ */
+void
+krb5_dbe_free_key_data_contents(krb5_context context,
+                                krb5_key_data *key)
+{
+    int i, idx;
+
+    idx = (key->key_data_ver == 1 ? 1 : 2);
+    for (i = 0; i < idx; i++) {
+        if (key->key_data_contents[i]) {
+            zap(key->key_data_contents[i], key->key_data_length[i]);
+            free(key->key_data_contents[i]);
+        }
+    }
+    return;
+}
+
 static void
 krb5_free_actkvno_list(krb5_context context, krb5_actkvno_node *val)
 {
@@ -126,27 +146,11 @@
     for (temp = val; temp != NULL;) {
         prev = temp;
         temp = temp->next;
-        krb5_free_key_data_contents(context, &prev->latest_mkey);
+        krb5_dbe_free_key_data_contents(context, &prev->latest_mkey);
         krb5_xfree(prev);
     }
 }
 
-void
-krb5_free_key_data_contents(krb5_context context,
-                            krb5_key_data *key)
-{
-    int i, idx;
-
-    idx = (key->key_data_ver == 1 ? 1 : 2);
-    for (i = 0; i < idx; i++) {
-        if (key->key_data_contents[i]) {
-            zap(key->key_data_contents[i], key->key_data_length[i]);
-            free(key->key_data_contents[i]);
-        }
-    }
-    return;
-}
-
 #define kdb_init_lib_lock(a) 0
 #define kdb_destroy_lib_lock(a) (void)0
 #define kdb_lock_lib_lock(a, b) 0

Modified: branches/mkey_migrate/src/lib/kdb/libkdb5.exports
===================================================================
--- branches/mkey_migrate/src/lib/kdb/libkdb5.exports	2009-01-26 21:26:33 UTC (rev 21801)
+++ branches/mkey_migrate/src/lib/kdb/libkdb5.exports	2009-01-26 21:42:23 UTC (rev 21802)
@@ -37,6 +37,7 @@
 krb5_dbe_fetch_act_key_list
 krb5_dbe_find_enctype
 krb5_dbe_find_mkey
+krb5_dbe_free_key_data_contents
 krb5_dbe_lookup_last_pwd_change
 krb5_dbe_lookup_actkvno
 krb5_dbe_lookup_mkvno
@@ -66,7 +67,6 @@
 krb5_db_free_policy
 krb5_def_store_mkey
 krb5_db_promote
-krb5_free_key_data_contents
 ulog_map
 ulog_set_role
 ulog_free_entries




More information about the cvs-krb5 mailing list