svn rev #22119: branches/fast/src/ include/ lib/krb5/asn.1/

hartmans@MIT.EDU hartmans at MIT.EDU
Thu Mar 26 01:36:23 EDT 2009


http://src.mit.edu/fisheye/changelog/krb5/?cs=22119
Commit By: hartmans
Log Message:
kdc_req_body in fast_req should be a pointer

The req_body needs to be a pointer so  after FAST processing it can replace the request.


Changed Files:
U   branches/fast/src/include/k5-int.h
U   branches/fast/src/lib/krb5/asn.1/asn1_k_encode.c
U   branches/fast/src/lib/krb5/asn.1/krb5_decode.c
Modified: branches/fast/src/include/k5-int.h
===================================================================
--- branches/fast/src/include/k5-int.h	2009-03-26 05:36:20 UTC (rev 22118)
+++ branches/fast/src/include/k5-int.h	2009-03-26 05:36:23 UTC (rev 22119)
@@ -978,7 +978,7 @@
     krb5_magic magic;
     krb5_int32 fast_options;
     /* padata from req_body is used*/
-   krb5_kdc_req req_body;
+   krb5_kdc_req *req_body;
 } krb5_fast_req;
 
     typedef struct _krb5_fast_finished {
@@ -1614,6 +1614,9 @@
 krb5_error_code encode_krb5_pa_fx_fast_reply
 (const krb5_enc_data *, krb5_data **);
 
+krb5_error_code encode_krb5_fast_response
+(const krb5_fast_response *, krb5_data **);
+
 /*************************************************************************
  * End of prototypes for krb5_encode.c
  *************************************************************************/

Modified: branches/fast/src/lib/krb5/asn.1/asn1_k_encode.c
===================================================================
--- branches/fast/src/lib/krb5/asn.1/asn1_k_encode.c	2009-03-26 05:36:20 UTC (rev 22118)
+++ branches/fast/src/lib/krb5/asn.1/asn1_k_encode.c	2009-03-26 05:36:23 UTC (rev 22119)
@@ -338,6 +338,8 @@
 DEFFNXTYPE(kdc_req_body, krb5_kdc_req, asn1_encode_kdc_req_body);
 /* end ugly hack */
 
+DEFPTRTYPE(ptr_kdc_req_body,kdc_req_body);
+
 static const struct field_info transited_fields[] = {
     FIELDOF_NORM(krb5_transited, octet, tr_type, 0),
     FIELDOF_NORM(krb5_transited, ostring_data, tr_contents, 1),
@@ -1204,10 +1206,14 @@
 DEFFIELDTYPE( pa_fx_fast_request, krb5_fast_armored_req,
               FIELDOF_ENCODEAS( krb5_fast_armored_req, fast_armored_req, 0));
 
+DEFFIELDTYPE(fast_req_padata, krb5_kdc_req,
+             FIELDOF_NORM(krb5_kdc_req, ptr_seqof_pa_data, padata, -1));
+DEFPTRTYPE(ptr_fast_req_padata, fast_req_padata);
+
 static const struct field_info fast_req_fields[] = {
     FIELDOF_NORM(krb5_fast_req, int32, fast_options, 0),
-    FIELDOF_NORM( krb5_fast_req, ptr_seqof_pa_data, req_body.padata, 1),
-    FIELDOF_NORM( krb5_fast_req, kdc_req_body, req_body, 2),
+    FIELDOF_NORM( krb5_fast_req, ptr_fast_req_padata, req_body, 1),
+    FIELDOF_NORM( krb5_fast_req, ptr_kdc_req_body, req_body, 2),
 };
 
 DEFSEQTYPE(fast_req, krb5_fast_req, fast_req_fields, 0);

Modified: branches/fast/src/lib/krb5/asn.1/krb5_decode.c
===================================================================
--- branches/fast/src/lib/krb5/asn.1/krb5_decode.c	2009-03-26 05:36:20 UTC (rev 22118)
+++ branches/fast/src/lib/krb5/asn.1/krb5_decode.c	2009-03-26 05:36:23 UTC (rev 22119)
@@ -1107,18 +1107,24 @@
 krb5_error_code decode_krb5_fast_req
 (const krb5_data *code, krb5_fast_req **repptr)
 {
-  setup(krb5_fast_req *);
-  alloc_field(rep);
-  clear_field(rep, req_body.padata);
-  {begin_structure();
-  
-
-  get_field(rep->fast_options, 0, asn1_decode_int32);
-  opt_field(rep->req_body.padata, 1, asn1_decode_sequence_of_pa_data);
-  get_field(rep->req_body, 2, asn1_decode_kdc_req_body);
-  end_structure(); }
-  rep->magic  = KV5M_FAST_REQ;
-  cleanup(free);
+    setup(krb5_fast_req *);
+    alloc_field(rep);
+    alloc_field(rep->req_body);
+    clear_field(rep, req_body->padata);
+    {begin_structure();
+    get_field(rep->fast_options, 0, asn1_decode_int32);
+    opt_field(rep->req_body->padata, 1, asn1_decode_sequence_of_pa_data);
+    get_field(*(rep->req_body), 2, asn1_decode_kdc_req_body);
+    end_structure(); }
+    rep->magic  = KV5M_FAST_REQ;
+    cleanup_manual();
+ error_out:
+    if (rep) {
+        if (rep->req_body)
+            krb5_free_kdc_req(0, rep->req_body);
+        free(rep);
+    }
+    return retval;
 }
 
 krb5_error_code decode_krb5_fast_response




More information about the cvs-krb5 mailing list