diff options
author | Ken Raeburn <raeburn@mit.edu> | 2002-09-03 00:32:14 +0000 |
---|---|---|
committer | Ken Raeburn <raeburn@mit.edu> | 2002-09-03 00:32:14 +0000 |
commit | 305a721199f87a4353eabd98d9d1bb55c43c657e (patch) | |
tree | 63ba21b522a88b1de12cfaf01bf88b82c8c2e7b7 /src/lib/krb5/asn.1 | |
parent | 8bdfead10df7a773e007b736219d07eeeb092161 (diff) | |
download | krb5-305a721199f87a4353eabd98d9d1bb55c43c657e.zip krb5-305a721199f87a4353eabd98d9d1bb55c43c657e.tar.gz krb5-305a721199f87a4353eabd98d9d1bb55c43c657e.tar.bz2 |
Use prototype style definitions for functions. Avoid variable name "class"
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@14810 dc483132-0cff-0310-8789-dd5450dbe970
Diffstat (limited to 'src/lib/krb5/asn.1')
-rw-r--r-- | src/lib/krb5/asn.1/ChangeLog | 7 | ||||
-rw-r--r-- | src/lib/krb5/asn.1/asn1_decode.c | 46 | ||||
-rw-r--r-- | src/lib/krb5/asn.1/asn1_encode.c | 59 | ||||
-rw-r--r-- | src/lib/krb5/asn.1/asn1_get.c | 52 | ||||
-rw-r--r-- | src/lib/krb5/asn.1/asn1_get.h | 10 | ||||
-rw-r--r-- | src/lib/krb5/asn.1/asn1_k_decode.c | 207 | ||||
-rw-r--r-- | src/lib/krb5/asn.1/asn1_k_encode.c | 204 | ||||
-rw-r--r-- | src/lib/krb5/asn.1/asn1_make.c | 60 | ||||
-rw-r--r-- | src/lib/krb5/asn.1/asn1_make.h | 14 | ||||
-rw-r--r-- | src/lib/krb5/asn.1/asn1_misc.c | 4 | ||||
-rw-r--r-- | src/lib/krb5/asn.1/asn1buf.c | 101 | ||||
-rw-r--r-- | src/lib/krb5/asn.1/asn1buf.h | 6 | ||||
-rw-r--r-- | src/lib/krb5/asn.1/krb5_decode.c | 158 | ||||
-rw-r--r-- | src/lib/krb5/asn.1/krb5_encode.c | 128 |
14 files changed, 297 insertions, 759 deletions
diff --git a/src/lib/krb5/asn.1/ChangeLog b/src/lib/krb5/asn.1/ChangeLog index 7a80395..28ff982 100644 --- a/src/lib/krb5/asn.1/ChangeLog +++ b/src/lib/krb5/asn.1/ChangeLog @@ -1,3 +1,10 @@ +2002-09-02 Ken Raeburn <raeburn@mit.edu> + + * asn1_decode.c, asn1_encode.c, asn1_get.c, asn1_get.h, + asn1_k_decode.c, asn1_k_encode.c, asn1_make.c, asn1_make.h, + asn1buf,c. asn1buf.h, krb5_decode.c, krb5_encode.c: Use prototype + style definitions for functions. Avoid variable name "class". + 2002-08-29 Ken Raeburn <raeburn@mit.edu> * Makefile.in: Revert $(S)=>/ change, for Windows support. diff --git a/src/lib/krb5/asn.1/asn1_decode.c b/src/lib/krb5/asn.1/asn1_decode.c index e46df32..03a2840 100644 --- a/src/lib/krb5/asn.1/asn1_decode.c +++ b/src/lib/krb5/asn.1/asn1_decode.c @@ -39,15 +39,15 @@ #define setup()\ asn1_error_code retval;\ -asn1_class class;\ +asn1_class asn1class;\ asn1_construction construction;\ asn1_tagnum tagnum;\ unsigned int length #define tag(type)\ -retval = asn1_get_tag(buf,&class,&construction,&tagnum,&length);\ +retval = asn1_get_tag(buf,&asn1class,&construction,&tagnum,&length);\ if(retval) return retval;\ -if(class != UNIVERSAL || construction != PRIMITIVE || tagnum != type)\ +if(asn1class != UNIVERSAL || construction != PRIMITIVE || tagnum != type)\ return ASN1_BAD_ID #define cleanup()\ @@ -55,9 +55,7 @@ return 0 time_t gmt_mktime (struct tm *); -asn1_error_code asn1_decode_integer(buf, val) - asn1buf * buf; - long * val; +asn1_error_code asn1_decode_integer(asn1buf *buf, long int *val) { setup(); asn1_octet o; @@ -82,9 +80,7 @@ asn1_error_code asn1_decode_integer(buf, val) cleanup(); } -asn1_error_code asn1_decode_unsigned_integer(buf, val) - asn1buf * buf; - unsigned long * val; +asn1_error_code asn1_decode_unsigned_integer(asn1buf *buf, long unsigned int *val) { setup(); asn1_octet o; @@ -108,10 +104,7 @@ asn1_error_code asn1_decode_unsigned_integer(buf, val) cleanup(); } -asn1_error_code asn1_decode_octetstring(buf, retlen, val) - asn1buf * buf; - unsigned int * retlen; - asn1_octet ** val; +asn1_error_code asn1_decode_octetstring(asn1buf *buf, unsigned int *retlen, asn1_octet **val) { setup(); tag(ASN1_OCTETSTRING); @@ -121,10 +114,7 @@ asn1_error_code asn1_decode_octetstring(buf, retlen, val) cleanup(); } -asn1_error_code asn1_decode_charstring(buf, retlen, val) - asn1buf * buf; - unsigned int * retlen; - char ** val; +asn1_error_code asn1_decode_charstring(asn1buf *buf, unsigned int *retlen, char **val) { setup(); tag(ASN1_OCTETSTRING); @@ -135,10 +125,7 @@ asn1_error_code asn1_decode_charstring(buf, retlen, val) } -asn1_error_code asn1_decode_generalstring(buf, retlen, val) - asn1buf * buf; - unsigned int * retlen; - char ** val; +asn1_error_code asn1_decode_generalstring(asn1buf *buf, unsigned int *retlen, char **val) { setup(); tag(ASN1_GENERALSTRING); @@ -149,8 +136,7 @@ asn1_error_code asn1_decode_generalstring(buf, retlen, val) } -asn1_error_code asn1_decode_null(buf) - asn1buf * buf; +asn1_error_code asn1_decode_null(asn1buf *buf) { setup(); tag(ASN1_NULL); @@ -158,10 +144,7 @@ asn1_error_code asn1_decode_null(buf) cleanup(); } -asn1_error_code asn1_decode_printablestring(buf, retlen, val) - asn1buf * buf; - int * retlen; - char ** val; +asn1_error_code asn1_decode_printablestring(asn1buf *buf, int *retlen, char **val) { setup(); tag(ASN1_PRINTABLESTRING); @@ -171,10 +154,7 @@ asn1_error_code asn1_decode_printablestring(buf, retlen, val) cleanup(); } -asn1_error_code asn1_decode_ia5string(buf, retlen, val) - asn1buf * buf; - int * retlen; - char ** val; +asn1_error_code asn1_decode_ia5string(asn1buf *buf, int *retlen, char **val) { setup(); tag(ASN1_IA5STRING); @@ -184,9 +164,7 @@ asn1_error_code asn1_decode_ia5string(buf, retlen, val) cleanup(); } -asn1_error_code asn1_decode_generaltime(buf, val) - asn1buf * buf; - time_t * val; +asn1_error_code asn1_decode_generaltime(asn1buf *buf, time_t *val) { setup(); char *s; diff --git a/src/lib/krb5/asn.1/asn1_encode.c b/src/lib/krb5/asn.1/asn1_encode.c index 29256ea..9bc9f57 100644 --- a/src/lib/krb5/asn.1/asn1_encode.c +++ b/src/lib/krb5/asn.1/asn1_encode.c @@ -29,10 +29,8 @@ #include "asn1_encode.h" #include "asn1_make.h" -asn1_error_code asn1_encode_integer(buf, val, retlen) - asn1buf * buf; - const long val; - unsigned int * retlen; +asn1_error_code asn1_encode_integer(asn1buf *buf, long val, + unsigned int *retlen) { asn1_error_code retval; unsigned int length = 0; @@ -67,10 +65,8 @@ asn1_error_code asn1_encode_integer(buf, val, retlen) return 0; } -asn1_error_code asn1_encode_unsigned_integer(buf, val, retlen) - asn1buf * buf; - const unsigned long val; - unsigned int * retlen; +asn1_error_code asn1_encode_unsigned_integer(asn1buf *buf, unsigned long val, + unsigned int *retlen) { asn1_error_code retval; unsigned int length = 0; @@ -101,11 +97,9 @@ asn1_error_code asn1_encode_unsigned_integer(buf, val, retlen) return 0; } -asn1_error_code asn1_encode_octetstring(buf, len, val, retlen) - asn1buf * buf; - const unsigned int len; - const asn1_octet * val; - unsigned int * retlen; +asn1_error_code asn1_encode_octetstring(asn1buf *buf, unsigned int len, + const asn1_octet *val, + unsigned int *retlen) { asn1_error_code retval; unsigned int length; @@ -119,11 +113,8 @@ asn1_error_code asn1_encode_octetstring(buf, len, val, retlen) return 0; } -asn1_error_code asn1_encode_charstring(buf, len, val, retlen) - asn1buf * buf; - const unsigned int len; - const char * val; - unsigned int * retlen; +asn1_error_code asn1_encode_charstring(asn1buf *buf, unsigned int len, + const char *val, unsigned int *retlen) { asn1_error_code retval; unsigned int length; @@ -137,9 +128,7 @@ asn1_error_code asn1_encode_charstring(buf, len, val, retlen) return 0; } -asn1_error_code asn1_encode_null(buf, retlen) - asn1buf * buf; - int * retlen; +asn1_error_code asn1_encode_null(asn1buf *buf, int *retlen) { asn1_error_code retval; @@ -152,11 +141,8 @@ asn1_error_code asn1_encode_null(buf, retlen) return 0; } -asn1_error_code asn1_encode_printablestring(buf, len, val, retlen) - asn1buf * buf; - const unsigned int len; - const char * val; - int * retlen; +asn1_error_code asn1_encode_printablestring(asn1buf *buf, unsigned int len, + const char *val, int *retlen) { asn1_error_code retval; unsigned int length; @@ -170,11 +156,8 @@ asn1_error_code asn1_encode_printablestring(buf, len, val, retlen) return 0; } -asn1_error_code asn1_encode_ia5string(buf, len, val, retlen) - asn1buf * buf; - const unsigned int len; - const char * val; - int * retlen; +asn1_error_code asn1_encode_ia5string(asn1buf *buf, unsigned int len, + const char *val, int *retlen) { asn1_error_code retval; unsigned int length; @@ -188,10 +171,8 @@ asn1_error_code asn1_encode_ia5string(buf, len, val, retlen) return 0; } -asn1_error_code asn1_encode_generaltime(buf, val, retlen) - asn1buf * buf; - const time_t val; - unsigned int * retlen; +asn1_error_code asn1_encode_generaltime(asn1buf *buf, time_t val, + unsigned int *retlen) { asn1_error_code retval; struct tm *gtime; @@ -228,11 +209,9 @@ asn1_error_code asn1_encode_generaltime(buf, val, retlen) return 0; } -asn1_error_code asn1_encode_generalstring(buf, len, val, retlen) - asn1buf * buf; - const unsigned int len; - const char * val; - unsigned int * retlen; +asn1_error_code asn1_encode_generalstring(asn1buf *buf, unsigned int len, + const char *val, + unsigned int *retlen) { asn1_error_code retval; unsigned int length; diff --git a/src/lib/krb5/asn.1/asn1_get.c b/src/lib/krb5/asn.1/asn1_get.c index 1652db1..47dd283 100644 --- a/src/lib/krb5/asn.1/asn1_get.c +++ b/src/lib/krb5/asn.1/asn1_get.c @@ -27,13 +27,9 @@ #include "asn1_get.h" asn1_error_code -asn1_get_tag_indef(buf, class, construction, tagnum, retlen, indef) - asn1buf * buf; - asn1_class * class; - asn1_construction * construction; - asn1_tagnum * tagnum; - unsigned int * retlen; - int * indef; +asn1_get_tag_indef(asn1buf *buf, asn1_class *asn1class, + asn1_construction *construction, asn1_tagnum *tagnum, + unsigned int *retlen, int *indef) { asn1_error_code retval; @@ -42,7 +38,7 @@ asn1_get_tag_indef(buf, class, construction, tagnum, retlen, indef) *tagnum = ASN1_TAGNUM_CEILING; return 0; } - retval = asn1_get_id(buf,class,construction,tagnum); + retval = asn1_get_id(buf,asn1class,construction,tagnum); if(retval) return retval; retval = asn1_get_length(buf,retlen,indef); if(retval) return retval; @@ -53,32 +49,27 @@ asn1_get_tag_indef(buf, class, construction, tagnum, retlen, indef) } asn1_error_code -asn1_get_tag(buf, class, construction, tagnum, retlen) - asn1buf *buf; - asn1_class *class; - asn1_construction *construction; - asn1_tagnum *tagnum; - unsigned int *retlen; +asn1_get_tag(asn1buf *buf, asn1_class *asn1class, + asn1_construction *construction, asn1_tagnum *tagnum, + unsigned int *retlen) { int indef; - return asn1_get_tag_indef(buf, class, construction, tagnum, retlen, &indef); + return asn1_get_tag_indef(buf, asn1class, construction, tagnum, retlen, + &indef); } -asn1_error_code asn1_get_sequence(buf, retlen, indef) - asn1buf * buf; - unsigned int * retlen; - int * indef; +asn1_error_code asn1_get_sequence(asn1buf *buf, unsigned int *retlen, int *indef) { asn1_error_code retval; - asn1_class class; + asn1_class asn1class; asn1_construction construction; asn1_tagnum tagnum; - retval = asn1_get_tag_indef(buf,&class,&construction,&tagnum,retlen,indef); + retval = asn1_get_tag_indef(buf,&asn1class,&construction,&tagnum,retlen,indef); if(retval) return retval; if(retval) return (krb5_error_code)retval; - if(class != UNIVERSAL || construction != CONSTRUCTED || + if(asn1class != UNIVERSAL || construction != CONSTRUCTED || tagnum != ASN1_SEQUENCE) return ASN1_BAD_ID; return 0; } @@ -86,11 +77,9 @@ asn1_error_code asn1_get_sequence(buf, retlen, indef) /****************************************************************/ /* Private Procedures */ -asn1_error_code asn1_get_id(buf, class, construction, tagnum) - asn1buf * buf; - asn1_class * class; - asn1_construction * construction; - asn1_tagnum * tagnum; +asn1_error_code asn1_get_id(asn1buf *buf, asn1_class *asn1class, + asn1_construction *construction, + asn1_tagnum *tagnum) { asn1_error_code retval; asn1_tagnum tn=0; @@ -103,8 +92,8 @@ asn1_error_code asn1_get_id(buf, class, construction, tagnum) retval = asn1buf_remove_octet(buf,&o); if(retval) return retval; - if(class != NULL) - *class = (asn1_class)(o&ASN1_CLASS_MASK); + if(asn1class != NULL) + *asn1class = (asn1_class)(o&ASN1_CLASS_MASK); if(construction != NULL) *construction = (asn1_construction)(o&ASN1_CONSTRUCTION_MASK); if((o&ASN1_TAG_NUMBER_MASK) != ASN1_TAG_NUMBER_MASK){ @@ -122,10 +111,7 @@ asn1_error_code asn1_get_id(buf, class, construction, tagnum) return 0; } -asn1_error_code asn1_get_length(buf, retlen, indef) - asn1buf * buf; - unsigned int * retlen; - int * indef; +asn1_error_code asn1_get_length(asn1buf *buf, unsigned int *retlen, int *indef) { asn1_error_code retval; asn1_octet o; diff --git a/src/lib/krb5/asn.1/asn1_get.h b/src/lib/krb5/asn.1/asn1_get.h index 873abc0..169490a 100644 --- a/src/lib/krb5/asn.1/asn1_get.h +++ b/src/lib/krb5/asn.1/asn1_get.h @@ -35,19 +35,19 @@ asn1_error_code asn1_get_tag_indef (asn1buf *buf, - asn1_class *class, + 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, + asn1_class *Class, asn1_construction *construction, asn1_tagnum *tagnum, unsigned int *retlen); /* requires *buf is allocated effects Decodes the tag in *buf. If class != NULL, returns - the class in *class. Similarly, the construction, + the class in *Class. Similarly, the construction, tag number, and length are returned in *construction, *tagnum, and *retlen, respectively. If *buf is empty to begin with, @@ -66,13 +66,13 @@ asn1_error_code asn1_get_sequence asn1_error_code asn1_get_id (asn1buf *buf, - asn1_class *class, + 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 + in *Class. Similarly, the construction and tag number are returned in *construction and *tagnum, respectively. Returns ASN1_OVERRUN if *buf is exhausted. */ diff --git a/src/lib/krb5/asn.1/asn1_k_decode.c b/src/lib/krb5/asn.1/asn1_k_decode.c index bbb99b3..b1d47df 100644 --- a/src/lib/krb5/asn.1/asn1_k_decode.c +++ b/src/lib/krb5/asn.1/asn1_k_decode.c @@ -31,7 +31,7 @@ #define setup()\ asn1_error_code retval;\ -asn1_class class;\ +asn1_class asn1class;\ asn1_construction construction;\ asn1_tagnum tagnum;\ unsigned int length,taglen @@ -39,15 +39,15 @@ unsigned int length,taglen #define unused_var(x) if(0) {x=0; x=x-x;} #define next_tag()\ -retval = asn1_get_tag_indef(&subbuf,&class,&construction,\ +retval = asn1_get_tag_indef(&subbuf,&asn1class,&construction,\ &tagnum,&taglen,&indef);\ if(retval) return retval; #define get_eoc() \ -retval = asn1_get_tag_indef(&subbuf,&class,&construction, \ +retval = asn1_get_tag_indef(&subbuf,&asn1class,&construction, \ &tagnum,&taglen,&indef); \ if(retval) return retval; \ -if(class != UNIVERSAL || tagnum || indef) \ +if(asn1class != UNIVERSAL || tagnum || indef) \ return ASN1_MISSING_EOC #define alloc_field(var,type)\ @@ -56,9 +56,9 @@ if((var) == NULL) return ENOMEM #define apptag(tagexpect)\ -retval = asn1_get_tag(buf,&class,&construction,&tagnum,&applen);\ +retval = asn1_get_tag(buf,&asn1class,&construction,&tagnum,&applen);\ if(retval) return retval;\ -if(class != APPLICATION || construction != CONSTRUCTED ||\ +if(asn1class != APPLICATION || construction != CONSTRUCTED ||\ tagnum != (tagexpect)) return ASN1_BAD_ID /**** normal fields ****/ @@ -71,14 +71,14 @@ next_tag() #define get_field(var,tagexpect,decoder)\ if(tagnum > (tagexpect)) return ASN1_MISSING_FIELD;\ if(tagnum < (tagexpect)) return ASN1_MISPLACED_FIELD;\ -if((class != CONTEXT_SPECIFIC || construction != CONSTRUCTED) \ - && (tagnum || taglen || class != UNIVERSAL)) \ +if((asn1class != CONTEXT_SPECIFIC || construction != CONSTRUCTED) \ + && (tagnum || taglen || asn1class != UNIVERSAL)) \ return ASN1_BAD_ID;\ get_field_body(var,decoder) #define opt_field(var,tagexpect,decoder,optvalue)\ -if((class != CONTEXT_SPECIFIC || construction != CONSTRUCTED) \ - && (tagnum || taglen || class != UNIVERSAL)) \ +if((asn1class != CONTEXT_SPECIFIC || construction != CONSTRUCTED) \ + && (tagnum || taglen || asn1class != UNIVERSAL)) \ return ASN1_BAD_ID;\ if(tagnum == (tagexpect)){\ get_field_body(var,decoder); }\ @@ -94,8 +94,8 @@ next_tag() #define get_lenfield(len,var,tagexpect,decoder)\ if(tagnum > (tagexpect)) return ASN1_MISSING_FIELD;\ if(tagnum < (tagexpect)) return ASN1_MISPLACED_FIELD;\ -if((class != CONTEXT_SPECIFIC || construction != CONSTRUCTED) \ - && (tagnum || taglen || class != UNIVERSAL)) \ +if((asn1class != CONTEXT_SPECIFIC || construction != CONSTRUCTED) \ + && (tagnum || taglen || asn1class != UNIVERSAL)) \ return ASN1_BAD_ID;\ get_lenfield_body(len,var,decoder) @@ -116,12 +116,12 @@ if(retval) return retval;\ next_tag() #define end_structure()\ -retval = asn1buf_sync(buf,&subbuf,class,tagnum,length,indef,seqindef);\ +retval = asn1buf_sync(buf,&subbuf,asn1class,tagnum,length,indef,seqindef);\ if(retval) return retval #define sequence_of(buf) \ unsigned int length, taglen; \ -asn1_class class; \ +asn1_class asn1class; \ asn1_construction construction; \ asn1_tagnum tagnum; \ int indef; \ @@ -153,10 +153,10 @@ retval = asn1buf_sync(buf,&seqbuf,eseqclass,eseqnum, \ if(retval) return retval; #define end_sequence_of(buf) \ -retval = asn1_get_tag_indef(&seqbuf,&class,&construction, \ +retval = asn1_get_tag_indef(&seqbuf,&asn1class,&construction, \ &tagnum,&taglen,&indef); \ if(retval) return retval; \ -retval = asn1buf_sync(buf,&seqbuf,class,tagnum, \ +retval = asn1buf_sync(buf,&seqbuf,asn1class,tagnum, \ length,indef,seqofindef); \ if(retval) return retval; @@ -166,9 +166,7 @@ return 0 /* scalars */ -asn1_error_code asn1_decode_kerberos_time(buf, val) - asn1buf * buf; - krb5_timestamp * val; +asn1_error_code asn1_decode_kerberos_time(asn1buf *buf, krb5_timestamp *val) { time_t t; asn1_error_code retval; @@ -182,9 +180,7 @@ asn1_error_code asn1_decode_kerberos_time(buf, val) } #define integer_convert(fname,ktype)\ -asn1_error_code fname(buf, val)\ - asn1buf * buf;\ - ktype * val;\ +asn1_error_code fname(asn1buf * buf, ktype * val)\ {\ asn1_error_code retval;\ long n;\ @@ -194,9 +190,7 @@ asn1_error_code fname(buf, val)\ return 0;\ } #define unsigned_integer_convert(fname,ktype)\ -asn1_error_code fname(buf, val)\ - asn1buf * buf;\ - ktype * val;\ +asn1_error_code fname(asn1buf * buf, ktype * val)\ {\ asn1_error_code retval;\ unsigned long n;\ @@ -216,9 +210,7 @@ integer_convert(asn1_decode_authdatatype,krb5_authdatatype) unsigned_integer_convert(asn1_decode_ui_2,krb5_ui_2) unsigned_integer_convert(asn1_decode_ui_4,krb5_ui_4) -asn1_error_code asn1_decode_msgtype(buf, val) - asn1buf * buf; - krb5_msgtype * val; +asn1_error_code asn1_decode_msgtype(asn1buf *buf, krb5_msgtype *val) { asn1_error_code retval; unsigned long n; @@ -232,18 +224,14 @@ asn1_error_code asn1_decode_msgtype(buf, val) /* structures */ -asn1_error_code asn1_decode_realm(buf, val) - asn1buf * buf; - krb5_principal * val; +asn1_error_code asn1_decode_realm(asn1buf *buf, krb5_principal *val) { return asn1_decode_generalstring(buf, &((*val)->realm.length), &((*val)->realm.data)); } -asn1_error_code asn1_decode_principal_name(buf, val) - asn1buf * buf; - krb5_principal * val; +asn1_error_code asn1_decode_principal_name(asn1buf *buf, krb5_principal *val) { setup(); { begin_structure(); @@ -276,9 +264,7 @@ asn1_error_code asn1_decode_principal_name(buf, val) cleanup(); } -asn1_error_code asn1_decode_checksum(buf, val) - asn1buf * buf; - krb5_checksum * val; +asn1_error_code asn1_decode_checksum(asn1buf *buf, krb5_checksum *val) { setup(); { begin_structure(); @@ -290,9 +276,7 @@ asn1_error_code asn1_decode_checksum(buf, val) cleanup(); } -asn1_error_code asn1_decode_encryption_key(buf, val) - asn1buf * buf; - krb5_keyblock * val; +asn1_error_code asn1_decode_encryption_key(asn1buf *buf, krb5_keyblock *val) { setup(); { begin_structure(); @@ -304,9 +288,7 @@ asn1_error_code asn1_decode_encryption_key(buf, val) cleanup(); } -asn1_error_code asn1_decode_encrypted_data(buf, val) - asn1buf * buf; - krb5_enc_data * val; +asn1_error_code asn1_decode_encrypted_data(asn1buf *buf, krb5_enc_data *val) { setup(); { begin_structure(); @@ -319,9 +301,7 @@ asn1_error_code asn1_decode_encrypted_data(buf, val) cleanup(); } -asn1_error_code asn1_decode_krb5_flags(buf, val) - asn1buf * buf; - krb5_flags * val; +asn1_error_code asn1_decode_krb5_flags(asn1buf *buf, krb5_flags *val) { setup(); asn1_octet unused, o; @@ -329,9 +309,9 @@ asn1_error_code asn1_decode_krb5_flags(buf, val) krb5_flags f=0; unused_var(taglen); - retval = asn1_get_tag(buf,&class,&construction,&tagnum,&length); + retval = asn1_get_tag(buf,&asn1class,&construction,&tagnum,&length); if(retval) return retval; - if(class != UNIVERSAL || construction != PRIMITIVE || + if(asn1class != UNIVERSAL || construction != PRIMITIVE || tagnum != ASN1_BITSTRING) return ASN1_BAD_ID; retval = asn1buf_remove_octet(buf,&unused); /* # of padding bits */ @@ -359,24 +339,16 @@ asn1_error_code asn1_decode_krb5_flags(buf, val) return 0; } -asn1_error_code asn1_decode_ticket_flags(buf, val) - asn1buf * buf; - krb5_flags * val; +asn1_error_code asn1_decode_ticket_flags(asn1buf *buf, krb5_flags *val) { return asn1_decode_krb5_flags(buf,val); } -asn1_error_code asn1_decode_ap_options(buf, val) - asn1buf * buf; - krb5_flags * val; +asn1_error_code asn1_decode_ap_options(asn1buf *buf, krb5_flags *val) { return asn1_decode_krb5_flags(buf,val); } -asn1_error_code asn1_decode_kdc_options(buf, val) - asn1buf * buf; - krb5_flags * val; +asn1_error_code asn1_decode_kdc_options(asn1buf *buf, krb5_flags *val) { return asn1_decode_krb5_flags(buf,val); } -asn1_error_code asn1_decode_transited_encoding(buf, val) - asn1buf * buf; - krb5_transited * val; +asn1_error_code asn1_decode_transited_encoding(asn1buf *buf, krb5_transited *val) { setup(); { begin_structure(); @@ -388,9 +360,7 @@ asn1_error_code asn1_decode_transited_encoding(buf, val) cleanup(); } -asn1_error_code asn1_decode_enc_kdc_rep_part(buf, val) - asn1buf * buf; - krb5_enc_kdc_rep_part * val; +asn1_error_code asn1_decode_enc_kdc_rep_part(asn1buf *buf, krb5_enc_kdc_rep_part *val) { setup(); { begin_structure(); @@ -415,9 +385,7 @@ asn1_error_code asn1_decode_enc_kdc_rep_part(buf, val) cleanup(); } -asn1_error_code asn1_decode_ticket(buf, val) - asn1buf * buf; - krb5_ticket * val; +asn1_error_code asn1_decode_ticket(asn1buf *buf, krb5_ticket *val) { setup(); unsigned int applen; @@ -434,15 +402,13 @@ asn1_error_code asn1_decode_ticket(buf, val) val->magic = KV5M_TICKET; } if(!applen) { - retval = asn1_get_tag(buf,&class,&construction,&tagnum,NULL); + retval = asn1_get_tag(buf,&asn1class,&construction,&tagnum,NULL); if (retval) return retval; } cleanup(); } -asn1_error_code asn1_decode_kdc_req(buf, val) - asn1buf * buf; - krb5_kdc_req * val; +asn1_error_code asn1_decode_kdc_req(asn1buf *buf, krb5_kdc_req *val) { setup(); { begin_structure(); @@ -458,9 +424,7 @@ asn1_error_code asn1_decode_kdc_req(buf, val) cleanup(); } -asn1_error_code asn1_decode_kdc_req_body(buf, val) - asn1buf * buf; - krb5_kdc_req * val; +asn1_error_code asn1_decode_kdc_req_body(asn1buf *buf, krb5_kdc_req *val) { setup(); { begin_structure(); @@ -495,9 +459,7 @@ asn1_error_code asn1_decode_kdc_req_body(buf, val) cleanup(); } -asn1_error_code asn1_decode_krb_safe_body(buf, val) - asn1buf * buf; - krb5_safe * val; +asn1_error_code asn1_decode_krb_safe_body(asn1buf *buf, krb5_safe *val) { setup(); { begin_structure(); @@ -517,9 +479,7 @@ asn1_error_code asn1_decode_krb_safe_body(buf, val) cleanup(); } -asn1_error_code asn1_decode_host_address(buf, val) - asn1buf * buf; - krb5_address * val; +asn1_error_code asn1_decode_host_address(asn1buf *buf, krb5_address *val) { setup(); { begin_structure(); @@ -531,9 +491,7 @@ asn1_error_code asn1_decode_host_address(buf, val) cleanup(); } -asn1_error_code asn1_decode_kdc_rep(buf, val) - asn1buf * buf; - krb5_kdc_rep * val; +asn1_error_code asn1_decode_kdc_rep(asn1buf *buf, krb5_kdc_rep *val) { setup(); { begin_structure(); @@ -588,16 +546,12 @@ if(*(array) == NULL) return ENOMEM;\ cleanup() -asn1_error_code asn1_decode_authorization_data(buf, val) - asn1buf * buf; - krb5_authdata *** val; +asn1_error_code asn1_decode_authorization_data(asn1buf *buf, krb5_authdata ***val) { decode_array_body(krb5_authdata,asn1_decode_authdata_elt); } -asn1_error_code asn1_decode_authdata_elt(buf, val) - asn1buf * buf; - krb5_authdata * val; +asn1_error_code asn1_decode_authdata_elt(asn1buf *buf, krb5_authdata *val) { setup(); { begin_structure(); @@ -609,30 +563,22 @@ asn1_error_code asn1_decode_authdata_elt(buf, val) cleanup(); } -asn1_error_code asn1_decode_host_addresses(buf, val) - asn1buf * buf; - krb5_address *** val; +asn1_error_code asn1_decode_host_addresses(asn1buf *buf, krb5_address ***val) { decode_array_body(krb5_address,asn1_decode_host_address); } -asn1_error_code asn1_decode_sequence_of_ticket(buf, val) - asn1buf * buf; - krb5_ticket *** val; +asn1_error_code asn1_decode_sequence_of_ticket(asn1buf *buf, krb5_ticket ***val) { decode_array_body(krb5_ticket,asn1_decode_ticket); } -asn1_error_code asn1_decode_sequence_of_krb_cred_info(buf, val) - asn1buf * buf; - krb5_cred_info *** val; +asn1_error_code asn1_decode_sequence_of_krb_cred_info(asn1buf *buf, krb5_cred_info ***val) { decode_array_body(krb5_cred_info,asn1_decode_krb_cred_info); } -asn1_error_code asn1_decode_krb_cred_info(buf, val) - asn1buf * buf; - krb5_cred_info * val; +asn1_error_code asn1_decode_krb_cred_info(asn1buf *buf, krb5_cred_info *val) { setup(); { begin_structure(); @@ -658,16 +604,12 @@ asn1_error_code asn1_decode_krb_cred_info(buf, val) cleanup(); } -asn1_error_code asn1_decode_sequence_of_pa_data(buf, val) - asn1buf * buf; - krb5_pa_data *** val; +asn1_error_code asn1_decode_sequence_of_pa_data(asn1buf *buf, krb5_pa_data ***val) { decode_array_body(krb5_pa_data,asn1_decode_pa_data); } -asn1_error_code asn1_decode_pa_data(buf, val) - asn1buf * buf; - krb5_pa_data * val; +asn1_error_code asn1_decode_pa_data(asn1buf *buf, krb5_pa_data *val) { setup(); { begin_structure(); @@ -679,16 +621,12 @@ asn1_error_code asn1_decode_pa_data(buf, val) cleanup(); } -asn1_error_code asn1_decode_last_req(buf, val) - asn1buf * buf; - krb5_last_req_entry *** val; +asn1_error_code asn1_decode_last_req(asn1buf *buf, krb5_last_req_entry ***val) { decode_array_body(krb5_last_req_entry,asn1_decode_last_req_entry); } -asn1_error_code asn1_decode_last_req_entry(buf, val) - asn1buf * buf; - krb5_last_req_entry * val; +asn1_error_code asn1_decode_last_req_entry(asn1buf *buf, krb5_last_req_entry *val) { setup(); { begin_structure(); @@ -705,10 +643,7 @@ asn1_error_code asn1_decode_last_req_entry(buf, val) cleanup(); } -asn1_error_code asn1_decode_sequence_of_enctype(buf, num, val) - asn1buf * buf; - int * num; - krb5_enctype ** val; +asn1_error_code asn1_decode_sequence_of_enctype(asn1buf *buf, int *num, krb5_enctype **val) { asn1_error_code retval; { sequence_of(buf); @@ -728,9 +663,7 @@ asn1_error_code asn1_decode_sequence_of_enctype(buf, num, val) cleanup(); } -asn1_error_code asn1_decode_etype_info_entry(buf, val) - asn1buf * buf; - krb5_etype_info_entry * val; +asn1_error_code asn1_decode_etype_info_entry(asn1buf *buf, krb5_etype_info_entry *val) { setup(); { begin_structure(); @@ -747,16 +680,12 @@ asn1_error_code asn1_decode_etype_info_entry(buf, val) cleanup(); } -asn1_error_code asn1_decode_etype_info(buf, val) - asn1buf * buf; - krb5_etype_info_entry *** val; +asn1_error_code asn1_decode_etype_info(asn1buf *buf, krb5_etype_info_entry ***val) { decode_array_body(krb5_etype_info_entry,asn1_decode_etype_info_entry); } -asn1_error_code asn1_decode_passwdsequence(buf, val) - asn1buf * buf; - passwd_phrase_element * val; +asn1_error_code asn1_decode_passwdsequence(asn1buf *buf, passwd_phrase_element *val) { setup(); { begin_structure(); @@ -774,16 +703,12 @@ asn1_error_code asn1_decode_passwdsequence(buf, val) cleanup(); } -asn1_error_code asn1_decode_sequence_of_passwdsequence(buf, val) - asn1buf * buf; - passwd_phrase_element *** val; +asn1_error_code asn1_decode_sequence_of_passwdsequence(asn1buf *buf, passwd_phrase_element ***val) { decode_array_body(passwd_phrase_element,asn1_decode_passwdsequence); } -asn1_error_code asn1_decode_sam_flags(buf,val) - asn1buf * buf; - krb5_flags *val; +asn1_error_code asn1_decode_sam_flags(asn1buf *buf, krb5_flags *val) { return asn1_decode_krb5_flags(buf,val); } #define opt_string(val,n,fn) opt_lenfield((val).length,(val).data,n,fn) @@ -792,9 +717,7 @@ if(tagnum == (tagexpect)){\ get_field_body(var,decoder); }\ else var.length = 0 -asn1_error_code asn1_decode_sam_challenge(buf,val) - asn1buf * buf; - krb5_sam_challenge *val; +asn1_error_code asn1_decode_sam_challenge(asn1buf *buf, krb5_sam_challenge *val) { setup(); { begin_structure(); @@ -813,9 +736,7 @@ asn1_error_code asn1_decode_sam_challenge(buf,val) } cleanup(); } -asn1_error_code asn1_decode_enc_sam_key(buf, val) - asn1buf * buf; - krb5_sam_key * val; +asn1_error_code asn1_decode_enc_sam_key(asn1buf *buf, krb5_sam_key *val) { setup(); { begin_structure(); @@ -827,9 +748,7 @@ asn1_error_code asn1_decode_enc_sam_key(buf, val) cleanup(); } -asn1_error_code asn1_decode_enc_sam_response_enc(buf, val) - asn1buf * buf; - krb5_enc_sam_response_enc * val; +asn1_error_code asn1_decode_enc_sam_response_enc(asn1buf *buf, krb5_enc_sam_response_enc *val) { setup(); { begin_structure(); @@ -854,9 +773,7 @@ asn1_error_code asn1_decode_enc_sam_response_enc(buf, val) fld.ciphertext.length = 0;\ } -asn1_error_code asn1_decode_sam_response(buf, val) - asn1buf * buf; - krb5_sam_response * val; +asn1_error_code asn1_decode_sam_response(asn1buf *buf, krb5_sam_response *val) { setup(); { begin_structure(); @@ -874,9 +791,7 @@ asn1_error_code asn1_decode_sam_response(buf, val) } -asn1_error_code asn1_decode_predicted_sam_response(buf, val) - asn1buf * buf; - krb5_predicted_sam_response * val; +asn1_error_code asn1_decode_predicted_sam_response(asn1buf *buf, krb5_predicted_sam_response *val) { setup(); { begin_structure(); diff --git a/src/lib/krb5/asn.1/asn1_k_encode.c b/src/lib/krb5/asn.1/asn1_k_encode.c index fa3d5cd..2177b52 100644 --- a/src/lib/krb5/asn.1/asn1_k_encode.c +++ b/src/lib/krb5/asn.1/asn1_k_encode.c @@ -123,19 +123,13 @@ *retlen = sum;\ return 0 -asn1_error_code asn1_encode_ui_4(buf, val, retlen) - asn1buf * buf; - const krb5_ui_4 val; - unsigned int * retlen; +asn1_error_code asn1_encode_ui_4(asn1buf *buf, const krb5_ui_4 val, unsigned int *retlen) { return asn1_encode_unsigned_integer(buf,val,retlen); } -asn1_error_code asn1_encode_realm(buf, val, retlen) - asn1buf * buf; - const krb5_principal val; - unsigned int * retlen; +asn1_error_code asn1_encode_realm(asn1buf *buf, const krb5_principal val, unsigned int *retlen) { if (val == NULL || (val->realm.length && val->realm.data == NULL)) @@ -144,10 +138,7 @@ asn1_error_code asn1_encode_realm(buf, val, retlen) retlen); } -asn1_error_code asn1_encode_principal_name(buf, val, retlen) - asn1buf * buf; - const krb5_principal val; - unsigned int * retlen; +asn1_error_code asn1_encode_principal_name(asn1buf *buf, const krb5_principal val, unsigned int *retlen) { asn1_setup(); int n; @@ -177,19 +168,12 @@ asn1_error_code asn1_encode_principal_name(buf, val, retlen) asn1_cleanup(); } -asn1_error_code asn1_encode_kerberos_time(buf, val, retlen) - asn1buf * buf; - const krb5_timestamp val; - unsigned int * retlen; - +asn1_error_code asn1_encode_kerberos_time(asn1buf *buf, const krb5_timestamp val, unsigned int *retlen) { return asn1_encode_generaltime(buf,val,retlen); } -asn1_error_code asn1_encode_host_address(buf, val, retlen) - asn1buf * buf; - const krb5_address * val; - unsigned int * retlen; +asn1_error_code asn1_encode_host_address(asn1buf *buf, const krb5_address *val, unsigned int *retlen) { asn1_setup(); @@ -202,10 +186,7 @@ asn1_error_code asn1_encode_host_address(buf, val, retlen) asn1_cleanup(); } -asn1_error_code asn1_encode_host_addresses(buf, val, retlen) - asn1buf * buf; - const krb5_address ** val; - unsigned int * retlen; +asn1_error_code asn1_encode_host_addresses(asn1buf *buf, const krb5_address **val, unsigned int *retlen) { asn1_setup(); int i; @@ -223,10 +204,7 @@ asn1_error_code asn1_encode_host_addresses(buf, val, retlen) asn1_cleanup(); } -asn1_error_code asn1_encode_encrypted_data(buf, val, retlen) - asn1buf * buf; - const krb5_enc_data * val; - unsigned int * retlen; +asn1_error_code asn1_encode_encrypted_data(asn1buf *buf, const krb5_enc_data *val, unsigned int *retlen) { asn1_setup(); @@ -245,10 +223,7 @@ asn1_error_code asn1_encode_encrypted_data(buf, val, retlen) asn1_cleanup(); } -asn1_error_code asn1_encode_krb5_flags(buf, val, retlen) - asn1buf * buf; - const krb5_flags val; - unsigned int * retlen; +asn1_error_code asn1_encode_krb5_flags(asn1buf *buf, const krb5_flags val, unsigned int *retlen) { asn1_setup(); krb5_flags valcopy = val; @@ -272,34 +247,22 @@ asn1_error_code asn1_encode_krb5_flags(buf, val, retlen) return 0; } -asn1_error_code asn1_encode_ap_options(buf, val, retlen) - asn1buf * buf; - const krb5_flags val; - unsigned int * retlen; +asn1_error_code asn1_encode_ap_options(asn1buf *buf, const krb5_flags val, unsigned int *retlen) { return asn1_encode_krb5_flags(buf,val,retlen); } -asn1_error_code asn1_encode_ticket_flags(buf, val, retlen) - asn1buf * buf; - const krb5_flags val; - unsigned int * retlen; +asn1_error_code asn1_encode_ticket_flags(asn1buf *buf, const krb5_flags val, unsigned int *retlen) { return asn1_encode_krb5_flags(buf,val,retlen); } -asn1_error_code asn1_encode_kdc_options(buf, val, retlen) - asn1buf * buf; - const krb5_flags val; - unsigned int * retlen; +asn1_error_code asn1_encode_kdc_options(asn1buf *buf, const krb5_flags val, unsigned int *retlen) { return asn1_encode_krb5_flags(buf,val,retlen); } -asn1_error_code asn1_encode_authorization_data(buf, val, retlen) - asn1buf * buf; - const krb5_authdata ** val; - unsigned int * retlen; +asn1_error_code asn1_encode_authorization_data(asn1buf *buf, const krb5_authdata **val, unsigned int *retlen) { asn1_setup(); int i; @@ -317,10 +280,7 @@ asn1_error_code asn1_encode_authorization_data(buf, val, retlen) asn1_cleanup(); } -asn1_error_code asn1_encode_krb5_authdata_elt(buf, val, retlen) - asn1buf * buf; - const krb5_authdata * val; - unsigned int * retlen; +asn1_error_code asn1_encode_krb5_authdata_elt(asn1buf *buf, const krb5_authdata *val, unsigned int *retlen) { asn1_setup(); @@ -338,11 +298,7 @@ asn1_error_code asn1_encode_krb5_authdata_elt(buf, val, retlen) asn1_cleanup(); } -asn1_error_code asn1_encode_kdc_rep(msg_type, buf, val, retlen) - int msg_type; - asn1buf * buf; - const krb5_kdc_rep * val; - unsigned int * retlen; +asn1_error_code asn1_encode_kdc_rep(int msg_type, asn1buf *buf, const krb5_kdc_rep *val, unsigned int *retlen) { asn1_setup(); @@ -363,10 +319,7 @@ asn1_error_code asn1_encode_kdc_rep(msg_type, buf, val, retlen) asn1_cleanup(); } -asn1_error_code asn1_encode_enc_kdc_rep_part(buf, val, retlen) - asn1buf * buf; - const krb5_enc_kdc_rep_part * val; - unsigned int * retlen; +asn1_error_code asn1_encode_enc_kdc_rep_part(asn1buf *buf, const krb5_enc_kdc_rep_part *val, unsigned int *retlen) { asn1_setup(); @@ -418,10 +371,7 @@ asn1_error_code asn1_encode_enc_kdc_rep_part(buf, val, retlen) asn1_cleanup(); } -asn1_error_code asn1_encode_kdc_req_body(buf, rep, retlen) - asn1buf * buf; - const krb5_kdc_req * rep; - unsigned int * retlen; +asn1_error_code asn1_encode_kdc_req_body(asn1buf *buf, const krb5_kdc_req *rep, unsigned int *retlen) { asn1_setup(); @@ -487,10 +437,7 @@ asn1_error_code asn1_encode_kdc_req_body(buf, rep, retlen) asn1_cleanup(); } -asn1_error_code asn1_encode_encryption_key(buf, val, retlen) - asn1buf * buf; - const krb5_keyblock * val; - unsigned int * retlen; +asn1_error_code asn1_encode_encryption_key(asn1buf *buf, const krb5_keyblock *val, unsigned int *retlen) { asn1_setup(); @@ -505,10 +452,7 @@ asn1_error_code asn1_encode_encryption_key(buf, val, retlen) asn1_cleanup(); } -asn1_error_code asn1_encode_checksum(buf, val, retlen) - asn1buf * buf; - const krb5_checksum * val; - unsigned int * retlen; +asn1_error_code asn1_encode_checksum(asn1buf *buf, const krb5_checksum *val, unsigned int *retlen) { asn1_setup(); @@ -523,10 +467,7 @@ asn1_error_code asn1_encode_checksum(buf, val, retlen) asn1_cleanup(); } -asn1_error_code asn1_encode_transited_encoding(buf, val, retlen) - asn1buf * buf; - const krb5_transited * val; - unsigned int * retlen; +asn1_error_code asn1_encode_transited_encoding(asn1buf *buf, const krb5_transited *val, unsigned int *retlen) { asn1_setup(); @@ -542,10 +483,7 @@ asn1_error_code asn1_encode_transited_encoding(buf, val, retlen) asn1_cleanup(); } -asn1_error_code asn1_encode_last_req(buf, val, retlen) - asn1buf * buf; - const krb5_last_req_entry ** val; - unsigned int * retlen; +asn1_error_code asn1_encode_last_req(asn1buf *buf, const krb5_last_req_entry **val, unsigned int *retlen) { asn1_setup(); int i; @@ -563,10 +501,7 @@ asn1_error_code asn1_encode_last_req(buf, val, retlen) asn1_cleanup(); } -asn1_error_code asn1_encode_last_req_entry(buf, val, retlen) - asn1buf * buf; - const krb5_last_req_entry * val; - unsigned int * retlen; +asn1_error_code asn1_encode_last_req_entry(asn1buf *buf, const krb5_last_req_entry *val, unsigned int *retlen) { asn1_setup(); @@ -579,10 +514,7 @@ asn1_error_code asn1_encode_last_req_entry(buf, val, retlen) asn1_cleanup(); } -asn1_error_code asn1_encode_sequence_of_pa_data(buf, val, retlen) - asn1buf * buf; - const krb5_pa_data ** val; - unsigned int * retlen; +asn1_error_code asn1_encode_sequence_of_pa_data(asn1buf *buf, const krb5_pa_data **val, unsigned int *retlen) { asn1_setup(); int i; @@ -600,10 +532,7 @@ asn1_error_code asn1_encode_sequence_of_pa_data(buf, val, retlen) asn1_cleanup(); } -asn1_error_code asn1_encode_pa_data(buf, val, retlen) - asn1buf * buf; - const krb5_pa_data * val; - unsigned int * retlen; +asn1_error_code asn1_encode_pa_data(asn1buf *buf, const krb5_pa_data *val, unsigned int *retlen) { asn1_setup(); @@ -617,10 +546,7 @@ asn1_error_code asn1_encode_pa_data(buf, val, retlen) asn1_cleanup(); } -asn1_error_code asn1_encode_sequence_of_ticket(buf, val, retlen) - asn1buf * buf; - const krb5_ticket ** val; - unsigned int * retlen; +asn1_error_code asn1_encode_sequence_of_ticket(asn1buf *buf, const krb5_ticket **val, unsigned int *retlen) { asn1_setup(); int i; @@ -638,10 +564,7 @@ asn1_error_code asn1_encode_sequence_of_ticket(buf, val, retlen) asn1_cleanup(); } -asn1_error_code asn1_encode_ticket(buf, val, retlen) - asn1buf * buf; - const krb5_ticket * val; - unsigned int * retlen; +asn1_error_code asn1_encode_ticket(asn1buf *buf, const krb5_ticket *val, unsigned int *retlen) { asn1_setup(); @@ -657,11 +580,7 @@ asn1_error_code asn1_encode_ticket(buf, val, retlen) asn1_cleanup(); } -asn1_error_code asn1_encode_sequence_of_enctype(buf, len, val, retlen) - asn1buf * buf; - const int len; - const krb5_enctype * val; - unsigned int * retlen; +asn1_error_code asn1_encode_sequence_of_enctype(asn1buf *buf, const int len, const krb5_enctype *val, unsigned int *retlen) { asn1_setup(); int i; @@ -678,11 +597,7 @@ asn1_error_code asn1_encode_sequence_of_enctype(buf, len, val, retlen) asn1_cleanup(); } -asn1_error_code asn1_encode_kdc_req(msg_type, buf, val, retlen) - int msg_type; - asn1buf * buf; - const krb5_kdc_req * val; - unsigned int * retlen; +asn1_error_code asn1_encode_kdc_req(int msg_type, asn1buf *buf, const krb5_kdc_req *val, unsigned int *retlen) { asn1_setup(); @@ -700,10 +615,7 @@ asn1_error_code asn1_encode_kdc_req(msg_type, buf, val, retlen) asn1_cleanup(); } -asn1_error_code asn1_encode_krb_safe_body(buf, val, retlen) - asn1buf * buf; - const krb5_safe * val; - unsigned int * retlen; +asn1_error_code asn1_encode_krb_safe_body(asn1buf *buf, const krb5_safe *val, unsigned int *retlen) { asn1_setup(); @@ -727,10 +639,7 @@ asn1_error_code asn1_encode_krb_safe_body(buf, val, retlen) asn1_cleanup(); } -asn1_error_code asn1_encode_sequence_of_krb_cred_info(buf, val, retlen) - asn1buf * buf; - const krb5_cred_info ** val; - unsigned int * retlen; +asn1_error_code asn1_encode_sequence_of_krb_cred_info(asn1buf *buf, const krb5_cred_info **val, unsigned int *retlen) { asn1_setup(); int i; @@ -748,10 +657,7 @@ asn1_error_code asn1_encode_sequence_of_krb_cred_info(buf, val, retlen) asn1_cleanup(); } -asn1_error_code asn1_encode_krb_cred_info(buf, val, retlen) - asn1buf * buf; - const krb5_cred_info * val; - unsigned int * retlen; +asn1_error_code asn1_encode_krb_cred_info(asn1buf *buf, const krb5_cred_info *val, unsigned int *retlen) { asn1_setup(); @@ -784,10 +690,7 @@ asn1_error_code asn1_encode_krb_cred_info(buf, val, retlen) asn1_cleanup(); } -asn1_error_code asn1_encode_etype_info_entry(buf, val, retlen) - asn1buf * buf; - const krb5_etype_info_entry * val; - unsigned int * retlen; +asn1_error_code asn1_encode_etype_info_entry(asn1buf *buf, const krb5_etype_info_entry *val, unsigned int *retlen) { asn1_setup(); @@ -804,10 +707,7 @@ asn1_error_code asn1_encode_etype_info_entry(buf, val, retlen) asn1_cleanup(); } -asn1_error_code asn1_encode_etype_info(buf, val, retlen) - asn1buf * buf; - const krb5_etype_info_entry ** val; - unsigned int * retlen; +asn1_error_code asn1_encode_etype_info(asn1buf *buf, const krb5_etype_info_entry **val, unsigned int *retlen) { asn1_setup(); int i; @@ -824,10 +724,7 @@ asn1_error_code asn1_encode_etype_info(buf, val, retlen) asn1_cleanup(); } -asn1_error_code asn1_encode_sequence_of_passwdsequence(buf, val, retlen) - asn1buf * buf; - const passwd_phrase_element ** val; - unsigned int * retlen; +asn1_error_code asn1_encode_sequence_of_passwdsequence(asn1buf *buf, const passwd_phrase_element **val, unsigned int *retlen) { asn1_setup(); int i; @@ -844,10 +741,7 @@ asn1_error_code asn1_encode_sequence_of_passwdsequence(buf, val, retlen) asn1_cleanup(); } -asn1_error_code asn1_encode_passwdsequence(buf, val, retlen) - asn1buf * buf; - const passwd_phrase_element * val; - unsigned int * retlen; +asn1_error_code asn1_encode_passwdsequence(asn1buf *buf, const passwd_phrase_element *val, unsigned int *retlen) { asn1_setup(); asn1_addlenfield(val->phrase->length,val->phrase->data,1,asn1_encode_charstring); @@ -856,10 +750,7 @@ asn1_error_code asn1_encode_passwdsequence(buf, val, retlen) asn1_cleanup(); } -asn1_error_code asn1_encode_sam_flags(buf, val, retlen) - asn1buf * buf; - const krb5_flags val; - unsigned int * retlen; +asn1_error_code asn1_encode_sam_flags(asn1buf *buf, const krb5_flags val, unsigned int *retlen) { return asn1_encode_krb5_flags(buf,val,retlen); } @@ -867,10 +758,7 @@ asn1_error_code asn1_encode_sam_flags(buf, val, retlen) #define add_optstring(val,n,fn) \ if ((val).length >= 0) {asn1_addlenfield((val).length,(val).data,n,fn);} -asn1_error_code asn1_encode_sam_challenge(buf, val, retlen) - asn1buf * buf; - const krb5_sam_challenge * val; - unsigned int * retlen; +asn1_error_code asn1_encode_sam_challenge(asn1buf *buf, const krb5_sam_challenge *val, unsigned int *retlen) { asn1_setup(); /* possibly wrong */ @@ -894,10 +782,7 @@ asn1_error_code asn1_encode_sam_challenge(buf, val, retlen) asn1_cleanup(); } -asn1_error_code asn1_encode_sam_key(buf, val, retlen) - asn1buf * buf; - const krb5_sam_key * val; - unsigned int * retlen; +asn1_error_code asn1_encode_sam_key(asn1buf *buf, const krb5_sam_key *val, unsigned int *retlen) { asn1_setup(); asn1_addfield(&(val->sam_key),0,asn1_encode_encryption_key); @@ -908,10 +793,7 @@ asn1_error_code asn1_encode_sam_key(buf, val, retlen) } -asn1_error_code asn1_encode_enc_sam_response_enc(buf, val, retlen) - asn1buf * buf; - const krb5_enc_sam_response_enc * val; - unsigned int * retlen; +asn1_error_code asn1_encode_enc_sam_response_enc(asn1buf *buf, const krb5_enc_sam_response_enc *val, unsigned int *retlen) { asn1_setup(); add_optstring(val->sam_sad,3,asn1_encode_charstring); @@ -924,10 +806,7 @@ asn1_error_code asn1_encode_enc_sam_response_enc(buf, val, retlen) asn1_cleanup(); } -asn1_error_code asn1_encode_sam_response(buf, val, retlen) - asn1buf * buf; - const krb5_sam_response * val; - unsigned int * retlen; +asn1_error_code asn1_encode_sam_response(asn1buf *buf, const krb5_sam_response *val, unsigned int *retlen) { asn1_setup(); @@ -947,10 +826,7 @@ asn1_error_code asn1_encode_sam_response(buf, val, retlen) asn1_cleanup(); } -asn1_error_code asn1_encode_predicted_sam_response(buf, val, retlen) - asn1buf * buf; - const krb5_predicted_sam_response * val; - unsigned int * retlen; +asn1_error_code asn1_encode_predicted_sam_response(asn1buf *buf, const krb5_predicted_sam_response *val, unsigned int *retlen) { asn1_setup(); diff --git a/src/lib/krb5/asn.1/asn1_make.c b/src/lib/krb5/asn.1/asn1_make.c index 3b325aa..dddf2da 100644 --- a/src/lib/krb5/asn.1/asn1_make.c +++ b/src/lib/krb5/asn.1/asn1_make.c @@ -26,24 +26,18 @@ #include "asn1_make.h" -asn1_error_code asn1_make_etag(buf, class, tagnum, in_len, retlen) - asn1buf * buf; - const asn1_class class; - const asn1_tagnum tagnum; - const unsigned int in_len; - unsigned int * retlen; +asn1_error_code asn1_make_etag(asn1buf *buf, asn1_class asn1class, + asn1_tagnum tagnum, unsigned int in_len, + unsigned int *retlen) { - return asn1_make_tag(buf,class,CONSTRUCTED,tagnum,in_len,retlen); + return asn1_make_tag(buf,asn1class,CONSTRUCTED,tagnum,in_len,retlen); } -asn1_error_code asn1_make_tag(buf, class, construction, tagnum, in_len, retlen) - asn1buf * buf; - const asn1_class class; - const asn1_construction construction; - const asn1_tagnum tagnum; - const unsigned int in_len; - unsigned int * retlen; +asn1_error_code asn1_make_tag(asn1buf *buf, asn1_class asn1class, + asn1_construction construction, + asn1_tagnum tagnum, unsigned int in_len, + unsigned int *retlen) { asn1_error_code retval; unsigned int sumlen=0, length; @@ -53,7 +47,7 @@ asn1_error_code asn1_make_tag(buf, class, construction, tagnum, in_len, retlen) retval = asn1_make_length(buf,in_len, &length); if(retval) return retval; sumlen += length; - retval = asn1_make_id(buf,class,construction,tagnum,&length); + retval = asn1_make_id(buf,asn1class,construction,tagnum,&length); if(retval) return retval; sumlen += length; @@ -61,10 +55,7 @@ asn1_error_code asn1_make_tag(buf, class, construction, tagnum, in_len, retlen) return 0; } -asn1_error_code asn1_make_length(buf, in_len, retlen) - asn1buf * buf; - const unsigned int in_len; - unsigned int * retlen; +asn1_error_code asn1_make_length(asn1buf *buf, const unsigned int in_len, unsigned int *retlen) { asn1_error_code retval; @@ -90,18 +81,15 @@ asn1_error_code asn1_make_length(buf, in_len, retlen) return 0; } -asn1_error_code asn1_make_id(buf, class, construction, tagnum, retlen) - asn1buf * buf; - const asn1_class class; - const asn1_construction construction; - const asn1_tagnum tagnum; - unsigned int * retlen; +asn1_error_code asn1_make_id(asn1buf *buf, asn1_class asn1class, + asn1_construction construction, + asn1_tagnum tagnum, unsigned int *retlen) { asn1_error_code retval; if(tagnum < 31) { - retval = asn1buf_insert_octet(buf, (asn1_octet) (class | construction | - (asn1_octet)tagnum)); + retval = asn1buf_insert_octet(buf, (asn1_octet) (asn1class | construction | + (asn1_octet)tagnum)); if(retval) return retval; *retlen = 1; }else{ @@ -119,7 +107,7 @@ asn1_error_code asn1_make_id(buf, class, construction, tagnum, retlen) length++; } - retval = asn1buf_insert_octet(buf, (asn1_octet) (class | construction | 0x1F)); + retval = asn1buf_insert_octet(buf, (asn1_octet) (asn1class | construction | 0x1F)); if(retval) return retval; length++; *retlen = length; @@ -128,10 +116,7 @@ asn1_error_code asn1_make_id(buf, class, construction, tagnum, retlen) return 0; } -asn1_error_code asn1_make_sequence(buf, seq_len, retlen) - asn1buf * buf; - const unsigned int seq_len; - unsigned int * retlen; +asn1_error_code asn1_make_sequence(asn1buf *buf, const unsigned int seq_len, unsigned int *retlen) { asn1_error_code retval; unsigned int len, sum=0; @@ -147,10 +132,7 @@ asn1_error_code asn1_make_sequence(buf, seq_len, retlen) return 0; } -asn1_error_code asn1_make_set(buf, set_len, retlen) - asn1buf * buf; - const unsigned int set_len; - unsigned int * retlen; +asn1_error_code asn1_make_set(asn1buf *buf, const unsigned int set_len, unsigned int *retlen) { asn1_error_code retval; unsigned int len, sum=0; @@ -166,11 +148,7 @@ asn1_error_code asn1_make_set(buf, set_len, retlen) return 0; } -asn1_error_code asn1_make_string(buf, length, string, retlen) - asn1buf * buf; - const unsigned int length; - const char * string; - int * retlen; +asn1_error_code asn1_make_string(asn1buf *buf, const unsigned int length, const char *string, int *retlen) { asn1_error_code retval; diff --git a/src/lib/krb5/asn.1/asn1_make.h b/src/lib/krb5/asn.1/asn1_make.h index 3fe2fca..7150549 100644 --- a/src/lib/krb5/asn.1/asn1_make.h +++ b/src/lib/krb5/asn.1/asn1_make.h @@ -48,20 +48,20 @@ asn1_error_code asn1_make_etag (asn1buf *buf, - const asn1_class class, + const asn1_class asn1class, const asn1_tagnum tagnum, const unsigned int in_len, unsigned int *retlen); /* requires *buf is allocated, in_len is the length of an ASN.1 encoding which has just been inserted in *buf modifies *buf, *retlen - effects Inserts an explicit tag with class = class, id# = tag + effects Inserts an explicit tag with class = asn1class, id# = tag length = in_len into *buf. Returns the length of this encoding in *retlen. Returns ENOMEM if memory runs out. */ asn1_error_code asn1_make_tag - (asn1buf *buf, const asn1_class class, + (asn1buf *buf, const asn1_class asn1class, const asn1_construction construction, const asn1_tagnum tagnum, const unsigned int in_len, @@ -69,7 +69,7 @@ asn1_error_code asn1_make_tag /* requires *buf is allocated, in_len is the length of an ASN.1 encoding which has just been inserted in *buf modifies *buf, *retlen - effects Inserts the encoding of a tag with class = class, + effects Inserts the encoding of a tag with class = asn1class, primitive/constructed staus = construction, id# = tag and length = in_len into *buf. Returns the length of this encoding in *retlen. @@ -121,14 +121,14 @@ asn1_error_code asn1_make_length /* "helper" procedure for asn1_make_tag */ asn1_error_code asn1_make_id (asn1buf *buf, - const asn1_class class, + const asn1_class asn1class, const asn1_construction construction, const asn1_tagnum tagnum, unsigned int *retlen); -/* requires *buf is allocated, class and tagnum are appropriate for +/* requires *buf is allocated, asn1class and tagnum are appropriate for the ASN.1 encoding which has just been inserted in *buf modifies *buf, *retlen - effects Inserts id octet(s) of class class and tag number tagnum + effects Inserts id octet(s) of class asn1class and tag number tagnum into *buf */ #endif diff --git a/src/lib/krb5/asn.1/asn1_misc.c b/src/lib/krb5/asn.1/asn1_misc.c index a03f16c..62412ae 100644 --- a/src/lib/krb5/asn.1/asn1_misc.c +++ b/src/lib/krb5/asn.1/asn1_misc.c @@ -26,9 +26,7 @@ #include "asn1_misc.h" -asn1_error_code asn1_krb5_realm_copy(target, source) - krb5_principal target; - krb5_principal source; +asn1_error_code asn1_krb5_realm_copy(krb5_principal target, krb5_principal source) { target->realm.length = source->realm.length; target->realm.data = (char*)malloc(target->realm.length); /* copy realm */ diff --git a/src/lib/krb5/asn.1/asn1buf.c b/src/lib/krb5/asn.1/asn1buf.c index 7b56c9e..d28e310 100644 --- a/src/lib/krb5/asn.1/asn1buf.c +++ b/src/lib/krb5/asn.1/asn1buf.c @@ -58,8 +58,7 @@ #define asn1_is_eoc(class, num, indef) \ ((class) == UNIVERSAL && !(num) && !(indef)) -asn1_error_code asn1buf_create(buf) - asn1buf ** buf; +asn1_error_code asn1buf_create(asn1buf **buf) { *buf = (asn1buf*)malloc(sizeof(asn1buf)); if (*buf == NULL) return ENOMEM; @@ -69,9 +68,7 @@ asn1_error_code asn1buf_create(buf) return 0; } -asn1_error_code asn1buf_wrap_data(buf, code) - asn1buf * buf; - const krb5_data * code; +asn1_error_code asn1buf_wrap_data(asn1buf *buf, const krb5_data *code) { if(code == NULL || code->data == NULL) return ASN1_MISSING_FIELD; buf->next = buf->base = code->data; @@ -79,11 +76,7 @@ asn1_error_code asn1buf_wrap_data(buf, code) return 0; } -asn1_error_code asn1buf_imbed(subbuf, buf, length, indef) - asn1buf * subbuf; - const asn1buf * buf; - const unsigned int length; - const int indef; +asn1_error_code asn1buf_imbed(asn1buf *subbuf, const asn1buf *buf, const unsigned int length, const int indef) { subbuf->base = subbuf->next = buf->next; if (!indef) { @@ -95,21 +88,16 @@ asn1_error_code asn1buf_imbed(subbuf, buf, length, indef) return 0; } -asn1_error_code asn1buf_sync(buf, subbuf, class, lasttag, length, indef, seqindef) - asn1buf * buf; - asn1buf * subbuf; - const asn1_class class; - const asn1_tagnum lasttag; - const unsigned int length; - const int indef; - const int seqindef; +asn1_error_code asn1buf_sync(asn1buf *buf, asn1buf *subbuf, + asn1_class asn1class, asn1_tagnum lasttag, + unsigned int length, int indef, int seqindef) { asn1_error_code retval; if (!seqindef) { /* sequence was encoded as definite length */ buf->next = subbuf->bound + 1; - } else if (!asn1_is_eoc(class, lasttag, indef)) { + } else if (!asn1_is_eoc(asn1class, lasttag, indef)) { retval = asn1buf_skiptail(subbuf, length, indef); if (retval) return retval; @@ -120,13 +108,10 @@ asn1_error_code asn1buf_sync(buf, subbuf, class, lasttag, length, indef, seqinde return 0; } -asn1_error_code asn1buf_skiptail(buf, length, indef) - asn1buf *buf; - const unsigned int length; - const int indef; +asn1_error_code asn1buf_skiptail(asn1buf *buf, const unsigned int length, const int indef) { asn1_error_code retval; - asn1_class class; + asn1_class asn1class; asn1_construction construction; asn1_tagnum tagnum; unsigned int taglen; @@ -141,7 +126,7 @@ asn1_error_code asn1buf_skiptail(buf, length, indef) return ASN1_OVERRUN; } while (nestlevel > 0) { - retval = asn1_get_tag_indef(buf, &class, &construction, &tagnum, + retval = asn1_get_tag_indef(buf, &asn1class, &construction, &tagnum, &taglen, &tagindef); if (retval) return retval; if (!tagindef) { @@ -152,14 +137,13 @@ asn1_error_code asn1buf_skiptail(buf, length, indef) } if (tagindef) nestlevel++; - if (asn1_is_eoc(class, tagnum, tagindef)) + if (asn1_is_eoc(asn1class, tagnum, tagindef)) nestlevel--; /* got an EOC encoding */ } return 0; } -asn1_error_code asn1buf_destroy(buf) - asn1buf ** buf; +asn1_error_code asn1buf_destroy(asn1buf **buf) { if (*buf != NULL) { if ((*buf)->base != NULL) free((*buf)->base); @@ -172,9 +156,7 @@ asn1_error_code asn1buf_destroy(buf) #ifdef asn1buf_insert_octet #undef asn1buf_insert_octet #endif -asn1_error_code asn1buf_insert_octet(buf, o) - asn1buf * buf; - const int o; +asn1_error_code asn1buf_insert_octet(asn1buf *buf, const int o) { asn1_error_code retval; @@ -185,10 +167,7 @@ asn1_error_code asn1buf_insert_octet(buf, o) return 0; } -asn1_error_code asn1buf_insert_octetstring(buf, len, s) - asn1buf * buf; - const unsigned int len; - const krb5_octet * s; +asn1_error_code asn1buf_insert_octetstring(asn1buf *buf, const unsigned int len, const krb5_octet *s) { asn1_error_code retval; int length; @@ -200,10 +179,7 @@ asn1_error_code asn1buf_insert_octetstring(buf, len, s) return 0; } -asn1_error_code asn1buf_insert_charstring(buf, len, s) - asn1buf * buf; - const unsigned int len; - const char * s; +asn1_error_code asn1buf_insert_charstring(asn1buf *buf, const unsigned int len, const char *s) { asn1_error_code retval; int length; @@ -216,19 +192,14 @@ asn1_error_code asn1buf_insert_charstring(buf, len, s) } #undef asn1buf_remove_octet -asn1_error_code asn1buf_remove_octet(buf, o) - asn1buf * buf; - asn1_octet * o; +asn1_error_code asn1buf_remove_octet(asn1buf *buf, asn1_octet *o) { if(buf->next > buf->bound) return ASN1_OVERRUN; *o = (asn1_octet)(*((buf->next)++)); return 0; } -asn1_error_code asn1buf_remove_octetstring(buf, len, s) - asn1buf * buf; - const unsigned int len; - asn1_octet ** s; +asn1_error_code asn1buf_remove_octetstring(asn1buf *buf, const unsigned int len, asn1_octet **s) { int i; @@ -246,10 +217,7 @@ asn1_error_code asn1buf_remove_octetstring(buf, len, s) return 0; } -asn1_error_code asn1buf_remove_charstring(buf, len, s) - asn1buf * buf; - const unsigned int len; - char ** s; +asn1_error_code asn1buf_remove_charstring(asn1buf *buf, const unsigned int len, char **s) { int i; @@ -266,9 +234,7 @@ asn1_error_code asn1buf_remove_charstring(buf, len, s) return 0; } -int asn1buf_remains(buf, indef) - asn1buf *buf; - int indef; +int asn1buf_remains(asn1buf *buf, int indef) { int remain; if(buf == NULL || buf->base == NULL) return 0; @@ -282,9 +248,7 @@ int asn1buf_remains(buf, indef) else return remain; } -asn1_error_code asn12krb5_buf(buf, code) - const asn1buf * buf; - krb5_data ** code; +asn1_error_code asn12krb5_buf(const asn1buf *buf, krb5_data **code) { int i; *code = (krb5_data*)calloc(1,sizeof(krb5_data)); @@ -309,9 +273,7 @@ asn1_error_code asn12krb5_buf(buf, code) /* These parse and unparse procedures should be moved out. They're useful only for debugging and superfluous in the production version. */ -asn1_error_code asn1buf_unparse(buf, s) - const asn1buf * buf; - char ** s; +asn1_error_code asn1buf_unparse(const asn1buf *buf, char **s) { if(*s != NULL) free(*s); if(buf == NULL){ @@ -335,9 +297,7 @@ asn1_error_code asn1buf_unparse(buf, s) return 0; } -asn1_error_code asn1buf_hex_unparse(buf, s) - const asn1buf * buf; - char ** s; +asn1_error_code asn1buf_hex_unparse(const asn1buf *buf, char **s) { #define hexchar(d) ((d)<=9 ? ('0'+(d)) :\ ((d)<=15 ? ('A'+(d)-10) :\ @@ -373,25 +333,21 @@ asn1_error_code asn1buf_hex_unparse(buf, s) /* Private Procedures */ #undef asn1buf_size -int asn1buf_size(buf) - const asn1buf * buf; +int asn1buf_size(const asn1buf *buf) { if(buf == NULL || buf->base == NULL) return 0; return buf->bound - buf->base + 1; } #undef asn1buf_free -int asn1buf_free(buf) - const asn1buf * buf; +int asn1buf_free(const asn1buf *buf) { if(buf == NULL || buf->base == NULL) return 0; else return buf->bound - buf->next + 1; } #undef asn1buf_ensure_space -asn1_error_code asn1buf_ensure_space(buf, amount) - asn1buf * buf; - const unsigned int amount; +asn1_error_code asn1buf_ensure_space(asn1buf *buf, const unsigned int amount) { int avail = asn1buf_free(buf); if(avail < amount){ @@ -401,9 +357,7 @@ asn1_error_code asn1buf_ensure_space(buf, amount) return 0; } -asn1_error_code asn1buf_expand(buf, inc) - asn1buf * buf; - unsigned int inc; +asn1_error_code asn1buf_expand(asn1buf *buf, unsigned int inc) { #define STANDARD_INCREMENT 200 int next_offset = buf->next - buf->base; @@ -426,8 +380,7 @@ asn1_error_code asn1buf_expand(buf, inc) } #undef asn1buf_len -int asn1buf_len(buf) - const asn1buf * buf; +int asn1buf_len(const asn1buf *buf) { return buf->next - buf->base; } diff --git a/src/lib/krb5/asn.1/asn1buf.h b/src/lib/krb5/asn.1/asn1buf.h index f0f8ad2..854801e 100644 --- a/src/lib/krb5/asn.1/asn1buf.h +++ b/src/lib/krb5/asn.1/asn1buf.h @@ -122,7 +122,7 @@ asn1_error_code asn1buf_imbed position starts at the beginning of *subbuf. */ asn1_error_code asn1buf_sync - (asn1buf *buf, asn1buf *subbuf, const asn1_class class, + (asn1buf *buf, asn1buf *subbuf, const asn1_class Class, const asn1_tagnum lasttag, const unsigned int length, const int indef, const int seqindef); @@ -147,9 +147,7 @@ asn1_error_code asn1buf_insert_octet effects Inserts o into the buffer *buf, expanding the buffer if necessary. Returns ENOMEM memory is exhausted. */ #if ((__GNUC__ >= 2) && !defined(ASN1BUF_OMIT_INLINE_FUNCS)) -extern __inline__ asn1_error_code asn1buf_insert_octet(buf, o) - asn1buf * buf; - const int o; +extern __inline__ asn1_error_code asn1buf_insert_octet(asn1buf *buf, const int o) { asn1_error_code retval; diff --git a/src/lib/krb5/asn.1/krb5_decode.c b/src/lib/krb5/asn.1/krb5_decode.c index 42b09a7..2073e25 100644 --- a/src/lib/krb5/asn.1/krb5_decode.c +++ b/src/lib/krb5/asn.1/krb5_decode.c @@ -42,7 +42,7 @@ retval = asn1buf_wrap_data(&buf,code);\ if(retval) return retval #define setup_no_tagnum()\ -asn1_class class;\ +asn1_class asn1class;\ asn1_construction construction;\ setup_buf_only() @@ -65,9 +65,9 @@ if((var) == NULL) clean_return(ENOMEM) /* process encoding header ***************************************/ /* decode tag and check that it == [APPLICATION tagnum] */ #define check_apptag(tagexpect)\ -retval = asn1_get_tag(&buf,&class,&construction,&tagnum,NULL);\ +retval = asn1_get_tag(&buf,&asn1class,&construction,&tagnum,NULL);\ if(retval) clean_return(retval);\ -if(class != APPLICATION || construction != CONSTRUCTED) \ +if(asn1class != APPLICATION || construction != CONSTRUCTED) \ clean_return(ASN1_BAD_ID);\ if(tagnum != (tagexpect)) clean_return(KRB5_BADMSGTYPE) @@ -77,14 +77,14 @@ if(tagnum != (tagexpect)) clean_return(KRB5_BADMSGTYPE) /* decode an explicit tag and place the number in tagnum */ #define next_tag()\ -retval = asn1_get_tag_indef(&subbuf,&class,&construction,&tagnum,NULL,&indef);\ +retval = asn1_get_tag_indef(&subbuf,&asn1class,&construction,&tagnum,NULL,&indef);\ if(retval) clean_return(retval) #define get_eoc() \ -retval = asn1_get_tag_indef(&subbuf,&class,&construction, \ +retval = asn1_get_tag_indef(&subbuf,&asn1class,&construction, \ &tagnum,NULL,&indef); \ if(retval) return retval; \ -if(class != UNIVERSAL || tagnum || indef) \ +if(asn1class != UNIVERSAL || tagnum || indef) \ return ASN1_MISSING_EOC /* decode sequence header and initialize tagnum with the first field */ @@ -99,7 +99,7 @@ if(retval) clean_return(retval);\ next_tag() #define end_structure()\ -retval = asn1buf_sync(&buf,&subbuf,class,tagnum,length,indef,seqindef);\ +retval = asn1buf_sync(&buf,&subbuf,asn1class,tagnum,length,indef,seqindef);\ if (retval) clean_return(retval) /* process fields *******************************************/ @@ -117,13 +117,13 @@ next_tag() #define get_field(var,tagexpect,decoder)\ if(tagnum > (tagexpect)) clean_return(ASN1_MISSING_FIELD);\ if(tagnum < (tagexpect)) clean_return(ASN1_MISPLACED_FIELD);\ -if(class != CONTEXT_SPECIFIC || construction != CONSTRUCTED)\ +if(asn1class != CONTEXT_SPECIFIC || construction != CONSTRUCTED)\ clean_return(ASN1_BAD_ID);\ get_field_body(var,decoder) /* decode (or skip, if not present) an optional field */ #define opt_field(var,tagexpect,decoder)\ -if(class != CONTEXT_SPECIFIC || construction != CONSTRUCTED)\ +if(asn1class != CONTEXT_SPECIFIC || construction != CONSTRUCTED)\ clean_return(ASN1_BAD_ID);\ if(tagnum == (tagexpect)){ get_field_body(var,decoder); } @@ -138,13 +138,13 @@ next_tag() #define get_lenfield(len,var,tagexpect,decoder)\ if(tagnum > (tagexpect)) clean_return(ASN1_MISSING_FIELD);\ if(tagnum < (tagexpect)) clean_return(ASN1_MISPLACED_FIELD);\ -if(class != CONTEXT_SPECIFIC || construction != CONSTRUCTED)\ +if(asn1class != CONTEXT_SPECIFIC || construction != CONSTRUCTED)\ clean_return(ASN1_BAD_ID);\ get_lenfield_body(len,var,decoder) /* decode an optional field w/ length */ #define opt_lenfield(len,var,tagexpect,decoder)\ -if(class != CONTEXT_SPECIFIC || construction != CONSTRUCTED)\ +if(asn1class != CONTEXT_SPECIFIC || construction != CONSTRUCTED)\ clean_return(ASN1_BAD_ID);\ if(tagnum == (tagexpect)){\ get_lenfield_body(len,var,decoder);\ @@ -172,9 +172,7 @@ error_out: \ #define free_field(rep,f) if ((rep)->f) free((rep)->f) #define clear_field(rep,f) (*(rep))->f = 0 -krb5_error_code decode_krb5_authenticator(code, rep) - const krb5_data * code; - krb5_authenticator ** rep; +krb5_error_code decode_krb5_authenticator(const krb5_data *code, krb5_authenticator **rep) { setup(); alloc_field(*rep,krb5_authenticator); @@ -215,16 +213,12 @@ error_out: krb5_error_code KRB5_CALLCONV -krb5_decode_ticket(code, rep) - const krb5_data * code; - krb5_ticket ** rep; +krb5_decode_ticket(const krb5_data *code, krb5_ticket **rep) { return decode_krb5_ticket(code, rep); } -krb5_error_code decode_krb5_ticket(code, rep) - const krb5_data * code; - krb5_ticket ** rep; +krb5_error_code decode_krb5_ticket(const krb5_data *code, krb5_ticket **rep) { setup(); alloc_field(*rep,krb5_ticket); @@ -252,9 +246,7 @@ error_out: return retval; } -krb5_error_code decode_krb5_encryption_key(code, rep) - const krb5_data * code; - krb5_keyblock ** rep; +krb5_error_code decode_krb5_encryption_key(const krb5_data *code, krb5_keyblock **rep) { setup(); alloc_field(*rep,krb5_keyblock); @@ -268,9 +260,7 @@ krb5_error_code decode_krb5_encryption_key(code, rep) cleanup(free); } -krb5_error_code decode_krb5_enc_tkt_part(code, rep) - const krb5_data * code; - krb5_enc_tkt_part ** rep; +krb5_error_code decode_krb5_enc_tkt_part(const krb5_data *code, krb5_enc_tkt_part **rep) { setup(); alloc_field(*rep,krb5_enc_tkt_part); @@ -308,16 +298,14 @@ error_out: return retval; } -krb5_error_code decode_krb5_enc_kdc_rep_part(code, rep) - const krb5_data * code; - krb5_enc_kdc_rep_part ** rep; +krb5_error_code decode_krb5_enc_kdc_rep_part(const krb5_data *code, krb5_enc_kdc_rep_part **rep) { setup_no_length(); alloc_field(*rep,krb5_enc_kdc_rep_part); - retval = asn1_get_tag(&buf,&class,&construction,&tagnum,NULL); + retval = asn1_get_tag(&buf,&asn1class,&construction,&tagnum,NULL); if(retval) clean_return(retval); - if(class != APPLICATION || construction != CONSTRUCTED) clean_return(ASN1_BAD_ID); + if(asn1class != APPLICATION || construction != CONSTRUCTED) clean_return(ASN1_BAD_ID); if(tagnum == 25) (*rep)->msg_type = KRB5_AS_REP; else if(tagnum == 26) (*rep)->msg_type = KRB5_TGS_REP; else clean_return(KRB5_BADMSGTYPE); @@ -328,9 +316,7 @@ krb5_error_code decode_krb5_enc_kdc_rep_part(code, rep) cleanup(free); } -krb5_error_code decode_krb5_as_rep(code, rep) - const krb5_data * code; - krb5_kdc_rep ** rep; +krb5_error_code decode_krb5_as_rep(const krb5_data *code, krb5_kdc_rep **rep) { setup_no_length(); alloc_field(*rep,krb5_kdc_rep); @@ -346,9 +332,7 @@ krb5_error_code decode_krb5_as_rep(code, rep) cleanup(free); } -krb5_error_code decode_krb5_tgs_rep(code, rep) - const krb5_data * code; - krb5_kdc_rep ** rep; +krb5_error_code decode_krb5_tgs_rep(const krb5_data *code, krb5_kdc_rep **rep) { setup_no_length(); alloc_field(*rep,krb5_kdc_rep); @@ -363,9 +347,7 @@ krb5_error_code decode_krb5_tgs_rep(code, rep) cleanup(free); } -krb5_error_code decode_krb5_ap_req(code, rep) - const krb5_data * code; - krb5_ap_req ** rep; +krb5_error_code decode_krb5_ap_req(const krb5_data *code, krb5_ap_req **rep) { setup(); alloc_field(*rep,krb5_ap_req); @@ -398,9 +380,7 @@ error_out: return retval; } -krb5_error_code decode_krb5_ap_rep(code, rep) - const krb5_data * code; - krb5_ap_rep ** rep; +krb5_error_code decode_krb5_ap_rep(const krb5_data *code, krb5_ap_rep **rep) { setup(); alloc_field(*rep,krb5_ap_rep); @@ -423,9 +403,7 @@ krb5_error_code decode_krb5_ap_rep(code, rep) cleanup(free); } -krb5_error_code decode_krb5_ap_rep_enc_part(code, rep) - const krb5_data * code; - krb5_ap_rep_enc_part ** rep; +krb5_error_code decode_krb5_ap_rep_enc_part(const krb5_data *code, krb5_ap_rep_enc_part **rep) { setup(); alloc_field(*rep,krb5_ap_rep_enc_part); @@ -450,9 +428,7 @@ error_out: return retval; } -krb5_error_code decode_krb5_as_req(code, rep) - const krb5_data * code; - krb5_kdc_req ** rep; +krb5_error_code decode_krb5_as_req(const krb5_data *code, krb5_kdc_req **rep) { setup_no_length(); alloc_field(*rep,krb5_kdc_req); @@ -467,9 +443,7 @@ krb5_error_code decode_krb5_as_req(code, rep) cleanup(free); } -krb5_error_code decode_krb5_tgs_req(code, rep) - const krb5_data * code; - krb5_kdc_req ** rep; +krb5_error_code decode_krb5_tgs_req(const krb5_data *code, krb5_kdc_req **rep) { setup_no_length(); alloc_field(*rep,krb5_kdc_req); @@ -484,9 +458,7 @@ krb5_error_code decode_krb5_tgs_req(code, rep) cleanup(free); } -krb5_error_code decode_krb5_kdc_req_body(code, rep) - const krb5_data * code; - krb5_kdc_req ** rep; +krb5_error_code decode_krb5_kdc_req_body(const krb5_data *code, krb5_kdc_req **rep) { setup_buf_only(); alloc_field(*rep,krb5_kdc_req); @@ -497,9 +469,7 @@ krb5_error_code decode_krb5_kdc_req_body(code, rep) cleanup(free); } -krb5_error_code decode_krb5_safe(code, rep) - const krb5_data * code; - krb5_safe ** rep; +krb5_error_code decode_krb5_safe(const krb5_data *code, krb5_safe **rep) { setup(); alloc_field(*rep,krb5_safe); @@ -531,9 +501,7 @@ error_out: return retval; } -krb5_error_code decode_krb5_priv(code, rep) - const krb5_data * code; - krb5_priv ** rep; +krb5_error_code decode_krb5_priv(const krb5_data *code, krb5_priv **rep) { setup(); alloc_field(*rep,krb5_priv); @@ -556,9 +524,7 @@ krb5_error_code decode_krb5_priv(code, rep) cleanup(free); } -krb5_error_code decode_krb5_enc_priv_part(code, rep) - const krb5_data * code; - krb5_priv_enc_part ** rep; +krb5_error_code decode_krb5_enc_priv_part(const krb5_data *code, krb5_priv_enc_part **rep) { setup(); alloc_field(*rep,krb5_priv_enc_part); @@ -588,9 +554,7 @@ error_out: return retval; } -krb5_error_code decode_krb5_cred(code, rep) - const krb5_data * code; - krb5_cred ** rep; +krb5_error_code decode_krb5_cred(const krb5_data *code, krb5_cred **rep) { setup(); alloc_field(*rep,krb5_cred); @@ -614,9 +578,7 @@ krb5_error_code decode_krb5_cred(code, rep) cleanup(free); } -krb5_error_code decode_krb5_enc_cred_part(code, rep) - const krb5_data * code; - krb5_cred_enc_part ** rep; +krb5_error_code decode_krb5_enc_cred_part(const krb5_data *code, krb5_cred_enc_part **rep) { setup(); alloc_field(*rep,krb5_cred_enc_part); @@ -647,9 +609,7 @@ error_out: } -krb5_error_code decode_krb5_error(code, rep) - const krb5_data * code; - krb5_error ** rep; +krb5_error_code decode_krb5_error(const krb5_data *code, krb5_error **rep) { setup(); alloc_field(*rep,krb5_error); @@ -693,9 +653,7 @@ error_out: return retval; } -krb5_error_code decode_krb5_authdata(code, rep) - const krb5_data * code; - krb5_authdata *** rep; +krb5_error_code decode_krb5_authdata(const krb5_data *code, krb5_authdata ***rep) { setup_buf_only(); *rep = 0; @@ -704,9 +662,7 @@ krb5_error_code decode_krb5_authdata(code, rep) cleanup_none(); /* we're not allocating anything here... */ } -krb5_error_code decode_krb5_pwd_sequence(code, rep) - const krb5_data * code; - passwd_phrase_element ** rep; +krb5_error_code decode_krb5_pwd_sequence(const krb5_data *code, passwd_phrase_element **rep) { setup_buf_only(); alloc_field(*rep,passwd_phrase_element); @@ -715,9 +671,7 @@ krb5_error_code decode_krb5_pwd_sequence(code, rep) cleanup(free); } -krb5_error_code decode_krb5_pwd_data(code, rep) - const krb5_data * code; - krb5_pwd_data ** rep; +krb5_error_code decode_krb5_pwd_data(const krb5_data *code, krb5_pwd_data **rep) { setup(); alloc_field(*rep,krb5_pwd_data); @@ -729,9 +683,7 @@ krb5_error_code decode_krb5_pwd_data(code, rep) cleanup(free); } -krb5_error_code decode_krb5_padata_sequence(code, rep) - const krb5_data * code; - krb5_pa_data ***rep; +krb5_error_code decode_krb5_padata_sequence(const krb5_data *code, krb5_pa_data ***rep) { setup_buf_only(); *rep = 0; @@ -740,9 +692,7 @@ krb5_error_code decode_krb5_padata_sequence(code, rep) cleanup_none(); /* we're not allocating anything here */ } -krb5_error_code decode_krb5_alt_method(code, rep) - const krb5_data * code; - krb5_alt_method ** rep; +krb5_error_code decode_krb5_alt_method(const krb5_data *code, krb5_alt_method **rep) { setup(); alloc_field(*rep,krb5_alt_method); @@ -760,9 +710,7 @@ krb5_error_code decode_krb5_alt_method(code, rep) cleanup(free); } -krb5_error_code decode_krb5_etype_info(code, rep) - const krb5_data * code; - krb5_etype_info_entry ***rep; +krb5_error_code decode_krb5_etype_info(const krb5_data *code, krb5_etype_info_entry ***rep) { setup_buf_only(); *rep = 0; @@ -771,9 +719,7 @@ krb5_error_code decode_krb5_etype_info(code, rep) cleanup_none(); /* we're not allocating anything here */ } -krb5_error_code decode_krb5_enc_data(code, rep) - const krb5_data * code; - krb5_enc_data ** rep; +krb5_error_code decode_krb5_enc_data(const krb5_data *code, krb5_enc_data **rep) { setup_buf_only(); alloc_field(*rep,krb5_enc_data); @@ -784,9 +730,7 @@ krb5_error_code decode_krb5_enc_data(code, rep) cleanup(free); } -krb5_error_code decode_krb5_pa_enc_ts(code, rep) - const krb5_data * code; - krb5_pa_enc_ts ** rep; +krb5_error_code decode_krb5_pa_enc_ts(const krb5_data *code, krb5_pa_enc_ts **rep) { setup(); alloc_field(*rep,krb5_pa_enc_ts); @@ -800,9 +744,7 @@ krb5_error_code decode_krb5_pa_enc_ts(code, rep) cleanup(free); } -krb5_error_code decode_krb5_sam_challenge(code, rep) - const krb5_data * code; - krb5_sam_challenge **rep; +krb5_error_code decode_krb5_sam_challenge(const krb5_data *code, krb5_sam_challenge **rep) { setup_buf_only(); alloc_field(*rep,krb5_sam_challenge); @@ -813,9 +755,7 @@ krb5_error_code decode_krb5_sam_challenge(code, rep) cleanup(free); } -krb5_error_code decode_krb5_enc_sam_key(code, rep) - const krb5_data * code; - krb5_sam_key **rep; +krb5_error_code decode_krb5_enc_sam_key(const krb5_data *code, krb5_sam_key **rep) { setup_buf_only(); alloc_field(*rep,krb5_sam_key); @@ -826,9 +766,7 @@ krb5_error_code decode_krb5_enc_sam_key(code, rep) cleanup(free); } -krb5_error_code decode_krb5_enc_sam_response_enc(code, rep) - const krb5_data * code; - krb5_enc_sam_response_enc **rep; +krb5_error_code decode_krb5_enc_sam_response_enc(const krb5_data *code, krb5_enc_sam_response_enc **rep) { setup_buf_only(); alloc_field(*rep,krb5_enc_sam_response_enc); @@ -839,9 +777,7 @@ krb5_error_code decode_krb5_enc_sam_response_enc(code, rep) cleanup(free); } -krb5_error_code decode_krb5_sam_response(code, rep) - const krb5_data * code; - krb5_sam_response **rep; +krb5_error_code decode_krb5_sam_response(const krb5_data *code, krb5_sam_response **rep) { setup_buf_only(); alloc_field(*rep,krb5_sam_response); @@ -852,9 +788,7 @@ krb5_error_code decode_krb5_sam_response(code, rep) cleanup(free); } -krb5_error_code decode_krb5_predicted_sam_response(code, rep) - const krb5_data * code; - krb5_predicted_sam_response **rep; +krb5_error_code decode_krb5_predicted_sam_response(const krb5_data *code, krb5_predicted_sam_response **rep) { setup_buf_only(); /* preallocated */ alloc_field(*rep,krb5_predicted_sam_response); diff --git a/src/lib/krb5/asn.1/krb5_encode.c b/src/lib/krb5/asn.1/krb5_encode.c index 6220798..133f98f 100644 --- a/src/lib/krb5/asn.1/krb5_encode.c +++ b/src/lib/krb5/asn.1/krb5_encode.c @@ -143,9 +143,7 @@ \ return 0 -krb5_error_code encode_krb5_authenticator(rep, code) - const krb5_authenticator * rep; - krb5_data ** code; +krb5_error_code encode_krb5_authenticator(const krb5_authenticator *rep, krb5_data **code) { krb5_setup(); @@ -200,9 +198,7 @@ krb5_error_code encode_krb5_authenticator(rep, code) krb5_cleanup(); } -krb5_error_code encode_krb5_ticket(rep, code) - const krb5_ticket * rep; - krb5_data ** code; +krb5_error_code encode_krb5_ticket(const krb5_ticket *rep, krb5_data **code) { krb5_setup(); @@ -225,9 +221,7 @@ krb5_error_code encode_krb5_ticket(rep, code) krb5_cleanup(); } -krb5_error_code encode_krb5_encryption_key(rep, code) - const krb5_keyblock * rep; - krb5_data ** code; +krb5_error_code encode_krb5_encryption_key(const krb5_keyblock *rep, krb5_data **code) { krb5_setup(); @@ -243,9 +237,7 @@ krb5_error_code encode_krb5_encryption_key(rep, code) krb5_cleanup(); } -krb5_error_code encode_krb5_enc_tkt_part(rep, code) - const krb5_enc_tkt_part * rep; - krb5_data ** code; +krb5_error_code encode_krb5_enc_tkt_part(const krb5_enc_tkt_part *rep, krb5_data **code) { krb5_setup(); @@ -295,9 +287,7 @@ krb5_error_code encode_krb5_enc_tkt_part(rep, code) krb5_cleanup(); } -krb5_error_code encode_krb5_enc_kdc_rep_part(rep, code) - const krb5_enc_kdc_rep_part * rep; - krb5_data ** code; +krb5_error_code encode_krb5_enc_kdc_rep_part(const krb5_enc_kdc_rep_part *rep, krb5_data **code) { asn1_error_code retval; asn1buf *buf=NULL; @@ -323,9 +313,7 @@ krb5_error_code encode_krb5_enc_kdc_rep_part(rep, code) } /* yes, the translation is identical to that used for KDC__REP */ -krb5_error_code encode_krb5_as_rep(rep, code) - const krb5_kdc_rep * rep; - krb5_data ** code; +krb5_error_code encode_krb5_as_rep(const krb5_kdc_rep *rep, krb5_data **code) { krb5_setup(); @@ -340,9 +328,7 @@ krb5_error_code encode_krb5_as_rep(rep, code) } /* yes, the translation is identical to that used for KDC__REP */ -krb5_error_code encode_krb5_tgs_rep( rep, code) - const krb5_kdc_rep * rep; - krb5_data ** code; +krb5_error_code encode_krb5_tgs_rep(const krb5_kdc_rep *rep, krb5_data **code) { krb5_setup(); @@ -356,9 +342,7 @@ krb5_error_code encode_krb5_tgs_rep( rep, code) krb5_cleanup(); } -krb5_error_code encode_krb5_ap_req(rep, code) - const krb5_ap_req * rep; - krb5_data ** code; +krb5_error_code encode_krb5_ap_req(const krb5_ap_req *rep, krb5_data **code) { krb5_setup(); @@ -384,9 +368,7 @@ krb5_error_code encode_krb5_ap_req(rep, code) krb5_cleanup(); } -krb5_error_code encode_krb5_ap_rep(rep, code) - const krb5_ap_rep * rep; - krb5_data ** code; +krb5_error_code encode_krb5_ap_rep(const krb5_ap_rep *rep, krb5_data **code) { krb5_setup(); @@ -407,9 +389,7 @@ krb5_error_code encode_krb5_ap_rep(rep, code) } -krb5_error_code encode_krb5_ap_rep_enc_part(rep, code) - const krb5_ap_rep_enc_part * rep; - krb5_data ** code; +krb5_error_code encode_krb5_ap_rep_enc_part(const krb5_ap_rep_enc_part *rep, krb5_data **code) { krb5_setup(); @@ -434,9 +414,7 @@ krb5_error_code encode_krb5_ap_rep_enc_part(rep, code) krb5_cleanup(); } -krb5_error_code encode_krb5_as_req(rep, code) - const krb5_kdc_req * rep; - krb5_data ** code; +krb5_error_code encode_krb5_as_req(const krb5_kdc_req *rep, krb5_data **code) { krb5_setup(); @@ -450,9 +428,7 @@ krb5_error_code encode_krb5_as_req(rep, code) krb5_cleanup(); } -krb5_error_code encode_krb5_tgs_req(rep, code) - const krb5_kdc_req * rep; - krb5_data ** code; +krb5_error_code encode_krb5_tgs_req(const krb5_kdc_req *rep, krb5_data **code) { krb5_setup(); @@ -466,9 +442,7 @@ krb5_error_code encode_krb5_tgs_req(rep, code) krb5_cleanup(); } -krb5_error_code encode_krb5_kdc_req_body(rep, code) - const krb5_kdc_req * rep; - krb5_data ** code; +krb5_error_code encode_krb5_kdc_req_body(const krb5_kdc_req *rep, krb5_data **code) { krb5_setup(); @@ -480,9 +454,7 @@ krb5_error_code encode_krb5_kdc_req_body(rep, code) } -krb5_error_code encode_krb5_safe(rep, code) - const krb5_safe * rep; - krb5_data ** code; +krb5_error_code encode_krb5_safe(const krb5_safe *rep, krb5_data **code) { krb5_setup(); @@ -505,9 +477,7 @@ krb5_error_code encode_krb5_safe(rep, code) krb5_cleanup(); } -krb5_error_code encode_krb5_priv(rep, code) - const krb5_priv * rep; - krb5_data ** code; +krb5_error_code encode_krb5_priv(const krb5_priv *rep, krb5_data **code) { krb5_setup(); @@ -527,9 +497,7 @@ krb5_error_code encode_krb5_priv(rep, code) krb5_cleanup(); } -krb5_error_code encode_krb5_enc_priv_part(rep, code) - const krb5_priv_enc_part * rep; - krb5_data ** code; +krb5_error_code encode_krb5_enc_priv_part(const krb5_priv_enc_part *rep, krb5_data **code) { krb5_setup(); @@ -561,9 +529,7 @@ krb5_error_code encode_krb5_enc_priv_part(rep, code) krb5_cleanup(); } -krb5_error_code encode_krb5_cred(rep, code) - const krb5_cred * rep; - krb5_data ** code; +krb5_error_code encode_krb5_cred(const krb5_cred *rep, krb5_data **code) { krb5_setup(); @@ -586,9 +552,7 @@ krb5_error_code encode_krb5_cred(rep, code) krb5_cleanup(); } -krb5_error_code encode_krb5_enc_cred_part(rep, code) - const krb5_cred_enc_part * rep; - krb5_data ** code; +krb5_error_code encode_krb5_enc_cred_part(const krb5_cred_enc_part *rep, krb5_data **code) { krb5_setup(); @@ -622,9 +586,7 @@ krb5_error_code encode_krb5_enc_cred_part(rep, code) krb5_cleanup(); } -krb5_error_code encode_krb5_error(rep, code) - const krb5_error * rep; - krb5_data ** code; +krb5_error_code encode_krb5_error(const krb5_error *rep, krb5_data **code) { krb5_setup(); @@ -679,9 +641,7 @@ krb5_error_code encode_krb5_error(rep, code) krb5_cleanup(); } -krb5_error_code encode_krb5_authdata(rep, code) - const krb5_authdata ** rep; - krb5_data ** code; +krb5_error_code encode_krb5_authdata(const krb5_authdata **rep, krb5_data **code) { asn1_error_code retval; asn1buf *buf=NULL; @@ -699,9 +659,7 @@ krb5_error_code encode_krb5_authdata(rep, code) krb5_cleanup(); } -krb5_error_code encode_krb5_alt_method(rep, code) - const krb5_alt_method * rep; - krb5_data ** code; +krb5_error_code encode_krb5_alt_method(const krb5_alt_method *rep, krb5_data **code) { krb5_setup(); @@ -717,9 +675,7 @@ krb5_error_code encode_krb5_alt_method(rep, code) krb5_cleanup(); } -krb5_error_code encode_krb5_etype_info( rep, code) - const krb5_etype_info_entry ** rep; - krb5_data ** code; +krb5_error_code encode_krb5_etype_info(const krb5_etype_info_entry **rep, krb5_data **code) { krb5_setup(); retval = asn1_encode_etype_info(buf,rep,&length); @@ -728,9 +684,7 @@ krb5_error_code encode_krb5_etype_info( rep, code) krb5_cleanup(); } -krb5_error_code encode_krb5_enc_data(rep, code) - const krb5_enc_data * rep; - krb5_data ** code; +krb5_error_code encode_krb5_enc_data(const krb5_enc_data *rep, krb5_data **code) { krb5_setup(); @@ -741,9 +695,7 @@ krb5_error_code encode_krb5_enc_data(rep, code) krb5_cleanup(); } -krb5_error_code encode_krb5_pa_enc_ts(rep, code) - const krb5_pa_enc_ts * rep; - krb5_data ** code; +krb5_error_code encode_krb5_pa_enc_ts(const krb5_pa_enc_ts *rep, krb5_data **code) { krb5_setup(); @@ -760,9 +712,7 @@ krb5_error_code encode_krb5_pa_enc_ts(rep, code) } /* Sandia Additions */ -krb5_error_code encode_krb5_pwd_sequence( rep, code) - const passwd_phrase_element * rep; - krb5_data ** code; +krb5_error_code encode_krb5_pwd_sequence(const passwd_phrase_element *rep, krb5_data **code) { krb5_setup(); retval = asn1_encode_passwdsequence(buf,rep,&length); @@ -771,9 +721,7 @@ krb5_error_code encode_krb5_pwd_sequence( rep, code) krb5_cleanup(); } -krb5_error_code encode_krb5_pwd_data(rep, code) - const krb5_pwd_data * rep; - krb5_data ** code; +krb5_error_code encode_krb5_pwd_data(const krb5_pwd_data *rep, krb5_data **code) { krb5_setup(); krb5_addfield((const passwd_phrase_element**)rep->element,1,asn1_encode_sequence_of_passwdsequence); @@ -782,9 +730,7 @@ krb5_error_code encode_krb5_pwd_data(rep, code) krb5_cleanup(); } -krb5_error_code encode_krb5_padata_sequence(rep, code) - const krb5_pa_data ** rep; - krb5_data ** code; +krb5_error_code encode_krb5_padata_sequence(const krb5_pa_data **rep, krb5_data **code) { krb5_setup(); @@ -796,9 +742,7 @@ krb5_error_code encode_krb5_padata_sequence(rep, code) } /* sam preauth additions */ -krb5_error_code encode_krb5_sam_challenge(rep, code) - const krb5_sam_challenge * rep; - krb5_data ** code; +krb5_error_code encode_krb5_sam_challenge(const krb5_sam_challenge *rep, krb5_data **code) { krb5_setup(); retval = asn1_encode_sam_challenge(buf,rep,&length); @@ -807,9 +751,7 @@ krb5_error_code encode_krb5_sam_challenge(rep, code) krb5_cleanup(); } -krb5_error_code encode_krb5_sam_key(rep, code) - const krb5_sam_key * rep; - krb5_data ** code; +krb5_error_code encode_krb5_sam_key(const krb5_sam_key *rep, krb5_data **code) { krb5_setup(); retval = asn1_encode_sam_key(buf,rep,&length); @@ -818,9 +760,7 @@ krb5_error_code encode_krb5_sam_key(rep, code) krb5_cleanup(); } -krb5_error_code encode_krb5_enc_sam_response_enc(rep, code) - const krb5_enc_sam_response_enc * rep; - krb5_data ** code; +krb5_error_code encode_krb5_enc_sam_response_enc(const krb5_enc_sam_response_enc *rep, krb5_data **code) { krb5_setup(); retval = asn1_encode_enc_sam_response_enc(buf,rep,&length); @@ -829,9 +769,7 @@ krb5_error_code encode_krb5_enc_sam_response_enc(rep, code) krb5_cleanup(); } -krb5_error_code encode_krb5_sam_response(rep, code) - const krb5_sam_response * rep; - krb5_data ** code; +krb5_error_code encode_krb5_sam_response(const krb5_sam_response *rep, krb5_data **code) { krb5_setup(); retval = asn1_encode_sam_response(buf,rep,&length); @@ -840,9 +778,7 @@ krb5_error_code encode_krb5_sam_response(rep, code) krb5_cleanup(); } -krb5_error_code encode_krb5_predicted_sam_response(rep, code) - const krb5_predicted_sam_response * rep; - krb5_data ** code; +krb5_error_code encode_krb5_predicted_sam_response(const krb5_predicted_sam_response *rep, krb5_data **code) { krb5_setup(); retval = asn1_encode_predicted_sam_response(buf,rep,&length); |