From 3708e0fe3a258f0bb6eb858ea1af29315fcbe3c7 Mon Sep 17 00:00:00 2001 From: Tom Yu Date: Fri, 1 Dec 2006 23:23:19 +0000 Subject: [PATCH] pull up r18896 from trunk r18896@cathode-dark-space: coffman | 2006-12-01 14:36:38 -0500 subject: send a new request with the new padata returned by krb5_do_preauth_tryagain() ticket: new Component: krb5-libs Target_Version: 1.6 Tags: pullup Send another request containing the padata obtained from tryagain. * src/include/k5-int.h Update prototype * src/lib/krb5/krb/get_in_tkt.c Send pointer to the request.padata so krb5_do_preauth_tryagain() can update the request to be sent. * src/lib/krb5/krb/preauth2.c If a module returns modified padata, add it to the return_padata and return. ticket: 4973 version_fixed: 1.6 git-svn-id: svn://anonsvn.mit.edu/krb5/branches/krb5-1-6@18903 dc483132-0cff-0310-8789-dd5450dbe970 --- src/include/k5-int.h | 2 +- src/lib/krb5/krb/get_in_tkt.c | 2 +- src/lib/krb5/krb/preauth2.c | 7 +++---- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/src/include/k5-int.h b/src/include/k5-int.h index 6568ab132..1935daeeb 100644 --- a/src/include/k5-int.h +++ b/src/include/k5-int.h @@ -1067,7 +1067,7 @@ krb5_error_code KRB5_CALLCONV krb5_do_preauth_tryagain krb5_kdc_req *request, krb5_data *encoded_request_body, krb5_data *encoded_previous_request, - krb5_pa_data **in_padata, + krb5_pa_data **in_padata, krb5_pa_data ***out_padata, krb5_error *err_reply, krb5_data *salt, krb5_data *s2kparams, krb5_enctype *etype, krb5_keyblock *as_key, diff --git a/src/lib/krb5/krb/get_in_tkt.c b/src/lib/krb5/krb/get_in_tkt.c index a71d98d41..9cf022fe8 100644 --- a/src/lib/krb5/krb/get_in_tkt.c +++ b/src/lib/krb5/krb/get_in_tkt.c @@ -1120,7 +1120,7 @@ krb5_get_init_creds(krb5_context context, &request, encoded_request_body, encoded_previous_request, - preauth_to_use, + preauth_to_use, &request.padata, err_reply, &salt, &s2kparams, &etype, &as_key, prompter, prompter_data, diff --git a/src/lib/krb5/krb/preauth2.c b/src/lib/krb5/krb/preauth2.c index 8a50ac257..7c103bb4d 100644 --- a/src/lib/krb5/krb/preauth2.c +++ b/src/lib/krb5/krb/preauth2.c @@ -1290,6 +1290,7 @@ krb5_do_preauth_tryagain(krb5_context kcontext, krb5_data *encoded_request_body, krb5_data *encoded_previous_request, krb5_pa_data **padata, + krb5_pa_data ***return_padata, krb5_error *err_reply, krb5_data *salt, krb5_data *s2kparams, krb5_enctype *etype, @@ -1303,6 +1304,7 @@ krb5_do_preauth_tryagain(krb5_context kcontext, krb5_preauth_context *context; struct _krb5_preauth_context_module *module; int i, j; + int out_pa_list_size = 0; ret = KRB_ERR_GENERIC; if (kcontext->preauth_context == NULL) { @@ -1338,10 +1340,7 @@ krb5_do_preauth_tryagain(krb5_context kcontext, as_key, &out_padata) == 0) { if (out_padata != NULL) { - if (padata[i]->contents != NULL) - free(padata[i]->contents); - free(padata[i]); - padata[i] = out_padata; + grow_pa_list(return_padata, &out_pa_list_size, out_padata); return 0; } } -- 2.26.2