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
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().
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)\
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()\
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 {
/*
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. */
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 *******************************************/