diff options
-rw-r--r-- | src/kadmin/dbutil/dump.c | 88 | ||||
-rw-r--r-- | src/lib/kadm5/srv/server_kdb.c | 2 | ||||
-rw-r--r-- | src/lib/kdb/kdb5.c | 26 | ||||
-rw-r--r-- | src/lib/kdb/kdb5.h | 2 | ||||
-rw-r--r-- | src/lib/kdb/kdb_default.c | 40 |
5 files changed, 79 insertions, 79 deletions
diff --git a/src/kadmin/dbutil/dump.c b/src/kadmin/dbutil/dump.c index bd087af..7ae2ab5 100644 --- a/src/kadmin/dbutil/dump.c +++ b/src/kadmin/dbutil/dump.c @@ -276,17 +276,17 @@ static krb5_error_code master_key_convert(context, db_entry) memset(&new_key_data, 0, sizeof(new_key_data)); - if (is_mkey) { - key_ptr = &new_master_keyblock; - /* override mkey princ's kvno */ - if (global_params.mask & KADM5_CONFIG_KVNO) - kvno = global_params.kvno; - else - kvno = (krb5_kvno) key_data->key_data_kvno; - } else { - key_ptr = &v5plainkey; - kvno = (krb5_kvno) key_data->key_data_kvno; - } + if (is_mkey) { + key_ptr = &new_master_keyblock; + /* override mkey princ's kvno */ + if (global_params.mask & KADM5_CONFIG_KVNO) + kvno = global_params.kvno; + else + kvno = (krb5_kvno) key_data->key_data_kvno; + } else { + key_ptr = &v5plainkey; + kvno = (krb5_kvno) key_data->key_data_kvno; + } retval = krb5_dbekd_encrypt_key_data(context, &new_master_keyblock, key_ptr, &keysalt, @@ -1111,7 +1111,7 @@ dump_db(argc, argv) master_keyblock.enctype, TRUE, FALSE, (char *) NULL, - NULL, NULL, + NULL, NULL, &master_keyblock); if (retval) { com_err(argv[0], retval, @@ -1120,7 +1120,7 @@ dump_db(argc, argv) } retval = krb5_db_verify_master_key(util_context, master_princ, - IGNORE_VNO, + IGNORE_VNO, &master_keyblock); if (retval) { com_err(argv[0], retval, @@ -1132,37 +1132,37 @@ dump_db(argc, argv) if (new_master_keyblock.enctype == ENCTYPE_UNKNOWN) new_master_keyblock.enctype = DEFAULT_KDC_ENCTYPE; - if (new_mkey_file) { - krb5_kvno kt_kvno; - - if (global_params.mask & KADM5_CONFIG_KVNO) - kt_kvno = global_params.kvno; - else - kt_kvno = IGNORE_VNO; - - if ((retval = krb5_db_fetch_mkey(util_context, master_princ, - new_master_keyblock.enctype, - FALSE, - FALSE, - new_mkey_file, - &kt_kvno, - NULL, - &new_master_keyblock))) { - com_err(argv[0], retval, "while reading new master key"); - exit(1); - } - } else { - printf("Please enter new master key....\n"); - if ((retval = krb5_db_fetch_mkey(util_context, master_princ, - new_master_keyblock.enctype, - TRUE, - TRUE, - NULL, NULL, NULL, - &new_master_keyblock))) { - com_err(argv[0], retval, "while reading new master key"); - exit(1); - } - } + if (new_mkey_file) { + krb5_kvno kt_kvno; + + if (global_params.mask & KADM5_CONFIG_KVNO) + kt_kvno = global_params.kvno; + else + kt_kvno = IGNORE_VNO; + + if ((retval = krb5_db_fetch_mkey(util_context, master_princ, + new_master_keyblock.enctype, + FALSE, + FALSE, + new_mkey_file, + &kt_kvno, + NULL, + &new_master_keyblock))) { + com_err(argv[0], retval, "while reading new master key"); + exit(1); + } + } else { + printf("Please enter new master key....\n"); + if ((retval = krb5_db_fetch_mkey(util_context, master_princ, + new_master_keyblock.enctype, + TRUE, + TRUE, + NULL, NULL, NULL, + &new_master_keyblock))) { + com_err(argv[0], retval, "while reading new master key"); + exit(1); + } + } } kret = 0; diff --git a/src/lib/kadm5/srv/server_kdb.c b/src/lib/kadm5/srv/server_kdb.c index 048934b..836cd00 100644 --- a/src/lib/kadm5/srv/server_kdb.c +++ b/src/lib/kadm5/srv/server_kdb.c @@ -54,7 +54,7 @@ krb5_error_code kdb_init_master(kadm5_server_handle_t handle, master_keyblock.enctype, from_kbd, FALSE /* only prompt once */, handle->params.stash_file, - NULL /* don't care about kvno */, + NULL /* don't care about kvno */, NULL /* I'm not sure about this, but it's what the kdc does --marc */, &master_keyblock); diff --git a/src/lib/kdb/kdb5.c b/src/lib/kdb/kdb5.c index 7a13750..a418c87 100644 --- a/src/lib/kdb/kdb5.c +++ b/src/lib/kdb/kdb5.c @@ -1249,15 +1249,15 @@ char *krb5_mkey_pwd_prompt1 = KRB5_KDC_MKEY_1; char *krb5_mkey_pwd_prompt2 = KRB5_KDC_MKEY_2; krb5_error_code -krb5_db_fetch_mkey( krb5_context context, - krb5_principal mname, - krb5_enctype etype, - krb5_boolean fromkeyboard, - krb5_boolean twice, - char * db_args, - krb5_kvno * kvno, - krb5_data * salt, - krb5_keyblock * key) +krb5_db_fetch_mkey(krb5_context context, + krb5_principal mname, + krb5_enctype etype, + krb5_boolean fromkeyboard, + krb5_boolean twice, + char * db_args, + krb5_kvno * kvno, + krb5_data * salt, + krb5_keyblock * key) { krb5_error_code retval; char password[BUFSIZ]; @@ -1365,10 +1365,10 @@ krb5_db_fetch_mkey( krb5_context context, } krb5_error_code -krb5_db_verify_master_key( krb5_context kcontext, - krb5_principal mprinc, - krb5_kvno kvno, - krb5_keyblock * mkey) +krb5_db_verify_master_key(krb5_context kcontext, + krb5_principal mprinc, + krb5_kvno kvno, + krb5_keyblock * mkey) { krb5_error_code status = 0; kdb5_dal_handle *dal_handle; diff --git a/src/lib/kdb/kdb5.h b/src/lib/kdb/kdb5.h index 09fe909..f9f4494 100644 --- a/src/lib/kdb/kdb5.h +++ b/src/lib/kdb/kdb5.h @@ -139,7 +139,7 @@ typedef struct _kdb_vftabl{ krb5_error_code (*store_master_key) (krb5_context kcontext, char *db_arg, krb5_principal mname, - krb5_kvno kvno, + krb5_kvno kvno, krb5_keyblock *key, char *master_pwd); diff --git a/src/lib/kdb/kdb_default.c b/src/lib/kdb/kdb_default.c index 85267e4..232a087 100644 --- a/src/lib/kdb/kdb_default.c +++ b/src/lib/kdb/kdb_default.c @@ -175,7 +175,7 @@ krb5_def_store_mkey(krb5_context context, /* Use temp keytab file name in case creation of keytab fails */ /* create temp file template for use by mktemp() */ - if ((retval = asprintf(&tmp_ktname, "WRFILE:%s_XXXXX", keyfile)) < 0) { + if ((retval = asprintf(&tmp_ktname, "WRFILE:%s_XXXXXX", keyfile)) < 0) { krb5_set_error_message (context, retval, "Could not create temp keytab file name."); goto out; @@ -229,10 +229,10 @@ out: } static krb5_error_code -krb5_db_def_fetch_mkey_stash( krb5_context context, - const char *keyfile, - krb5_keyblock *key, - krb5_kvno *kvno) +krb5_db_def_fetch_mkey_stash(krb5_context context, + const char *keyfile, + krb5_keyblock *key, + krb5_kvno *kvno) { krb5_error_code retval = 0; krb5_ui_2 enctype; @@ -298,11 +298,11 @@ krb5_db_def_fetch_mkey_stash( krb5_context context, } static krb5_error_code -krb5_db_def_fetch_mkey_keytab( krb5_context context, - const char *keyfile, - krb5_principal mname, - krb5_keyblock *key, - krb5_kvno *kvno) +krb5_db_def_fetch_mkey_keytab(krb5_context context, + const char *keyfile, + krb5_principal mname, + krb5_keyblock *key, + krb5_kvno *kvno) { krb5_error_code retval = 0; krb5_keytab kt; @@ -339,7 +339,7 @@ krb5_db_def_fetch_mkey_keytab( krb5_context context, * same as the one returned from the keytab. */ if (kvno != NULL && *kvno == IGNORE_VNO) - *kvno = kt_ent.vno; + *kvno = kt_ent.vno; /* * kt_ent will be free'd so need to allocate and copy key contents for @@ -359,11 +359,11 @@ errout: } krb5_error_code -krb5_db_def_fetch_mkey( krb5_context context, - krb5_principal mname, - krb5_keyblock *key, - krb5_kvno *kvno, - char *db_args) +krb5_db_def_fetch_mkey(krb5_context context, + krb5_principal mname, + krb5_keyblock *key, + krb5_kvno *kvno, + char *db_args) { krb5_error_code retval_ofs = 0, retval_kt = 0; char keyfile[MAXPATHLEN+1]; @@ -410,10 +410,10 @@ krb5_db_def_fetch_mkey( krb5_context context, } krb5_error_code -krb5_def_verify_master_key( krb5_context context, - krb5_principal mprinc, - krb5_kvno kvno, - krb5_keyblock *mkey) +krb5_def_verify_master_key(krb5_context context, + krb5_principal mprinc, + krb5_kvno kvno, + krb5_keyblock *mkey) { krb5_error_code retval; krb5_db_entry master_entry; |