From: Greg Hudson Date: Fri, 2 Jul 2010 20:16:21 +0000 (+0000) Subject: Remove store_master_key from the DAL table, and implement X-Git-Tag: krb5-1.9-beta1~163 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=177975bb4e463da07c756f6603e9f4adc97d3cfa;p=krb5.git Remove store_master_key from the DAL table, and implement 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 --- diff --git a/src/include/kdb.h b/src/include/kdb.h index b959b1572..f7765c58b 100644 --- a/src/include/kdb.h +++ b/src/include/kdb.h @@ -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 diff --git a/src/lib/kdb/kdb5.c b/src/lib/kdb/kdb5.c index b06cf76c5..7b31a96dc 100644 --- a/src/lib/kdb/kdb5.c +++ b/src/lib/kdb/kdb5.c @@ -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 diff --git a/src/lib/kdb/kdb_default.c b/src/lib/kdb/kdb_default.c index d78c13cb1..d9b95c793 100644 --- a/src/lib/kdb/kdb_default.c +++ b/src/lib/kdb/kdb_default.c @@ -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, diff --git a/src/lib/kdb/libkdb5.exports b/src/lib/kdb/libkdb5.exports index 4111ef0f0..4a2576a30 100644 --- a/src/lib/kdb/libkdb5.exports +++ b/src/lib/kdb/libkdb5.exports @@ -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 diff --git a/src/plugins/kdb/db2/db2_exp.c b/src/plugins/kdb/db2/db2_exp.c index f6132e98d..a78bc7510 100644 --- a/src/plugins/kdb/db2/db2_exp.c +++ b/src/plugins/kdb/db2/db2_exp.c @@ -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 diff --git a/src/plugins/kdb/ldap/ldap_exp.c b/src/plugins/kdb/ldap/ldap_exp.c index 0fb014a89..a6a6830b6 100644 --- a/src/plugins/kdb/ldap/ldap_exp.c +++ b/src/plugins/kdb/ldap/ldap_exp.c @@ -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,