From e8e314bbb11c51dffed5ea66a3ac074505a67419 Mon Sep 17 00:00:00 2001 From: Nicolas Williams Date: Mon, 14 Mar 2011 16:27:53 -0500 Subject: [PATCH] Beginning of another new kadm5 function. Need to switch branches for a bit. --- kadmin/server.c | 7 ++++--- lib/kadm5/common_glue.c | 30 +++++++++++++++++++++++++++++- 2 files changed, 33 insertions(+), 4 deletions(-) diff --git a/kadmin/server.c b/kadmin/server.c index 3a8f68fff..bc8dd3d61 100644 --- a/kadmin/server.c +++ b/kadmin/server.c @@ -395,9 +395,10 @@ kadmind_dispatch(void *kadm_handlep, krb5_boolean initial, } } } - ret = kadm5_randkey_principal_3(kadm_handle, princ, keepold, n_ks_tuple, - ks_tuple, &new_keys, &n_keys); - krb5_free_principal(context->context, princ); + ret = kadm5_randkey_principal_3(kadm_handlep, princ, keepold, + n_ks_tuple, ks_tuple, &new_keys, + &n_keys); + krb5_free_principal(contextp->context, princ); krb5_storage_free(sp); sp = krb5_storage_emem(); diff --git a/lib/kadm5/common_glue.c b/lib/kadm5/common_glue.c index 87381a9ea..cf4af64a8 100644 --- a/lib/kadm5/common_glue.c +++ b/lib/kadm5/common_glue.c @@ -45,6 +45,17 @@ kadm5_chpass_principal(void *server_handle, return __CALL(chpass_principal, (server_handle, princ, password)); } +kadm5_ret_t +kadm5_chpass_principal_3(void *server_handle, + krb5_principal princ, + krb5_boolean keepold, + int n_ks_tuple, + krb5_key_salt_tuple *ks_tuple, + const char *password) +{ + return __CALL(chpass_principal, (server_handle, princ, password)); +} + kadm5_ret_t kadm5_chpass_principal_with_key(void *server_handle, krb5_principal princ, @@ -92,6 +103,19 @@ kadm5_get_principal(void *server_handle, return __CALL(get_principal, (server_handle, princ, out, mask)); } +#if 0 +/** + * Extract decrypted keys from kadm5_principal_ent_t object. + * + * @server_handle is the kadm5 handle + * @entry is the HDB entry for the principal in question + * @ktype is the enctype to get a key for, or -1 to get the first one + * @stype is the salttype to get a key for, or -1 to get the first match + * @kvno is the kvno to search for, or -1 to get the first match (highest kvno) + * @keyblock is where the key will be placed + * @keysalt, if not NULL, is where the salt will be placed + * @kvnop, if not NULL, is where the selected kvno will be placed + */ kadm5_ret_t kadm5_decrypt_key(void *server_handle, kadm5_principal_ent_t entry, @@ -99,8 +123,12 @@ kadm5_decrypt_key(void *server_handle, int32_t kvno, krb5_keyblock *keyblock, krb5_keysalt *keysalt, int *kvnop) { - + int i; + + for (i = 0; i < entry->n_key_data; i++) { + } } +#endif kadm5_ret_t kadm5_modify_principal(void *server_handle,