* asn1buf.c (asn1buf_sync): Add length parameter to disambiguate
authorTom Yu <tlyu@mit.edu>
Sun, 4 Jul 1999 00:44:07 +0000 (00:44 +0000)
committerTom Yu <tlyu@mit.edu>
Sun, 4 Jul 1999 00:44:07 +0000 (00:44 +0000)
constructed-indefinite encoding from constructed-definite encoding
which happens to end at the same place as the enclosing buf.

* asn1buf.h: Update to match definition.

* krb5_decode.c (end_structure): Update to deal with additional
length parameter to asn1buf_sync().

* asn1_k_decode.c (end_sequence_of, end_structure): Update to deal
with additional length parameter to asn1buf_sync().

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

src/lib/krb5/asn.1/ChangeLog
src/lib/krb5/asn.1/asn1_k_decode.c
src/lib/krb5/asn.1/asn1buf.c
src/lib/krb5/asn.1/asn1buf.h
src/lib/krb5/asn.1/krb5_decode.c

index 4b4d3184781473f74fb7821762359f8796ccfc8c..d66129f8b974448e1eabb0a4277003399313e182 100644 (file)
@@ -1,5 +1,17 @@
 1999-07-03  Tom Yu  <tlyu@mit.edu>
 
+       * asn1buf.c (asn1buf_sync): Add length parameter to disambiguate
+       constructed-indefinite encoding from constructed-definite encoding
+       which happens to end at the same place as the enclosing buf.
+
+       * asn1buf.h: Update to match definition.
+
+       * krb5_decode.c (end_structure): Update to deal with additional
+       length parameter to asn1buf_sync().
+
+       * asn1_k_decode.c (end_sequence_of, end_structure): Update to deal
+       with additional length parameter to asn1buf_sync().
+
        * asn1buf.h: New prototpyes for asn1buf_sync() and
        asn1buf_skiptail().
 
index 875db9ade5dcb72413314543dd3cb648fcd4ac3d..2ecb1c342c93b7f65ed145a512b1b686dd9e252a 100644 (file)
@@ -98,7 +98,7 @@ if(retval) return retval;\
 next_tag()
 
 #define end_structure()\
-retval = asn1buf_sync(buf,&subbuf,tagnum);\
+retval = asn1buf_sync(buf,&subbuf,tagnum,length);\
 if(retval) return retval
 
 #define sequence_of(buf)\
@@ -111,7 +111,7 @@ retval = asn1buf_imbed(&seqbuf,buf,length);\
 if(retval) return retval
 
 #define end_sequence_of(buf)\
-retval = asn1buf_sync(buf,&seqbuf,ASN1_TAGNUM_CEILING);\
+retval = asn1buf_sync(buf,&seqbuf,ASN1_TAGNUM_CEILING,length);\
 if(retval) return retval
 
 #define cleanup()\
index 648626ee5585d199ff0e773a2100954b48671cee..6d7a950b93a64718153cbbcff0b6a81e24e14d37 100644 (file)
@@ -90,14 +90,15 @@ asn1_error_code asn1buf_imbed(subbuf, buf, length)
   return 0;
 }
 
-asn1_error_code asn1buf_sync(buf, subbuf, lasttag)
+asn1_error_code asn1buf_sync(buf, subbuf, lasttag, length)
      asn1buf * buf;
      asn1buf * subbuf;
-     asn1_tagnum lasttag;
+     const asn1_tagnum lasttag;
+     const int length;
 {
   asn1_error_code retval;
 
-  if (subbuf->bound != buf->bound) {
+  if (length) {
     buf->next = subbuf->bound + 1;
   } else {
     /*
index 1d7373ed053e4c8cdf24f12050f78ad2329e3958..bf2f252a37e867f7208afb980bb2f355fc2d6d4d 100644 (file)
@@ -120,7 +120,8 @@ asn1_error_code asn1buf_imbed
              position starts at the beginning of *subbuf. */
 
 asn1_error_code asn1buf_sync
-       PROTOTYPE((asn1buf *buf, asn1buf *subbuf, asn1_tagnum lasttag));
+       PROTOTYPE((asn1buf *buf, asn1buf *subbuf, const asn1_tagnum lasttag,
+                  const int length));
 /* requires  *subbuf is a sub-buffer of *buf, as created by asn1buf_imbed.
              lasttag is a pointer to the last tagnumber read.
    effects   Synchronizes *buf's current position to match that of *subbuf. */
index b0fe3160d1e9f4b47347536e3f84b05adcc1a609..ee88b84cc19304074e1e1aa45072f3e4a79bc7ce 100644 (file)
@@ -91,7 +91,7 @@ if(retval) clean_return(retval);\
 next_tag()
 
 #define end_structure()\
-retval = asn1buf_sync(&buf,&subbuf,tagnum);\
+retval = asn1buf_sync(&buf,&subbuf,tagnum,length);\
 if (retval) clean_return(retval)
 
 /* process fields *******************************************/