diff options
author | Simo Sorce <ssorce@redhat.com> | 2011-06-20 19:35:50 -0400 |
---|---|---|
committer | Simo Sorce <ssorce@redhat.com> | 2011-08-26 08:24:49 -0400 |
commit | 452fcdccdccb4340f20c85dd9d4f45ee2b02bf37 (patch) | |
tree | 65e61bd20f90aad8b56ffe92b8083c3091a4703a /util/ipa_krb5.c | |
parent | 49c25dbdf5b51a6cc157135a0d2f89c7eb408dd9 (diff) | |
download | freeipa-452fcdccdccb4340f20c85dd9d4f45ee2b02bf37.tar.gz freeipa-452fcdccdccb4340f20c85dd9d4f45ee2b02bf37.tar.xz freeipa-452fcdccdccb4340f20c85dd9d4f45ee2b02bf37.zip |
ipa-kdb: implement change_pwd function
Diffstat (limited to 'util/ipa_krb5.c')
-rw-r--r-- | util/ipa_krb5.c | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/util/ipa_krb5.c b/util/ipa_krb5.c index 96056c76..5b6fc582 100644 --- a/util/ipa_krb5.c +++ b/util/ipa_krb5.c @@ -452,3 +452,36 @@ fail: return kerr; } +krb5_error_code filter_key_salt_tuples(krb5_context context, + krb5_key_salt_tuple *req, int n_req, + krb5_key_salt_tuple *supp, int n_supp, + krb5_key_salt_tuple **res, int *n_res) +{ + krb5_key_salt_tuple *ks = NULL; + int n_ks; + int i, j; + + ks = calloc(n_req, sizeof(krb5_key_salt_tuple)); + if (!ks) { + return ENOMEM; + } + n_ks = 0; + + for (i = 0; i < n_req; i++) { + for (j = 0; j < n_supp; j++) { + if (req[i].ks_enctype == supp[j].ks_enctype && + req[i].ks_salttype == supp[j].ks_salttype) { + break; + } + } + if (j < n_supp) { + ks[n_ks] = req[i]; + n_ks++; + } + } + + *res = ks; + *n_res = n_ks; + return 0; +} + |