send a new request with the new padata returned by krb5_do_preauth_tryagain()
authorKevin Coffman <kwc@citi.umich.edu>
Fri, 1 Dec 2006 19:36:38 +0000 (19:36 +0000)
committerKevin Coffman <kwc@citi.umich.edu>
Fri, 1 Dec 2006 19:36:38 +0000 (19:36 +0000)
    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: new
Component: krb5-libs
Target_Version: 1.6
Tags: pullup

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@18896 dc483132-0cff-0310-8789-dd5450dbe970

src/include/k5-int.h
src/lib/krb5/krb/get_in_tkt.c
src/lib/krb5/krb/preauth2.c

index 6568ab132a4491df4b25c901ee09410daaacfe07..1935daeeb8e0c06144fa55d58d21e22797366d59 100644 (file)
@@ -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,
index a71d98d410801948225ab235cba2ba83a470467e..9cf022fe82f4edcf466076c4d1b5f7bb8b881036 100644 (file)
@@ -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,
index 81b7e2c57e8813f87cd379ba871efbde447c0691..7c34ca206059a39e48d69a3886e773a72e1016df 100644 (file)
@@ -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;
                }
            }