diff options
author | Ken Raeburn <raeburn@mit.edu> | 2003-03-12 04:33:30 +0000 |
---|---|---|
committer | Ken Raeburn <raeburn@mit.edu> | 2003-03-12 04:33:30 +0000 |
commit | 6670198c5e4945eaabfec95e24b0c47c7d97fc44 (patch) | |
tree | 787e044efe4a2b753259125c1920e27c4be605b3 /src/lib/krb5/asn.1/asn1_get.h | |
parent | 9347b515ef987e4b1194fb7a03a7e1f8a6496670 (diff) | |
download | krb5-6670198c5e4945eaabfec95e24b0c47c7d97fc44.zip krb5-6670198c5e4945eaabfec95e24b0c47c7d97fc44.tar.gz krb5-6670198c5e4945eaabfec95e24b0c47c7d97fc44.tar.bz2 |
Rewrite asn1_get_tag interface to use a structure pointer rather than several
pointer variables for the returned data. Use the structure in the caller when
straightforward; in cases where macros use different but overlapping sets of
automatic scalar variables in one file, copy the values out of the structures
for now, until they can be analyzed more carefully.
* asn1_get.c (asn1_get_tag): Deleted.
(asn1_get_tag_2): Renamed from asn1_get_tag_indef, now uses a pointer to
taginfo rather than a bunch of pointer args.
(asn1_get_id, asn1_get_length): Folded into asn1_get_tag_2.
(asn1_get_sequence): Call asn1_get_tag_2.
* asn1_get.h (taginfo): New structure.
(asn1_get_tag_indef, asn1_get_tag, asn1_get_id, asn1_get_length): Declarations
deleted.
(asn1_get_tag_2): Declare.
* asn1_decode.c (setup): Declare only a taginfo variable.
(asn1class, construction, tagnum, length): New macros.
(tag): Call asn1_get_tag_2.
* asn1_k_decode.c (next_tag, get_eoc, apptag, end_sequence_of,
end_sequence_of_no_tagvars, asn1_decode_krb5_flags): Call asn1_get_tag_2; if no
error, copy out values into scalar variables.
(asn1_decode_ticket): Call asn1_get_tag_2.
* asn1buf.c (asn1buf_skiptail): Call asn1_get_tag_2.
* krb5_decode.c (check_apptag, next_tag, get_eoc): Call asn1_get_tag_2; if no
error, copy out values into scalar variables.
(decode_krb5_enc_kdc_rep_part): Call asn1_get_tag_2.
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@15274 dc483132-0cff-0310-8789-dd5450dbe970
Diffstat (limited to 'src/lib/krb5/asn.1/asn1_get.h')
-rw-r--r-- | src/lib/krb5/asn.1/asn1_get.h | 36 |
1 files changed, 13 insertions, 23 deletions
diff --git a/src/lib/krb5/asn.1/asn1_get.h b/src/lib/krb5/asn.1/asn1_get.h index 169490a..50a1b75 100644 --- a/src/lib/krb5/asn.1/asn1_get.h +++ b/src/lib/krb5/asn.1/asn1_get.h @@ -33,12 +33,24 @@ #include "krbasn1.h" #include "asn1buf.h" +typedef struct { + asn1_class asn1class; + asn1_construction construction; + asn1_tagnum tagnum; + unsigned int length; + int indef; +} taginfo; + +asn1_error_code asn1_get_tag_2 (asn1buf *buf, taginfo *tinfo); + +#if 0 asn1_error_code asn1_get_tag_indef (asn1buf *buf, asn1_class *Class, asn1_construction *construction, asn1_tagnum *tagnum, unsigned int *retlen, int *indef); + asn1_error_code asn1_get_tag (asn1buf *buf, asn1_class *Class, @@ -53,6 +65,7 @@ asn1_error_code asn1_get_tag If *buf is empty to begin with, *tagnum is set to ASN1_TAGNUM_CEILING. Returns ASN1_OVERRUN if *buf is exhausted during the parse. */ +#endif asn1_error_code asn1_get_sequence (asn1buf *buf, unsigned int *retlen, int *indef); @@ -61,27 +74,4 @@ asn1_error_code asn1_get_sequence doesn't have a sequence ID. If retlen != NULL, the associated length is returned in *retlen. */ -/****************************************************************/ -/* Private Procedures */ - -asn1_error_code asn1_get_id - (asn1buf *buf, - asn1_class *Class, - asn1_construction *construction, - asn1_tagnum *tagnum); -/* requires *buf is allocated - effects Decodes the group of identifier octets at *buf's - current position. If class != NULL, returns the class - in *Class. Similarly, the construction and tag number - are returned in *construction and *tagnum, respectively. - Returns ASN1_OVERRUN if *buf is exhausted. */ - -asn1_error_code asn1_get_length - (asn1buf *buf, unsigned int *retlen, int *indef); -/* requires *buf is allocated - effects Decodes the group of length octets at *buf's - current position. If retlen != NULL, the - length is returned in *retlen. - Returns ASN1_OVERRUN if *buf is exhausted. */ - #endif |