svn rev #24168: trunk/src/ include/ lib/kdb/ plugins/kdb/db2/ plugins/kdb/ldap/

ghudson@MIT.EDU ghudson at MIT.EDU
Fri Jul 2 16:16:22 EDT 2010


http://src.mit.edu/fisheye/changelog/krb5/?cs=24168
Commit By: ghudson
Log Message:
ticket: 6749
status: open

Remove store_master_key from the DAL table, and implement
krb5_store_master_key in terms of krb5_store_master_key_list.



Changed Files:
U   trunk/src/include/kdb.h
U   trunk/src/lib/kdb/kdb5.c
U   trunk/src/lib/kdb/kdb_default.c
U   trunk/src/lib/kdb/libkdb5.exports
U   trunk/src/plugins/kdb/db2/db2_exp.c
U   trunk/src/plugins/kdb/ldap/ldap_exp.c
Modified: trunk/src/include/kdb.h
===================================================================
--- trunk/src/include/kdb.h	2010-07-02 19:18:12 UTC (rev 24167)
+++ trunk/src/include/kdb.h	2010-07-02 20:16:21 UTC (rev 24168)
@@ -688,14 +688,6 @@
                              krb5_key_data **kdatap);
 
 krb5_error_code
-krb5_def_store_mkey( krb5_context context,
-                     char *keyfile,
-                     krb5_principal mname,
-                     krb5_kvno kvno,
-                     krb5_keyblock *key,
-                     char *master_pwd);
-
-krb5_error_code
 krb5_def_store_mkey_list( krb5_context context,
                           char *keyfile,
                           krb5_principal mname,
@@ -1124,19 +1116,6 @@
                                            krb5_keylist_node **keylist);
 
     /*
-     * Optional with default: Save a master keyblock into the stash file
-     * db_arg.  master_pwd indicates the password used to derive the keyblock,
-     * if it is known.  mname is the name of the master principal for the
-     * realm.
-     *
-     * The default implementation ignores master_pwd and saves the master key
-     * in a keytab-format file.
-     */
-    krb5_error_code (*store_master_key)(krb5_context kcontext, char *db_arg,
-                                        krb5_principal mname, krb5_kvno kvno,
-                                        krb5_keyblock *key, char *master_pwd);
-
-    /*
      * Optional with default: Retrieve a master keyblock from the stash file
      * db_args, filling in *key and *kvno.  mname is the name of the master
      * principal for the realm.

Modified: trunk/src/lib/kdb/kdb5.c
===================================================================
--- trunk/src/lib/kdb/kdb5.c	2010-07-02 19:18:12 UTC (rev 24167)
+++ trunk/src/lib/kdb/kdb5.c	2010-07-02 20:16:21 UTC (rev 24168)
@@ -260,8 +260,6 @@
         lib->vftabl.dbe_search_enctype = krb5_dbe_def_search_enctype;
     if (lib->vftabl.change_pwd == NULL)
         lib->vftabl.change_pwd = krb5_dbe_def_cpw;
-    if (lib->vftabl.store_master_key == NULL)
-        lib->vftabl.store_master_key = krb5_def_store_mkey;
     if (lib->vftabl.promote_db == NULL)
         lib->vftabl.promote_db = krb5_def_promote_db;
     if (lib->vftabl.decrypt_key_data == NULL)
@@ -1132,16 +1130,13 @@
                          krb5_kvno kvno,
                          krb5_keyblock * key, char *master_pwd)
 {
-    krb5_error_code status = 0;
-    kdb_vftabl *v;
+    krb5_keylist_node list;
 
-    status = get_vftabl(kcontext, &v);
-    if (status)
-        return status;
-    if (v->store_master_key == NULL)
-        return KRB5_KDB_DBTYPE_NOSUP;
-    return v->store_master_key(kcontext, keyfile, mname, kvno, key,
-                               master_pwd);
+    list.kvno = kvno;
+    list.keyblock = *key;
+    list.next = NULL;
+    return krb5_db_store_master_key_list(kcontext, keyfile, mname, &list,
+                                         master_pwd);
 }
 
 krb5_error_code

Modified: trunk/src/lib/kdb/kdb_default.c
===================================================================
--- trunk/src/lib/kdb/kdb_default.c	2010-07-02 19:18:12 UTC (rev 24167)
+++ trunk/src/lib/kdb/kdb_default.c	2010-07-02 20:16:21 UTC (rev 24168)
@@ -233,23 +233,6 @@
     return retval;
 }
 
-krb5_error_code
-krb5_def_store_mkey(krb5_context   context,
-                    char           *keyfile,
-                    krb5_principal mname,
-                    krb5_kvno      kvno,
-                    krb5_keyblock  *key,
-                    char           *master_pwd)
-{
-    krb5_keylist_node list;
-
-    list.kvno = kvno;
-    list.keyblock = *key;
-    list.next = NULL;
-    return krb5_def_store_mkey_list(context, keyfile, mname, &list,
-                                    master_pwd);
-}
-
 static krb5_error_code
 krb5_db_def_fetch_mkey_stash(krb5_context   context,
                              const char *keyfile,

Modified: trunk/src/lib/kdb/libkdb5.exports
===================================================================
--- trunk/src/lib/kdb/libkdb5.exports	2010-07-02 19:18:12 UTC (rev 24167)
+++ trunk/src/lib/kdb/libkdb5.exports	2010-07-02 20:16:21 UTC (rev 24168)
@@ -71,7 +71,6 @@
 krb5_db_iter_policy
 krb5_db_delete_policy
 krb5_db_free_policy
-krb5_def_store_mkey
 krb5_def_store_mkey_list
 krb5_db_promote
 ulog_map

Modified: trunk/src/plugins/kdb/db2/db2_exp.c
===================================================================
--- trunk/src/plugins/kdb/db2/db2_exp.c	2010-07-02 19:18:12 UTC (rev 24167)
+++ trunk/src/plugins/kdb/db2/db2_exp.c	2010-07-02 20:16:21 UTC (rev 24168)
@@ -246,7 +246,7 @@
     /* free */                          krb5_db2_free,
     /* set_master_key_list */           wrap_krb5_db2_set_mkey_list,
     /* get_master_key_list */           wrap_krb5_db2_get_mkey_list,
-    /* blah blah blah */ 0,0,0,0,0,0,
+    /* blah blah blah */ 0,0,0,0,0,
     /* promote_db */                    wrap_krb5_db2_promote_db,
     0, 0,
     /* invoke */                        wrap_krb5_db2_invoke

Modified: trunk/src/plugins/kdb/ldap/ldap_exp.c
===================================================================
--- trunk/src/plugins/kdb/ldap/ldap_exp.c	2010-07-02 19:18:12 UTC (rev 24167)
+++ trunk/src/plugins/kdb/ldap/ldap_exp.c	2010-07-02 20:16:21 UTC (rev 24168)
@@ -74,7 +74,6 @@
     /* optional functions */
     /* set_master_key_list */               krb5_ldap_set_mkey_list,
     /* get_master_key_list */               krb5_ldap_get_mkey_list,
-    /* store_master_key */                  NULL,
     /* fetch_master_key */                  NULL /* krb5_ldap_fetch_mkey */,
     /* fetch_master_key_list */             NULL,
     /* store_master_key_list */             NULL,




More information about the cvs-krb5 mailing list