Remove store_master_key from the DAL table, and implement
authorGreg Hudson <ghudson@mit.edu>
Fri, 2 Jul 2010 20:16:21 +0000 (20:16 +0000)
committerGreg Hudson <ghudson@mit.edu>
Fri, 2 Jul 2010 20:16:21 +0000 (20:16 +0000)
krb5_store_master_key in terms of krb5_store_master_key_list.

ticket: 6749
status: open

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@24168 dc483132-0cff-0310-8789-dd5450dbe970

src/include/kdb.h
src/lib/kdb/kdb5.c
src/lib/kdb/kdb_default.c
src/lib/kdb/libkdb5.exports
src/plugins/kdb/db2/db2_exp.c
src/plugins/kdb/ldap/ldap_exp.c

index b959b15728c732b7a99eaaffe6aae232c3269a9b..f7765c58b0fb60d8da4d39e6351c8f2c57b84636 100644 (file)
@@ -687,14 +687,6 @@ krb5_dbe_def_search_enctype( krb5_context kcontext,
                              krb5_int32 kvno,
                              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,
@@ -1123,19 +1115,6 @@ typedef struct _kdb_vftabl {
     krb5_error_code (*get_master_key_list)(krb5_context kcontext,
                                            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
index b06cf76c5b0a4a7cc49b608469baf9f06b26871c..7b31a96dc007d74cde619d261ec651cfc8d882b0 100644 (file)
@@ -260,8 +260,6 @@ kdb_setup_opt_functions(db_library lib)
         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_db_store_master_key(krb5_context kcontext,
                          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
index d78c13cb1b5a28b140d965e5b082f50a03520b52..d9b95c79343b98f520a76e0d4371faec2de314f9 100644 (file)
@@ -233,23 +233,6 @@ out:
     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,
index 4111ef0f096bab09a5178aa2c924442093201e66..4a2576a3007fb22d9f403355c05e5e75540050ed 100644 (file)
@@ -71,7 +71,6 @@ krb5_db_put_policy
 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
index f6132e98d02f89c6a2307712b4a1b42273c97fc3..a78bc75109d6c9b285059127cb7de1bf677ac6e9 100644 (file)
@@ -246,7 +246,7 @@ kdb_vftabl PLUGIN_SYMBOL_NAME(krb5_db2, kdb_function_table) = {
     /* 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
index 0fb014a89f63f95ed3f16ba0dc6333748c23daaa..a6a6830b61ba7b2eafd7e477766d1b76b513cf76 100644 (file)
@@ -74,7 +74,6 @@ kdb_vftabl PLUGIN_SYMBOL_NAME(krb5_ldap, kdb_function_table) = {
     /* 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,