From f33e326f8f7ea7dde5026482f38083275ab8679c Mon Sep 17 00:00:00 2001 From: Chris Provenzano Date: Fri, 13 Jan 1995 21:19:08 +0000 Subject: [PATCH] Removed all references to DECLARG and OLDDECLARG git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@4809 dc483132-0cff-0310-8789-dd5450dbe970 --- src/lib/crypto/des-crc.c | 32 +-- src/lib/crypto/des-md5.c | 32 +-- src/lib/crypto/des/cbc_cksum.c | 16 +- src/lib/crypto/des/destest.c | 7 +- src/lib/crypto/des/fin_rndkey.c | 4 +- src/lib/crypto/des/finish_key.c | 4 +- src/lib/crypto/des/init_rkey.c | 7 +- src/lib/crypto/des/new_rn_key.c | 3 +- src/lib/crypto/des/process_ky.c | 7 +- src/lib/crypto/des/random_key.c | 10 +- src/lib/crypto/des/string2key.c | 16 +- src/lib/crypto/des/verify.c | 19 +- src/lib/crypto/raw-des.c | 32 +-- src/lib/krb5/asn.1/asn1_decode.c | 75 +++--- src/lib/krb5/asn.1/asn1_decode_k.c | 241 +++++++++---------- src/lib/krb5/asn.1/asn1_encode.c | 102 ++++---- src/lib/krb5/asn.1/asn1_encode_k.c | 320 ++++++++++---------------- src/lib/krb5/asn.1/asn1_get.c | 43 ++-- src/lib/krb5/asn.1/asn1_make.c | 94 +++----- src/lib/krb5/asn.1/asn1_misc.c | 7 +- src/lib/krb5/asn.1/asn1buf.c | 141 +++++------- src/lib/krb5/asn.1/kkdcr2kdcr.c | 7 +- src/lib/krb5/asn.1/krb5_decode.c | 154 ++++++------- src/lib/krb5/asn.1/krb5_encode.c | 154 ++++++------- src/lib/krb5/keytab/file/ktf_add.c | 13 +- src/lib/krb5/keytab/file/ktf_close.c | 3 +- src/lib/krb5/keytab/file/ktf_endget.c | 5 +- src/lib/krb5/keytab/file/ktf_get_en.c | 32 ++- src/lib/krb5/keytab/file/ktf_get_na.c | 3 +- src/lib/krb5/keytab/file/ktf_next.c | 5 +- src/lib/krb5/keytab/file/ktf_remove.c | 21 +- src/lib/krb5/keytab/file/ktf_resolv.c | 3 +- src/lib/krb5/keytab/file/ktf_ssget.c | 7 +- src/lib/krb5/keytab/file/ktf_util.c | 82 ++++--- src/lib/krb5/keytab/file/ktf_wreslv.c | 3 +- src/lib/krb5/keytab/file/ktfile.h | 138 +++++++---- 36 files changed, 825 insertions(+), 1017 deletions(-) diff --git a/src/lib/crypto/des-crc.c b/src/lib/crypto/des-crc.c index 26d7ca2c2..41258587c 100644 --- a/src/lib/crypto/des-crc.c +++ b/src/lib/crypto/des-crc.c @@ -63,16 +63,12 @@ krb5_cs_table_entry krb5_des_crc_cst_entry = { static krb5_error_code - mit_des_crc_encrypt_func(DECLARG(krb5_const_pointer, in), - DECLARG(krb5_pointer, out), - DECLARG(const size_t, size), - DECLARG(krb5_encrypt_block *, key), - DECLARG(krb5_pointer, ivec)) -OLDDECLARG(krb5_const_pointer, in) -OLDDECLARG(krb5_pointer, out) -OLDDECLARG(const size_t, size) -OLDDECLARG(krb5_encrypt_block *, key) -OLDDECLARG(krb5_pointer, ivec) +mit_des_crc_encrypt_func(in, out, size, key, ivec) + krb5_const_pointer in; + krb5_pointer out; + const size_t size; + krb5_encrypt_block * key; + krb5_pointer ivec; { krb5_checksum cksum; krb5_octet contents[CRC32_CKSUM_LENGTH]; @@ -132,16 +128,12 @@ OLDDECLARG(krb5_pointer, ivec) } static krb5_error_code - mit_des_crc_decrypt_func(DECLARG(krb5_const_pointer, in), - DECLARG(krb5_pointer, out), - DECLARG(const size_t, size), - DECLARG(krb5_encrypt_block *, key), - DECLARG(krb5_pointer, ivec)) -OLDDECLARG(krb5_const_pointer, in) -OLDDECLARG(krb5_pointer, out) -OLDDECLARG(const size_t, size) -OLDDECLARG(krb5_encrypt_block *, key) -OLDDECLARG(krb5_pointer, ivec) +mit_des_crc_decrypt_func(in, out, size, key, ivec) + krb5_const_pointer in; + krb5_pointer out; + const size_t size; + krb5_encrypt_block * key; + krb5_pointer ivec; { krb5_checksum cksum; krb5_octet contents_prd[CRC32_CKSUM_LENGTH]; diff --git a/src/lib/crypto/des-md5.c b/src/lib/crypto/des-md5.c index ea9bd95a5..39adb1144 100644 --- a/src/lib/crypto/des-md5.c +++ b/src/lib/crypto/des-md5.c @@ -64,16 +64,12 @@ krb5_cs_table_entry krb5_des_md5_cst_entry = { static krb5_error_code - mit_des_md5_encrypt_func(DECLARG(krb5_const_pointer, in), - DECLARG(krb5_pointer, out), - DECLARG(const size_t, size), - DECLARG(krb5_encrypt_block *, key), - DECLARG(krb5_pointer, ivec)) -OLDDECLARG(krb5_const_pointer, in) -OLDDECLARG(krb5_pointer, out) -OLDDECLARG(const size_t, size) -OLDDECLARG(krb5_encrypt_block *, key) -OLDDECLARG(krb5_pointer, ivec) +mit_des_md5_encrypt_func(in, out, size, key, ivec) + krb5_const_pointer in; + krb5_pointer out; + const size_t size; + krb5_encrypt_block * key; + krb5_pointer ivec; { krb5_checksum cksum; krb5_octet contents[RSA_MD5_CKSUM_LENGTH]; @@ -133,16 +129,12 @@ OLDDECLARG(krb5_pointer, ivec) } static krb5_error_code - mit_des_md5_decrypt_func(DECLARG(krb5_const_pointer, in), - DECLARG(krb5_pointer, out), - DECLARG(const size_t, size), - DECLARG(krb5_encrypt_block *, key), - DECLARG(krb5_pointer, ivec)) -OLDDECLARG(krb5_const_pointer, in) -OLDDECLARG(krb5_pointer, out) -OLDDECLARG(const size_t, size) -OLDDECLARG(krb5_encrypt_block *, key) -OLDDECLARG(krb5_pointer, ivec) +mit_des_md5_decrypt_func(in, out, size, key, ivec) + krb5_const_pointer in; + krb5_pointer out; + const size_t size; + krb5_encrypt_block * key; + krb5_pointer ivec; { krb5_checksum cksum; krb5_octet contents_prd[RSA_MD5_CKSUM_LENGTH]; diff --git a/src/lib/crypto/des/cbc_cksum.c b/src/lib/crypto/des/cbc_cksum.c index 73254dac5..625326f0a 100644 --- a/src/lib/crypto/des/cbc_cksum.c +++ b/src/lib/crypto/des/cbc_cksum.c @@ -46,16 +46,12 @@ returns: errors */ -krb5_error_code mit_des_cbc_checksum(DECLARG(krb5_pointer, in), - DECLARG(size_t, in_length), - DECLARG(krb5_pointer, key), - DECLARG(size_t, key_size), - DECLARG(krb5_checksum *, cksum)) -OLDDECLARG(krb5_pointer, in) -OLDDECLARG(size_t, in_length) -OLDDECLARG(krb5_pointer, key) -OLDDECLARG(size_t, key_size) -OLDDECLARG(krb5_checksum *, cksum) +krb5_error_code mit_des_cbc_checksum(in, in_length, key, key_size, cksum) + krb5_pointer in; + size_t in_length; + krb5_pointer key; + size_t key_size; + krb5_checksum * cksum; { struct mit_des_ks_struct *schedule; /* pointer to key schedules */ krb5_octet *contents; diff --git a/src/lib/crypto/des/destest.c b/src/lib/crypto/des/destest.c index c7fc3d884..71c2c6f8e 100644 --- a/src/lib/crypto/des/destest.c +++ b/src/lib/crypto/des/destest.c @@ -47,6 +47,7 @@ char *argv[]; krb5_encrypt_block eblock; krb5_keyblock keyblock; + krb5_context context; mit_des_cblock key, input, output, output2; krb5_error_code retval; int num = 0; @@ -56,7 +57,7 @@ char *argv[]; /* do some initialisation */ initialize_krb5_error_table(); - krb5_use_cstype(&eblock, ETYPE_DES_CBC_CRC); + krb5_use_cstype(context, &eblock, ETYPE_DES_CBC_CRC); keyblock.magic = KV5M_KEYBLOCK; keyblock.etype = ETYPE_DES_CBC_CRC; keyblock.keytype = KEYTYPE_DES; @@ -68,7 +69,7 @@ char *argv[]; convert(block2, input); convert(block3, output); - if (retval = krb5_process_key(&eblock,&keyblock)) { + if (retval = krb5_process_key(context, &eblock,&keyblock)) { com_err("des test", retval, "can't process key"); exit(-1); } @@ -99,7 +100,7 @@ char *argv[]; error++; } - if (retval = krb5_finish_key(&eblock)) { + if (retval = krb5_finish_key(context, &eblock)) { com_err("des verify", retval, "can't finish key"); exit(-1); } diff --git a/src/lib/crypto/des/fin_rndkey.c b/src/lib/crypto/des/fin_rndkey.c index cbd562191..37905c160 100644 --- a/src/lib/crypto/des/fin_rndkey.c +++ b/src/lib/crypto/des/fin_rndkey.c @@ -32,8 +32,8 @@ free any resources held by "seed" and assigned by init_random_key() */ -krb5_error_code mit_des_finish_random_key (DECLARG(krb5_pointer *, seed)) -OLDDECLARG(krb5_pointer *, seed) +krb5_error_code mit_des_finish_random_key (seed) + krb5_pointer * seed; { memset((char *)*seed, 0, sizeof(mit_des_random_key_seed) ); krb5_xfree(*seed); diff --git a/src/lib/crypto/des/finish_key.c b/src/lib/crypto/des/finish_key.c index adbe18cc7..b70b679ea 100644 --- a/src/lib/crypto/des/finish_key.c +++ b/src/lib/crypto/des/finish_key.c @@ -36,8 +36,8 @@ returns: errors */ -krb5_error_code mit_des_finish_key (DECLARG(krb5_encrypt_block *,eblock)) -OLDDECLARG(krb5_encrypt_block *,eblock) +krb5_error_code mit_des_finish_key (eblock) + krb5_encrypt_block * eblock; { memset((char *)eblock->priv, 0, sizeof(mit_des_key_schedule)); free(eblock->priv); diff --git a/src/lib/crypto/des/init_rkey.c b/src/lib/crypto/des/init_rkey.c index ae2708c59..954adf254 100644 --- a/src/lib/crypto/des/init_rkey.c +++ b/src/lib/crypto/des/init_rkey.c @@ -37,10 +37,9 @@ sequence information. */ -krb5_error_code mit_des_init_random_key (DECLARG(const krb5_keyblock *,seedblock), - DECLARG(krb5_pointer *,seed)) -OLDDECLARG(const krb5_keyblock *,seedblock) -OLDDECLARG(krb5_pointer *,seed) +krb5_error_code mit_des_init_random_key (seedblock, seed) + const krb5_keyblock * seedblock; + krb5_pointer * seed; { mit_des_random_key_seed * p_seed; if (seedblock->keytype != KEYTYPE_DES) diff --git a/src/lib/crypto/des/new_rn_key.c b/src/lib/crypto/des/new_rn_key.c index 4fc48c4ed..084c63fc8 100644 --- a/src/lib/crypto/des/new_rn_key.c +++ b/src/lib/crypto/des/new_rn_key.c @@ -90,6 +90,7 @@ void mit_des_init_random_number_generator(key,p_seed) mit_des_cblock new_key; krb5_address **addrs = 0; + krb5_context context; /* * use a host id in generating the seed to ensure @@ -128,7 +129,7 @@ void mit_des_init_random_number_generator(key,p_seed) * use a time stamp to ensure that a server started later does not reuse * an old stream: */ - (void) krb5_us_timeofday(&timenow.seconds, + (void) krb5_us_timeofday(context, &timenow.seconds, &timenow.microseconds); /* XXX return value */ mit_des_set_sequence_number((unsigned char *)&timenow, p_seed); diff --git a/src/lib/crypto/des/process_ky.c b/src/lib/crypto/des/process_ky.c index 78d224e7b..a2214f63d 100644 --- a/src/lib/crypto/des/process_ky.c +++ b/src/lib/crypto/des/process_ky.c @@ -44,10 +44,9 @@ returns: errors */ -krb5_error_code mit_des_process_key (DECLARG(krb5_encrypt_block *, eblock), - DECLARG(const krb5_keyblock *,keyblock)) -OLDDECLARG(krb5_encrypt_block *, eblock) -OLDDECLARG(const krb5_keyblock *,keyblock) +krb5_error_code mit_des_process_key (eblock, keyblock) + krb5_encrypt_block * eblock; + const krb5_keyblock * keyblock; { struct mit_des_ks_struct *schedule; /* pointer to key schedules */ diff --git a/src/lib/crypto/des/random_key.c b/src/lib/crypto/des/random_key.c index 184d1099e..009e26db4 100644 --- a/src/lib/crypto/des/random_key.c +++ b/src/lib/crypto/des/random_key.c @@ -33,12 +33,10 @@ filling in the keyblock address in *keyblock */ -krb5_error_code mit_des_random_key (DECLARG(const krb5_encrypt_block *, eblock), - DECLARG(krb5_pointer, seed), - DECLARG(krb5_keyblock **, keyblock)) -OLDDECLARG(const krb5_encrypt_block *, eblock) -OLDDECLARG(krb5_pointer, seed) -OLDDECLARG(krb5_keyblock **, keyblock) +krb5_error_code mit_des_random_key (eblock, seed, keyblock) + const krb5_encrypt_block * eblock; + krb5_pointer seed; + krb5_keyblock ** keyblock; { krb5_keyblock *randkey; diff --git a/src/lib/crypto/des/string2key.c b/src/lib/crypto/des/string2key.c index be3292beb..d4d8b8849 100644 --- a/src/lib/crypto/des/string2key.c +++ b/src/lib/crypto/des/string2key.c @@ -44,16 +44,12 @@ returns: errors */ -krb5_error_code mit_des_string_to_key (DECLARG(const krb5_encrypt_block *, eblock), - DECLARG(const krb5_keytype, keytype), - DECLARG(krb5_keyblock *,keyblock), - DECLARG(const krb5_data *,data), - DECLARG(const krb5_data *, salt)) -OLDDECLARG(const krb5_encrypt_block *, eblock) -OLDDECLARG(const krb5_keytype, keytype) -OLDDECLARG(krb5_keyblock *,keyblock) -OLDDECLARG(const krb5_data *,data) -OLDDECLARG(const krb5_data *, salt) +krb5_error_code mit_des_string_to_key (eblock, keytype, keyblock, data, salt) +const krb5_encrypt_block * eblock; +const krb5_keytype keytype; +krb5_keyblock * keyblock; +const krb5_data * data; +const krb5_data * salt; { register char *str, *copystr; register krb5_octet *key; diff --git a/src/lib/crypto/des/verify.c b/src/lib/crypto/des/verify.c index 387e2c7cb..0d70bd708 100644 --- a/src/lib/crypto/des/verify.c +++ b/src/lib/crypto/des/verify.c @@ -109,6 +109,7 @@ main(argc,argv) char *argv[]; { /* Local Declarations */ + krb5_context context; int in_length; void do_encrypt(); void do_decrypt(); @@ -147,7 +148,7 @@ main(argc,argv) /* do some initialisation */ initialize_krb5_error_table(); - krb5_use_cstype(&eblock, ETYPE_DES_CBC_CRC); + krb5_use_cstype(context, &eblock, ETYPE_DES_CBC_CRC); keyblock.keytype = KEYTYPE_DES; keyblock.length = sizeof (mit_des_cblock); @@ -157,7 +158,7 @@ main(argc,argv) if (zflag) { input = zero_text; keyblock.contents = (krb5_octet *)zero_key; - if (retval = krb5_process_key(&eblock,&keyblock)) { + if (retval = krb5_process_key(context, &eblock,&keyblock)) { com_err("des verify", retval, "can't process zero key"); exit(-1); } @@ -168,7 +169,7 @@ main(argc,argv) printf("%02x ",cipher_text[j]); printf("\n"); do_decrypt(output,cipher_text); - if (retval = krb5_finish_key(&eblock)) { + if (retval = krb5_finish_key(context, &eblock)) { com_err("des verify", retval, "can't finish zero key"); exit(-1); } @@ -182,7 +183,7 @@ main(argc,argv) if (mflag) { input = msb_text; keyblock.contents = (krb5_octet *)key3; - if (retval = krb5_process_key(&eblock,&keyblock)) { + if (retval = krb5_process_key(context, &eblock,&keyblock)) { com_err("des verify", retval, "can't process key3"); exit(-1); } @@ -196,7 +197,7 @@ main(argc,argv) } printf("\n"); do_decrypt(output,cipher_text); - if (retval = krb5_finish_key(&eblock)) { + if (retval = krb5_finish_key(context, &eblock)) { com_err("des verify", retval, "can't finish key3"); exit(-1); } @@ -211,7 +212,7 @@ main(argc,argv) { input = zero_text; keyblock.contents = (krb5_octet *)key2; - if (retval = krb5_process_key(&eblock,&keyblock)) { + if (retval = krb5_process_key(context, &eblock,&keyblock)) { com_err("des verify", retval, "can't process key2"); exit(-1); } @@ -230,7 +231,7 @@ main(argc,argv) printf("%02x ",cipher_text[j]); printf("\n\n"); do_decrypt(output,cipher_text); - if (retval = krb5_finish_key(&eblock)) { + if (retval = krb5_finish_key(context, &eblock)) { com_err("des verify", retval, "can't finish key2"); exit(-1); } @@ -245,7 +246,7 @@ main(argc,argv) /* ECB mode */ { keyblock.contents = (krb5_octet *)default_key; - if (retval = krb5_process_key(&eblock,&keyblock)) { + if (retval = krb5_process_key(context, &eblock,&keyblock)) { com_err("des verify", retval, "can't process key2"); exit(-1); } @@ -328,7 +329,7 @@ main(argc,argv) for (j = 0; j<=7; j++) printf("%02x ",cipher_text[j]); printf("\n\n"); - if (retval = krb5_finish_key(&eblock)) { + if (retval = krb5_finish_key(context, &eblock)) { com_err("des verify", retval, "can't finish key2"); exit(-1); } diff --git a/src/lib/crypto/raw-des.c b/src/lib/crypto/raw-des.c index bb0a7a4dc..254c86223 100644 --- a/src/lib/crypto/raw-des.c +++ b/src/lib/crypto/raw-des.c @@ -61,16 +61,12 @@ krb5_cs_table_entry krb5_raw_des_cst_entry = { }; static krb5_error_code - mit_raw_des_decrypt_func(DECLARG(krb5_const_pointer, in), - DECLARG(krb5_pointer, out), - DECLARG(const size_t, size), - DECLARG(krb5_encrypt_block *, key), - DECLARG(krb5_pointer, ivec)) -OLDDECLARG(krb5_const_pointer, in) -OLDDECLARG(krb5_pointer, out) -OLDDECLARG(const size_t, size) -OLDDECLARG(krb5_encrypt_block *, key) -OLDDECLARG(krb5_pointer, ivec) +mit_raw_des_decrypt_func(in, out, size, key, ivec) + krb5_const_pointer in; + krb5_pointer out; + const size_t size; + krb5_encrypt_block * key; + krb5_pointer ivec; { return (mit_des_cbc_encrypt (in, out, @@ -81,16 +77,12 @@ OLDDECLARG(krb5_pointer, ivec) } static krb5_error_code - mit_raw_des_encrypt_func(DECLARG(krb5_const_pointer, in), - DECLARG(krb5_pointer, out), - DECLARG(const size_t, size), - DECLARG(krb5_encrypt_block *, key), - DECLARG(krb5_pointer, ivec)) -OLDDECLARG(krb5_const_pointer, in) -OLDDECLARG(krb5_pointer, out) -OLDDECLARG(const size_t, size) -OLDDECLARG(krb5_encrypt_block *, key) -OLDDECLARG(krb5_pointer, ivec) +mit_raw_des_encrypt_func(in, out, size, key, ivec) + krb5_const_pointer in; + krb5_pointer out; + const size_t size; + krb5_encrypt_block * key; + krb5_pointer ivec; { int sumsize; diff --git a/src/lib/krb5/asn.1/asn1_decode.c b/src/lib/krb5/asn.1/asn1_decode.c index 40ead9486..823f4cd53 100644 --- a/src/lib/krb5/asn.1/asn1_decode.c +++ b/src/lib/krb5/asn.1/asn1_decode.c @@ -50,10 +50,9 @@ if(class != UNIVERSAL || construction != PRIMITIVE || tagnum != type)\ #define cleanup()\ return 0 -asn1_error_code asn1_decode_integer(DECLARG(asn1buf *, buf), - DECLARG(long *, val)) - OLDDECLARG(asn1buf *, buf) - OLDDECLARG(long *, val) +asn1_error_code asn1_decode_integer(buf, val) + asn1buf * buf; + long * val; { setup(); asn1_octet o; @@ -70,10 +69,9 @@ asn1_error_code asn1_decode_integer(DECLARG(asn1buf *, buf), cleanup(); } -asn1_error_code asn1_decode_unsigned_integer(DECLARG(asn1buf *, buf), - DECLARG(unsigned long *, val)) - OLDDECLARG(asn1buf *, buf) - OLDDECLARG(unsigned long *, val) +asn1_error_code asn1_decode_unsigned_integer(buf, val) + asn1buf * buf; + unsigned long * val; { setup(); asn1_octet o; @@ -90,12 +88,10 @@ asn1_error_code asn1_decode_unsigned_integer(DECLARG(asn1buf *, buf), cleanup(); } -asn1_error_code asn1_decode_octetstring(DECLARG(asn1buf *, buf), - DECLARG(int *, retlen), - DECLARG(asn1_octet **, val)) - OLDDECLARG(asn1buf *, buf) - OLDDECLARG(int *, retlen) - OLDDECLARG(asn1_octet **, val) +asn1_error_code asn1_decode_octetstring(buf, retlen, val) + asn1buf * buf; + int * retlen; + asn1_octet ** val; { setup(); tag(ASN1_OCTETSTRING); @@ -105,12 +101,10 @@ asn1_error_code asn1_decode_octetstring(DECLARG(asn1buf *, buf), cleanup(); } -asn1_error_code asn1_decode_charstring(DECLARG(asn1buf *, buf), - DECLARG(int *, retlen), - DECLARG(char **, val)) - OLDDECLARG(asn1buf *, buf) - OLDDECLARG(int *, retlen) - OLDDECLARG(char **, val) +asn1_error_code asn1_decode_charstring(buf, retlen, val) + asn1buf * buf; + int * retlen; + char ** val; { setup(); tag(ASN1_OCTETSTRING); @@ -121,12 +115,10 @@ asn1_error_code asn1_decode_charstring(DECLARG(asn1buf *, buf), } -asn1_error_code asn1_decode_generalstring(DECLARG(asn1buf *, buf), - DECLARG(int *, retlen), - DECLARG(char **, val)) - OLDDECLARG(asn1buf *, buf) - OLDDECLARG(int *, retlen) - OLDDECLARG(char **, val) +asn1_error_code asn1_decode_generalstring(buf, retlen, val) + asn1buf * buf; + int * retlen; + char ** val; { setup(); tag(ASN1_GENERALSTRING); @@ -137,8 +129,8 @@ asn1_error_code asn1_decode_generalstring(DECLARG(asn1buf *, buf), } -asn1_error_code asn1_decode_null(DECLARG(asn1buf *, buf)) - OLDDECLARG(asn1buf *, buf) +asn1_error_code asn1_decode_null(buf) + asn1buf * buf; { setup(); tag(ASN1_NULL); @@ -146,12 +138,10 @@ asn1_error_code asn1_decode_null(DECLARG(asn1buf *, buf)) cleanup(); } -asn1_error_code asn1_decode_printablestring(DECLARG(asn1buf *, buf), - DECLARG(int *, retlen), - DECLARG(char **, val)) - OLDDECLARG(asn1buf *, buf) - OLDDECLARG(int *, retlen) - OLDDECLARG(char **, val) +asn1_error_code asn1_decode_printablestring(buf, retlen, val) + asn1buf * buf; + int * retlen; + char ** val; { setup(); tag(ASN1_PRINTABLESTRING); @@ -161,12 +151,10 @@ asn1_error_code asn1_decode_printablestring(DECLARG(asn1buf *, buf), cleanup(); } -asn1_error_code asn1_decode_ia5string(DECLARG(asn1buf *, buf), - DECLARG(int *, retlen), - DECLARG(char **, val)) - OLDDECLARG(asn1buf *, buf) - OLDDECLARG(int *, retlen) - OLDDECLARG(char **, val) +asn1_error_code asn1_decode_ia5string(buf, retlen, val) + asn1buf * buf; + int * retlen; + char ** val; { setup(); tag(ASN1_IA5STRING); @@ -176,10 +164,9 @@ asn1_error_code asn1_decode_ia5string(DECLARG(asn1buf *, buf), cleanup(); } -asn1_error_code asn1_decode_generaltime(DECLARG(asn1buf *, buf), - DECLARG(time_t *, val)) - OLDDECLARG(asn1buf *, buf) - OLDDECLARG(time_t *, val) +asn1_error_code asn1_decode_generaltime(buf, val) + asn1buf * buf; + time_t * val; { setup(); char *s; diff --git a/src/lib/krb5/asn.1/asn1_decode_k.c b/src/lib/krb5/asn.1/asn1_decode_k.c index f567c65e5..1f0cc7701 100644 --- a/src/lib/krb5/asn.1/asn1_decode_k.c +++ b/src/lib/krb5/asn.1/asn1_decode_k.c @@ -110,10 +110,9 @@ return 0 /* scalars */ -asn1_error_code asn1_decode_kerberos_time(DECLARG(asn1buf *, buf), - DECLARG(krb5_timestamp *, val)) - OLDDECLARG(asn1buf *, buf) - OLDDECLARG(krb5_timestamp *, val) +asn1_error_code asn1_decode_kerberos_time(buf, val) + asn1buf * buf; + krb5_timestamp * val; { time_t t; asn1_error_code retval; @@ -127,10 +126,9 @@ asn1_error_code asn1_decode_kerberos_time(DECLARG(asn1buf *, buf), } #define integer_convert(fname,ktype)\ -asn1_error_code fname(DECLARG(asn1buf *, buf),\ - DECLARG(ktype *, val))\ - OLDDECLARG(asn1buf *, buf)\ - OLDDECLARG(ktype *, val)\ +asn1_error_code fname(buf, val)\ + asn1buf * buf;\ + ktype * val;\ {\ asn1_error_code retval;\ long n;\ @@ -140,10 +138,9 @@ asn1_error_code fname(DECLARG(asn1buf *, buf),\ return 0;\ } #define unsigned_integer_convert(fname,ktype)\ -asn1_error_code fname(DECLARG(asn1buf *, buf),\ - DECLARG(ktype *, val))\ - OLDDECLARG(asn1buf *, buf)\ - OLDDECLARG(ktype *, val)\ +asn1_error_code fname(buf, val)\ + asn1buf * buf;\ + ktype * val;\ {\ asn1_error_code retval;\ unsigned long n;\ @@ -164,10 +161,9 @@ 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(DECLARG(asn1buf *, buf), - DECLARG(krb5_msgtype *, val)) - OLDDECLARG(asn1buf *, buf) - OLDDECLARG(krb5_msgtype *, val) +asn1_error_code asn1_decode_msgtype(buf, val) + asn1buf * buf; + krb5_msgtype * val; { asn1_error_code retval; unsigned long n; @@ -181,20 +177,18 @@ asn1_error_code asn1_decode_msgtype(DECLARG(asn1buf *, buf), /* structures */ -asn1_error_code asn1_decode_realm(DECLARG(asn1buf *, buf), - DECLARG(krb5_principal *, val)) - OLDDECLARG(asn1buf *, buf) - OLDDECLARG(krb5_principal *, val) +asn1_error_code asn1_decode_realm(buf, val) + asn1buf * buf; + krb5_principal * val; { return asn1_decode_generalstring(buf, &((*val)->realm.length), &((*val)->realm.data)); } -asn1_error_code asn1_decode_principal_name(DECLARG(asn1buf *, buf), - DECLARG(krb5_principal *, val)) - OLDDECLARG(asn1buf *, buf) - OLDDECLARG(krb5_principal *, val) +asn1_error_code asn1_decode_principal_name(buf, val) + asn1buf * buf; + krb5_principal * val; { setup(); { begin_structure(); @@ -223,10 +217,9 @@ asn1_error_code asn1_decode_principal_name(DECLARG(asn1buf *, buf), cleanup(); } -asn1_error_code asn1_decode_checksum(DECLARG(asn1buf *, buf), - DECLARG(krb5_checksum *, val)) - OLDDECLARG(asn1buf *, buf) - OLDDECLARG(krb5_checksum *, val) +asn1_error_code asn1_decode_checksum(buf, val) + asn1buf * buf; + krb5_checksum * val; { setup(); { begin_structure(); @@ -238,10 +231,9 @@ asn1_error_code asn1_decode_checksum(DECLARG(asn1buf *, buf), cleanup(); } -asn1_error_code asn1_decode_encryption_key(DECLARG(asn1buf *, buf), - DECLARG(krb5_keyblock *, val)) - OLDDECLARG(asn1buf *, buf) - OLDDECLARG(krb5_keyblock *, val) +asn1_error_code asn1_decode_encryption_key(buf, val) + asn1buf * buf; + krb5_keyblock * val; { setup(); { begin_structure(); @@ -254,10 +246,9 @@ asn1_error_code asn1_decode_encryption_key(DECLARG(asn1buf *, buf), cleanup(); } -asn1_error_code asn1_decode_encrypted_data(DECLARG(asn1buf *, buf), - DECLARG(krb5_enc_data *, val)) - OLDDECLARG(asn1buf *, buf) - OLDDECLARG(krb5_enc_data *, val) +asn1_error_code asn1_decode_encrypted_data(buf, val) + asn1buf * buf; + krb5_enc_data * val; { setup(); { begin_structure(); @@ -270,10 +261,9 @@ asn1_error_code asn1_decode_encrypted_data(DECLARG(asn1buf *, buf), cleanup(); } -asn1_error_code asn1_decode_krb5_flags(DECLARG(asn1buf *, buf), - DECLARG(krb5_flags *, val)) - OLDDECLARG(asn1buf *, buf) - OLDDECLARG(krb5_flags *, val) +asn1_error_code asn1_decode_krb5_flags(buf, val) + asn1buf * buf; + krb5_flags * val; { setup(); asn1_octet o; @@ -299,28 +289,24 @@ asn1_error_code asn1_decode_krb5_flags(DECLARG(asn1buf *, buf), return 0; } -asn1_error_code asn1_decode_ticket_flags(DECLARG(asn1buf *, buf), - DECLARG(krb5_flags *, val)) - OLDDECLARG(asn1buf *, buf) - OLDDECLARG(krb5_flags *, val) +asn1_error_code asn1_decode_ticket_flags(buf, val) + asn1buf * buf; + krb5_flags * val; { return asn1_decode_krb5_flags(buf,val); } -asn1_error_code asn1_decode_ap_options(DECLARG(asn1buf *, buf), - DECLARG(krb5_flags *, val)) - OLDDECLARG(asn1buf *, buf) - OLDDECLARG(krb5_flags *, val) +asn1_error_code asn1_decode_ap_options(buf, val) + asn1buf * buf; + krb5_flags * val; { return asn1_decode_krb5_flags(buf,val); } -asn1_error_code asn1_decode_kdc_options(DECLARG(asn1buf *, buf), - DECLARG(krb5_flags *, val)) - OLDDECLARG(asn1buf *, buf) - OLDDECLARG(krb5_flags *, val) +asn1_error_code asn1_decode_kdc_options(buf, val) + asn1buf * buf; + krb5_flags * val; { return asn1_decode_krb5_flags(buf,val); } -asn1_error_code asn1_decode_transited_encoding(DECLARG(asn1buf *, buf), - DECLARG(krb5_transited *, val)) - OLDDECLARG(asn1buf *, buf) - OLDDECLARG(krb5_transited *, val) +asn1_error_code asn1_decode_transited_encoding(buf, val) + asn1buf * buf; + krb5_transited * val; { setup(); { begin_structure(); @@ -332,10 +318,9 @@ asn1_error_code asn1_decode_transited_encoding(DECLARG(asn1buf *, buf), cleanup(); } -asn1_error_code asn1_decode_enc_kdc_rep_part(DECLARG(asn1buf *, buf), - DECLARG(krb5_enc_kdc_rep_part *, val)) - OLDDECLARG(asn1buf *, buf) - OLDDECLARG(krb5_enc_kdc_rep_part *, val) +asn1_error_code asn1_decode_enc_kdc_rep_part(buf, val) + asn1buf * buf; + krb5_enc_kdc_rep_part * val; { setup(); { begin_structure(); @@ -359,10 +344,9 @@ asn1_error_code asn1_decode_enc_kdc_rep_part(DECLARG(asn1buf *, buf), cleanup(); } -asn1_error_code asn1_decode_ticket(DECLARG(asn1buf *, buf), - DECLARG(krb5_ticket *, val)) - OLDDECLARG(asn1buf *, buf) - OLDDECLARG(krb5_ticket *, val) +asn1_error_code asn1_decode_ticket(buf, val) + asn1buf * buf; + krb5_ticket * val; { setup(); apptag(1); @@ -380,10 +364,9 @@ asn1_error_code asn1_decode_ticket(DECLARG(asn1buf *, buf), cleanup(); } -asn1_error_code asn1_decode_kdc_req(DECLARG(asn1buf *, buf), - DECLARG(krb5_kdc_req *, val)) - OLDDECLARG(asn1buf *, buf) - OLDDECLARG(krb5_kdc_req *, val) +asn1_error_code asn1_decode_kdc_req(buf, val) + asn1buf * buf; + krb5_kdc_req * val; { setup(); { begin_structure(); @@ -399,10 +382,9 @@ asn1_error_code asn1_decode_kdc_req(DECLARG(asn1buf *, buf), cleanup(); } -asn1_error_code asn1_decode_kdc_req_body(DECLARG(asn1buf *, buf), - DECLARG(krb5_kdc_req *, val)) - OLDDECLARG(asn1buf *, buf) - OLDDECLARG(krb5_kdc_req *, val) +asn1_error_code asn1_decode_kdc_req_body(buf, val) + asn1buf * buf; + krb5_kdc_req * val; { setup(); { begin_structure(); @@ -437,10 +419,9 @@ asn1_error_code asn1_decode_kdc_req_body(DECLARG(asn1buf *, buf), cleanup(); } -asn1_error_code asn1_decode_krb_safe_body(DECLARG(asn1buf *, buf), - DECLARG(krb5_safe *, val)) - OLDDECLARG(asn1buf *, buf) - OLDDECLARG(krb5_safe *, val) +asn1_error_code asn1_decode_krb_safe_body(buf, val) + asn1buf * buf; + krb5_safe * val; { setup(); { begin_structure(); @@ -460,10 +441,9 @@ asn1_error_code asn1_decode_krb_safe_body(DECLARG(asn1buf *, buf), cleanup(); } -asn1_error_code asn1_decode_host_address(DECLARG(asn1buf *, buf), - DECLARG(krb5_address *, val)) - OLDDECLARG(asn1buf *, buf) - OLDDECLARG(krb5_address *, val) +asn1_error_code asn1_decode_host_address(buf, val) + asn1buf * buf; + krb5_address * val; { setup(); { begin_structure(); @@ -475,10 +455,9 @@ asn1_error_code asn1_decode_host_address(DECLARG(asn1buf *, buf), cleanup(); } -asn1_error_code asn1_decode_kdc_rep(DECLARG(asn1buf *, buf), - DECLARG(krb5_kdc_rep *, val)) - OLDDECLARG(asn1buf *, buf) - OLDDECLARG(krb5_kdc_rep *, val) +asn1_error_code asn1_decode_kdc_rep(buf, val) + asn1buf * buf; + krb5_kdc_rep * val; { setup(); { begin_structure(); @@ -531,18 +510,16 @@ if(*(array) == NULL) return ENOMEM;\ cleanup() -asn1_error_code asn1_decode_authorization_data(DECLARG(asn1buf *, buf), - DECLARG(krb5_authdata ***, val)) - OLDDECLARG(asn1buf *, buf) - OLDDECLARG(krb5_authdata ***, val) +asn1_error_code asn1_decode_authorization_data(buf, val) + asn1buf * buf; + krb5_authdata *** val; { decode_array_body(krb5_authdata,asn1_decode_authdata_elt); } -asn1_error_code asn1_decode_authdata_elt(DECLARG(asn1buf *, buf), - DECLARG(krb5_authdata *, val)) - OLDDECLARG(asn1buf *, buf) - OLDDECLARG(krb5_authdata *, val) +asn1_error_code asn1_decode_authdata_elt(buf, val) + asn1buf * buf; + krb5_authdata * val; { setup(); { begin_structure(); @@ -554,34 +531,30 @@ asn1_error_code asn1_decode_authdata_elt(DECLARG(asn1buf *, buf), cleanup(); } -asn1_error_code asn1_decode_host_addresses(DECLARG(asn1buf *, buf), - DECLARG(krb5_address ***, val)) - OLDDECLARG(asn1buf *, buf) - OLDDECLARG(krb5_address ***, val) +asn1_error_code asn1_decode_host_addresses(buf, val) + asn1buf * buf; + krb5_address *** val; { decode_array_body(krb5_address,asn1_decode_host_address); } -asn1_error_code asn1_decode_sequence_of_ticket(DECLARG(asn1buf *, buf), - DECLARG(krb5_ticket ***, val)) - OLDDECLARG(asn1buf *, buf) - OLDDECLARG(krb5_ticket ***, val) +asn1_error_code asn1_decode_sequence_of_ticket(buf, val) + asn1buf * buf; + krb5_ticket *** val; { decode_array_body(krb5_ticket,asn1_decode_ticket); } -asn1_error_code asn1_decode_sequence_of_krb_cred_info(DECLARG(asn1buf *, buf), - DECLARG(krb5_cred_info ***, val)) - OLDDECLARG(asn1buf *, buf) - OLDDECLARG(krb5_cred_info ***, val) +asn1_error_code asn1_decode_sequence_of_krb_cred_info(buf, val) + 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(DECLARG(asn1buf *, buf), - DECLARG(krb5_cred_info *, val)) - OLDDECLARG(asn1buf *, buf) - OLDDECLARG(krb5_cred_info *, val) +asn1_error_code asn1_decode_krb_cred_info(buf, val) + asn1buf * buf; + krb5_cred_info * val; { setup(); { begin_structure(); @@ -607,18 +580,16 @@ asn1_error_code asn1_decode_krb_cred_info(DECLARG(asn1buf *, buf), cleanup(); } -asn1_error_code asn1_decode_sequence_of_pa_data(DECLARG(asn1buf *, buf), - DECLARG(krb5_pa_data ***, val)) - OLDDECLARG(asn1buf *, buf) - OLDDECLARG(krb5_pa_data ***, val) +asn1_error_code asn1_decode_sequence_of_pa_data(buf, val) + asn1buf * buf; + krb5_pa_data *** val; { decode_array_body(krb5_pa_data,asn1_decode_pa_data); } -asn1_error_code asn1_decode_pa_data(DECLARG(asn1buf *, buf), - DECLARG(krb5_pa_data *, val)) - OLDDECLARG(asn1buf *, buf) - OLDDECLARG(krb5_pa_data *, val) +asn1_error_code asn1_decode_pa_data(buf, val) + asn1buf * buf; + krb5_pa_data * val; { setup(); { begin_structure(); @@ -630,18 +601,16 @@ asn1_error_code asn1_decode_pa_data(DECLARG(asn1buf *, buf), cleanup(); } -asn1_error_code asn1_decode_last_req(DECLARG(asn1buf *, buf), - DECLARG(krb5_last_req_entry ***, val)) - OLDDECLARG(asn1buf *, buf) - OLDDECLARG(krb5_last_req_entry ***, val) +asn1_error_code asn1_decode_last_req(buf, val) + 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(DECLARG(asn1buf *, buf), - DECLARG(krb5_last_req_entry *, val)) - OLDDECLARG(asn1buf *, buf) - OLDDECLARG(krb5_last_req_entry *, val) +asn1_error_code asn1_decode_last_req_entry(buf, val) + asn1buf * buf; + krb5_last_req_entry * val; { setup(); { begin_structure(); @@ -653,12 +622,10 @@ asn1_error_code asn1_decode_last_req_entry(DECLARG(asn1buf *, buf), cleanup(); } -asn1_error_code asn1_decode_sequence_of_enctype(DECLARG(asn1buf *, buf), - DECLARG(int *, num), - DECLARG(krb5_enctype **, val)) - OLDDECLARG(asn1buf *, buf) - OLDDECLARG(int *, num) - OLDDECLARG(krb5_enctype **, val) +asn1_error_code asn1_decode_sequence_of_enctype(buf, num, val) + asn1buf * buf; + int * num; + krb5_enctype ** val; { asn1_error_code retval; { sequence_of(buf); @@ -678,10 +645,9 @@ asn1_error_code asn1_decode_sequence_of_enctype(DECLARG(asn1buf *, buf), cleanup(); } -asn1_error_code asn1_decode_passwdsequence(DECLARG(asn1buf *, buf), - DECLARG(passwd_phrase_element *, val)) - OLDDECLARG(asn1buf *, buf) - OLDDECLARG(passwd_phrase_element *, val) +asn1_error_code asn1_decode_passwdsequence(buf, val) + asn1buf * buf; + passwd_phrase_element * val; { setup(); { begin_structure(); @@ -696,10 +662,9 @@ asn1_error_code asn1_decode_passwdsequence(DECLARG(asn1buf *, buf), cleanup(); } -asn1_error_code asn1_decode_sequence_of_passwdsequence(DECLARG(asn1buf *, buf), - DECLARG(passwd_phrase_element ***, val)) - OLDDECLARG(asn1buf *, buf) - OLDDECLARG(passwd_phrase_element ***, val) +asn1_error_code asn1_decode_sequence_of_passwdsequence(buf, val) + asn1buf * buf; + passwd_phrase_element *** val; { decode_array_body(passwd_phrase_element,asn1_decode_passwdsequence); } diff --git a/src/lib/krb5/asn.1/asn1_encode.c b/src/lib/krb5/asn.1/asn1_encode.c index d5a933021..c03625e8c 100644 --- a/src/lib/krb5/asn.1/asn1_encode.c +++ b/src/lib/krb5/asn.1/asn1_encode.c @@ -26,12 +26,10 @@ #include "asn1_encode.h" #include "asn1_make.h" -asn1_error_code asn1_encode_integer(DECLARG(asn1buf *, buf), - DECLARG(const long , val), - DECLARG(int *, retlen)) - OLDDECLARG(asn1buf *, buf) - OLDDECLARG(const long , val) - OLDDECLARG(int *, retlen) +asn1_error_code asn1_encode_integer(buf, val, retlen) + asn1buf * buf; + const long val; + int * retlen; { asn1_error_code retval; int length = 0, partlen; @@ -65,12 +63,10 @@ asn1_error_code asn1_encode_integer(DECLARG(asn1buf *, buf), return 0; } -asn1_error_code asn1_encode_unsigned_integer(DECLARG(asn1buf *, buf), - DECLARG(const unsigned long , val), - DECLARG(int *, retlen)) - OLDDECLARG(asn1buf *, buf) - OLDDECLARG(const unsigned long , val) - OLDDECLARG(int *, retlen) +asn1_error_code asn1_encode_unsigned_integer(buf, val, retlen) + asn1buf * buf; + const unsigned long val; + int * retlen; { asn1_error_code retval; int length = 0, partlen; @@ -100,14 +96,11 @@ asn1_error_code asn1_encode_unsigned_integer(DECLARG(asn1buf *, buf), return 0; } -asn1_error_code asn1_encode_octetstring(DECLARG(asn1buf *, buf), - DECLARG(const int , len), - DECLARG(const asn1_octet *, val), - DECLARG(int *, retlen)) - OLDDECLARG(asn1buf *, buf) - OLDDECLARG(const int , len) - OLDDECLARG(const asn1_octet *, val) - OLDDECLARG(int *, retlen) +asn1_error_code asn1_encode_octetstring(buf, len, val, retlen) + asn1buf * buf; + const int len; + const asn1_octet * val; + int * retlen; { asn1_error_code retval; int length; @@ -121,14 +114,11 @@ asn1_error_code asn1_encode_octetstring(DECLARG(asn1buf *, buf), return 0; } -asn1_error_code asn1_encode_charstring(DECLARG(asn1buf *, buf), - DECLARG(const int , len), - DECLARG(const char *, val), - DECLARG(int *, retlen)) - OLDDECLARG(asn1buf *, buf) - OLDDECLARG(const int , len) - OLDDECLARG(const char *, val) - OLDDECLARG(int *, retlen) +asn1_error_code asn1_encode_charstring(buf, len, val, retlen) + asn1buf * buf; + const int len; + const char * val; + int * retlen; { asn1_error_code retval; int length; @@ -142,10 +132,9 @@ asn1_error_code asn1_encode_charstring(DECLARG(asn1buf *, buf), return 0; } -asn1_encode_null(DECLARG(asn1buf *, buf), - DECLARG(int *, retlen)) - OLDDECLARG(asn1buf *, buf) - OLDDECLARG(int *, retlen) +asn1_encode_null(buf, retlen) + asn1buf * buf; + int * retlen; { asn1_error_code retval; @@ -158,14 +147,11 @@ asn1_encode_null(DECLARG(asn1buf *, buf), return 0; } -asn1_error_code asn1_encode_printablestring(DECLARG(asn1buf *, buf), - DECLARG(const int , len), - DECLARG(const char *, val), - DECLARG(int *, retlen)) - OLDDECLARG(asn1buf *, buf) - OLDDECLARG(const int , len) - OLDDECLARG(const char *, val) - OLDDECLARG(int *, retlen) +asn1_error_code asn1_encode_printablestring(buf, len, val, retlen) + asn1buf * buf; + const int len; + const char * val; + int * retlen; { asn1_error_code retval; int length; @@ -179,14 +165,11 @@ asn1_error_code asn1_encode_printablestring(DECLARG(asn1buf *, buf), return 0; } -asn1_error_code asn1_encode_ia5string(DECLARG(asn1buf *, buf), - DECLARG(const int , len), - DECLARG(const char *, val), - DECLARG(int *, retlen)) - OLDDECLARG(asn1buf *, buf) - OLDDECLARG(const int , len) - OLDDECLARG(const char *, val) - OLDDECLARG(int *, retlen) +asn1_error_code asn1_encode_ia5string(buf, len, val, retlen) + asn1buf * buf; + const int len; + const char * val; + int * retlen; { asn1_error_code retval; int length; @@ -200,12 +183,10 @@ asn1_error_code asn1_encode_ia5string(DECLARG(asn1buf *, buf), return 0; } -asn1_error_code asn1_encode_generaltime(DECLARG(asn1buf *, buf), - DECLARG(const time_t , val), - DECLARG(int *, retlen)) - OLDDECLARG(asn1buf *, buf) - OLDDECLARG(const time_t , val) - OLDDECLARG(int *, retlen) +asn1_error_code asn1_encode_generaltime(buf, val, retlen) + asn1buf * buf; + const time_t val; + int * retlen; { asn1_error_code retval; struct tm *gtime = gmtime(&val); @@ -229,14 +210,11 @@ asn1_error_code asn1_encode_generaltime(DECLARG(asn1buf *, buf), return 0; } -asn1_error_code asn1_encode_generalstring(DECLARG(asn1buf *, buf), - DECLARG(const int , len), - DECLARG(const char *, val), - DECLARG(int *, retlen)) - OLDDECLARG(asn1buf *, buf) - OLDDECLARG(const int , len) - OLDDECLARG(const char *, val) - OLDDECLARG(int *, retlen) +asn1_error_code asn1_encode_generalstring(buf, len, val, retlen) + asn1buf * buf; + const int len; + const char * val; + int * retlen; { asn1_error_code retval; int length; diff --git a/src/lib/krb5/asn.1/asn1_encode_k.c b/src/lib/krb5/asn.1/asn1_encode_k.c index fe78062fc..b5e287189 100644 --- a/src/lib/krb5/asn.1/asn1_encode_k.c +++ b/src/lib/krb5/asn.1/asn1_encode_k.c @@ -130,24 +130,20 @@ asn1_error_code asn1_encode_ui_4(buf, val, retlen) } -asn1_error_code asn1_encode_realm(DECLARG(asn1buf *, buf), - DECLARG(const krb5_principal, val), - DECLARG(int *, retlen)) - OLDDECLARG(asn1buf *, buf) - OLDDECLARG(const krb5_principal, val) - OLDDECLARG(int *, retlen) +asn1_error_code asn1_encode_realm(buf, val, retlen) + asn1buf * buf; + const krb5_principal val; + int * retlen; { if(val == NULL || val->realm.data == NULL) return ASN1_MISSING_FIELD; return asn1_encode_generalstring(buf,val->realm.length,val->realm.data, retlen); } -asn1_error_code asn1_encode_principal_name(DECLARG(asn1buf *, buf), - DECLARG(const krb5_principal, val), - DECLARG(int *, retlen)) - OLDDECLARG(asn1buf *, buf) - OLDDECLARG(const krb5_principal, val) - OLDDECLARG(int *, retlen) +asn1_error_code asn1_encode_principal_name(buf, val, retlen) + asn1buf * buf; + const krb5_principal val; + int * retlen; { asn1_setup(); int n; @@ -175,24 +171,19 @@ asn1_error_code asn1_encode_principal_name(DECLARG(asn1buf *, buf), asn1_cleanup(); } -asn1_error_code asn1_encode_kerberos_time(DECLARG(asn1buf *, buf), - DECLARG(const krb5_timestamp, val), - DECLARG(int *, retlen)) - - OLDDECLARG(asn1buf *, buf) - OLDDECLARG(const krb5_timestamp, val) - OLDDECLARG(int *, retlen) +asn1_error_code asn1_encode_kerberos_time(buf, val, retlen) + asn1buf * buf; + const krb5_timestamp val; + int * retlen; { return asn1_encode_generaltime(buf,val,retlen); } -asn1_error_code asn1_encode_host_address(DECLARG(asn1buf *, buf), - DECLARG(const krb5_address *, val), - DECLARG(int *, retlen)) - OLDDECLARG(asn1buf *, buf) - OLDDECLARG(const krb5_address *, val) - OLDDECLARG(int *, retlen) +asn1_error_code asn1_encode_host_address(buf, val, retlen) + asn1buf * buf; + const krb5_address * val; + int * retlen; { asn1_setup(); @@ -205,12 +196,10 @@ asn1_error_code asn1_encode_host_address(DECLARG(asn1buf *, buf), asn1_cleanup(); } -asn1_error_code asn1_encode_host_addresses(DECLARG(asn1buf *, buf), - DECLARG(const krb5_address **, val), - DECLARG(int *, retlen)) - OLDDECLARG(asn1buf *, buf) - OLDDECLARG(const krb5_address **, val) - OLDDECLARG(int *, retlen) +asn1_error_code asn1_encode_host_addresses(buf, val, retlen) + asn1buf * buf; + const krb5_address ** val; + int * retlen; { asn1_setup(); int i; @@ -228,12 +217,10 @@ asn1_error_code asn1_encode_host_addresses(DECLARG(asn1buf *, buf), asn1_cleanup(); } -asn1_error_code asn1_encode_encrypted_data(DECLARG(asn1buf *, buf), - DECLARG(const krb5_enc_data *, val), - DECLARG(int *, retlen)) - OLDDECLARG(asn1buf *, buf) - OLDDECLARG(const krb5_enc_data *, val) - OLDDECLARG(int *, retlen) +asn1_error_code asn1_encode_encrypted_data(buf, val, retlen) + asn1buf * buf; + const krb5_enc_data * val; + int * retlen; { asn1_setup(); @@ -249,12 +236,10 @@ asn1_error_code asn1_encode_encrypted_data(DECLARG(asn1buf *, buf), asn1_cleanup(); } -asn1_error_code asn1_encode_krb5_flags(DECLARG(asn1buf *, buf), - DECLARG(const krb5_flags, val), - DECLARG(int *, retlen)) - OLDDECLARG(asn1buf *, buf) - OLDDECLARG(const krb5_flags, val) - OLDDECLARG(int *, retlen) +asn1_error_code asn1_encode_krb5_flags(buf, val, retlen) + asn1buf * buf; + const krb5_flags val; + int * retlen; { asn1_setup(); krb5_flags valcopy = val; @@ -278,42 +263,34 @@ asn1_error_code asn1_encode_krb5_flags(DECLARG(asn1buf *, buf), return 0; } -asn1_error_code asn1_encode_ap_options(DECLARG(asn1buf *, buf), - DECLARG(const krb5_flags, val), - DECLARG(int *, retlen)) - OLDDECLARG(asn1buf *, buf) - OLDDECLARG(const krb5_flags, val) - OLDDECLARG(int *, retlen) +asn1_error_code asn1_encode_ap_options(buf, val, retlen) + asn1buf * buf; + const krb5_flags val; + int * retlen; { return asn1_encode_krb5_flags(buf,val,retlen); } -asn1_error_code asn1_encode_ticket_flags(DECLARG(asn1buf *, buf), - DECLARG(const krb5_flags, val), - DECLARG(int *, retlen)) - OLDDECLARG(asn1buf *, buf) - OLDDECLARG(const krb5_flags, val) - OLDDECLARG(int *, retlen) +asn1_error_code asn1_encode_ticket_flags(buf, val, retlen) + asn1buf * buf; + const krb5_flags val; + int * retlen; { return asn1_encode_krb5_flags(buf,val,retlen); } -asn1_error_code asn1_encode_kdc_options(DECLARG(asn1buf *, buf), - DECLARG(const krb5_flags, val), - DECLARG(int *, retlen)) - OLDDECLARG(asn1buf *, buf) - OLDDECLARG(const krb5_flags, val) - OLDDECLARG(int *, retlen) +asn1_error_code asn1_encode_kdc_options(buf, val, retlen) + asn1buf * buf; + const krb5_flags val; + int * retlen; { return asn1_encode_krb5_flags(buf,val,retlen); } -asn1_error_code asn1_encode_authorization_data(DECLARG(asn1buf *, buf), - DECLARG(const krb5_authdata **, val), - DECLARG(int *, retlen)) - OLDDECLARG(asn1buf *, buf) - OLDDECLARG(const krb5_authdata **, val) - OLDDECLARG(int *, retlen) +asn1_error_code asn1_encode_authorization_data(buf, val, retlen) + asn1buf * buf; + const krb5_authdata ** val; + int * retlen; { asn1_setup(); int i; @@ -331,12 +308,10 @@ asn1_error_code asn1_encode_authorization_data(DECLARG(asn1buf *, buf), asn1_cleanup(); } -asn1_error_code asn1_encode_krb5_authdata_elt(DECLARG(asn1buf *, buf), - DECLARG(const krb5_authdata *, val), - DECLARG(int *, retlen)) - OLDDECLARG(asn1buf *, buf) - OLDDECLARG(const krb5_authdata *, val) - OLDDECLARG(int *, retlen) +asn1_error_code asn1_encode_krb5_authdata_elt(buf, val, retlen) + asn1buf * buf; + const krb5_authdata * val; + int * retlen; { asn1_setup(); @@ -352,14 +327,11 @@ asn1_error_code asn1_encode_krb5_authdata_elt(DECLARG(asn1buf *, buf), asn1_cleanup(); } -asn1_error_code asn1_encode_kdc_rep(DECLARG(int, msg_type), - DECLARG(asn1buf *, buf), - DECLARG(const krb5_kdc_rep *, val), - DECLARG(int *, retlen)) - OLDDECLARG(int, msg_type) - OLDDECLARG(asn1buf *, buf) - OLDDECLARG(const krb5_kdc_rep *, val) - OLDDECLARG(int *, retlen) +asn1_error_code asn1_encode_kdc_rep(msg_type, buf, val, retlen) + int msg_type; + asn1buf * buf; + const krb5_kdc_rep * val; + int * retlen; { asn1_setup(); @@ -380,12 +352,10 @@ asn1_error_code asn1_encode_kdc_rep(DECLARG(int, msg_type), asn1_cleanup(); } -asn1_error_code asn1_encode_enc_kdc_rep_part(DECLARG(asn1buf *, buf), - DECLARG(const krb5_enc_kdc_rep_part *, val), - DECLARG(int *, retlen)) - OLDDECLARG(asn1buf *, buf) - OLDDECLARG(const krb5_enc_kdc_rep_part *, val) - OLDDECLARG(int *, retlen) +asn1_error_code asn1_encode_enc_kdc_rep_part(buf, val, retlen) + asn1buf * buf; + const krb5_enc_kdc_rep_part * val; + int * retlen; { asn1_setup(); @@ -437,12 +407,10 @@ asn1_error_code asn1_encode_enc_kdc_rep_part(DECLARG(asn1buf *, buf), asn1_cleanup(); } -asn1_error_code asn1_encode_kdc_req_body(DECLARG(asn1buf *, buf), - DECLARG(const krb5_kdc_req *, rep), - DECLARG(int *, retlen)) - OLDDECLARG(asn1buf *, buf) - OLDDECLARG(const krb5_kdc_req *, rep) - OLDDECLARG(int *, retlen) +asn1_error_code asn1_encode_kdc_req_body(buf, rep, retlen) + asn1buf * buf; + const krb5_kdc_req * rep; + int * retlen; { asn1_setup(); @@ -508,12 +476,10 @@ asn1_error_code asn1_encode_kdc_req_body(DECLARG(asn1buf *, buf), asn1_cleanup(); } -asn1_error_code asn1_encode_encryption_key(DECLARG(asn1buf *, buf), - DECLARG(const krb5_keyblock *, val), - DECLARG(int *, retlen)) - OLDDECLARG(asn1buf *, buf) - OLDDECLARG(const krb5_keyblock *, val) - OLDDECLARG(int *, retlen) +asn1_error_code asn1_encode_encryption_key(buf, val, retlen) + asn1buf * buf; + const krb5_keyblock * val; + int * retlen; { asn1_setup(); @@ -526,12 +492,10 @@ asn1_error_code asn1_encode_encryption_key(DECLARG(asn1buf *, buf), asn1_cleanup(); } -asn1_error_code asn1_encode_checksum(DECLARG(asn1buf *, buf), - DECLARG(const krb5_checksum *, val), - DECLARG(int *, retlen)) - OLDDECLARG(asn1buf *, buf) - OLDDECLARG(const krb5_checksum *, val) - OLDDECLARG(int *, retlen) +asn1_error_code asn1_encode_checksum(buf, val, retlen) + asn1buf * buf; + const krb5_checksum * val; + int * retlen; { asn1_setup(); @@ -544,12 +508,10 @@ asn1_error_code asn1_encode_checksum(DECLARG(asn1buf *, buf), asn1_cleanup(); } -asn1_error_code asn1_encode_transited_encoding(DECLARG(asn1buf *, buf), - DECLARG(const krb5_transited *, val), - DECLARG(int *, retlen)) - OLDDECLARG(asn1buf *, buf) - OLDDECLARG(const krb5_transited *, val) - OLDDECLARG(int *, retlen) +asn1_error_code asn1_encode_transited_encoding(buf, val, retlen) + asn1buf * buf; + const krb5_transited * val; + int * retlen; { asn1_setup(); @@ -565,12 +527,10 @@ asn1_error_code asn1_encode_transited_encoding(DECLARG(asn1buf *, buf), asn1_cleanup(); } -asn1_error_code asn1_encode_last_req(DECLARG(asn1buf *, buf), - DECLARG(const krb5_last_req_entry **, val), - DECLARG(int *, retlen)) - OLDDECLARG(asn1buf *, buf) - OLDDECLARG(const krb5_last_req_entry **, val) - OLDDECLARG(int *, retlen) +asn1_error_code asn1_encode_last_req(buf, val, retlen) + asn1buf * buf; + const krb5_last_req_entry ** val; + int * retlen; { asn1_setup(); int i; @@ -588,12 +548,10 @@ asn1_error_code asn1_encode_last_req(DECLARG(asn1buf *, buf), asn1_cleanup(); } -asn1_error_code asn1_encode_last_req_entry(DECLARG(asn1buf *, buf), - DECLARG(const krb5_last_req_entry *, val), - DECLARG(int *, retlen)) - OLDDECLARG(asn1buf *, buf) - OLDDECLARG(const krb5_last_req_entry *, val) - OLDDECLARG(int *, retlen) +asn1_error_code asn1_encode_last_req_entry(buf, val, retlen) + asn1buf * buf; + const krb5_last_req_entry * val; + int * retlen; { asn1_setup(); @@ -606,12 +564,10 @@ asn1_error_code asn1_encode_last_req_entry(DECLARG(asn1buf *, buf), asn1_cleanup(); } -asn1_error_code asn1_encode_sequence_of_pa_data(DECLARG(asn1buf *, buf), - DECLARG(const krb5_pa_data **, val), - DECLARG(int *, retlen)) - OLDDECLARG(asn1buf *, buf) - OLDDECLARG(const krb5_pa_data **, val) - OLDDECLARG(int *, retlen) +asn1_error_code asn1_encode_sequence_of_pa_data(buf, val, retlen) + asn1buf * buf; + const krb5_pa_data ** val; + int * retlen; { asn1_setup(); int i; @@ -629,12 +585,10 @@ asn1_error_code asn1_encode_sequence_of_pa_data(DECLARG(asn1buf *, buf), asn1_cleanup(); } -asn1_error_code asn1_encode_pa_data(DECLARG(asn1buf *, buf), - DECLARG(const krb5_pa_data *, val), - DECLARG(int *, retlen)) - OLDDECLARG(asn1buf *, buf) - OLDDECLARG(const krb5_pa_data *, val) - OLDDECLARG(int *, retlen) +asn1_error_code asn1_encode_pa_data(buf, val, retlen) + asn1buf * buf; + const krb5_pa_data * val; + int * retlen; { asn1_setup(); @@ -648,12 +602,10 @@ asn1_error_code asn1_encode_pa_data(DECLARG(asn1buf *, buf), asn1_cleanup(); } -asn1_error_code asn1_encode_sequence_of_ticket(DECLARG(asn1buf *, buf), - DECLARG(const krb5_ticket **, val), - DECLARG(int *, retlen)) - OLDDECLARG(asn1buf *, buf) - OLDDECLARG(const krb5_ticket **, val) - OLDDECLARG(int *, retlen) +asn1_error_code asn1_encode_sequence_of_ticket(buf, val, retlen) + asn1buf * buf; + const krb5_ticket ** val; + int * retlen; { asn1_setup(); int i; @@ -671,12 +623,10 @@ asn1_error_code asn1_encode_sequence_of_ticket(DECLARG(asn1buf *, buf), asn1_cleanup(); } -asn1_error_code asn1_encode_ticket(DECLARG(asn1buf *, buf), - DECLARG(const krb5_ticket *, val), - DECLARG(int *, retlen)) - OLDDECLARG(asn1buf *, buf) - OLDDECLARG(const krb5_ticket *, val) - OLDDECLARG(int *, retlen) +asn1_error_code asn1_encode_ticket(buf, val, retlen) + asn1buf * buf; + const krb5_ticket * val; + int * retlen; { asn1_setup(); @@ -692,14 +642,11 @@ asn1_error_code asn1_encode_ticket(DECLARG(asn1buf *, buf), asn1_cleanup(); } -asn1_error_code asn1_encode_sequence_of_enctype(DECLARG(asn1buf *, buf), - DECLARG(const int, len), - DECLARG(const krb5_enctype *, val), - DECLARG(int *, retlen)) - OLDDECLARG(asn1buf *, buf) - OLDDECLARG(const int, len) - OLDDECLARG(const krb5_enctype *, val) - OLDDECLARG(int *, retlen) +asn1_error_code asn1_encode_sequence_of_enctype(buf, len, val, retlen) + asn1buf * buf; + const int len; + const krb5_enctype * val; + int * retlen; { asn1_setup(); int i; @@ -716,14 +663,11 @@ asn1_error_code asn1_encode_sequence_of_enctype(DECLARG(asn1buf *, buf), asn1_cleanup(); } -asn1_error_code asn1_encode_kdc_req(DECLARG(int, msg_type), - DECLARG(asn1buf *, buf), - DECLARG(const krb5_kdc_req *, val), - DECLARG(int *, retlen)) - OLDDECLARG(int, msg_type) - OLDDECLARG(asn1buf *, buf) - OLDDECLARG(const krb5_kdc_req *, val) - OLDDECLARG(int *, retlen) +asn1_error_code asn1_encode_kdc_req(msg_type, buf, val, retlen) + int msg_type; + asn1buf * buf; + const krb5_kdc_req * val; + int * retlen; { asn1_setup(); @@ -741,12 +685,10 @@ asn1_error_code asn1_encode_kdc_req(DECLARG(int, msg_type), asn1_cleanup(); } -asn1_error_code asn1_encode_krb_safe_body(DECLARG(asn1buf *, buf), - DECLARG(const krb5_safe *, val), - DECLARG(int *, retlen)) - OLDDECLARG(asn1buf *, buf) - OLDDECLARG(const krb5_safe *, val) - OLDDECLARG(int *, retlen) +asn1_error_code asn1_encode_krb_safe_body(buf, val, retlen) + asn1buf * buf; + const krb5_safe * val; + int * retlen; { asn1_setup(); @@ -769,12 +711,10 @@ asn1_error_code asn1_encode_krb_safe_body(DECLARG(asn1buf *, buf), asn1_cleanup(); } -asn1_error_code asn1_encode_sequence_of_krb_cred_info(DECLARG(asn1buf *, buf), - DECLARG(const krb5_cred_info **, val), - DECLARG(int *, retlen)) - OLDDECLARG(asn1buf *, buf) - OLDDECLARG(const krb5_cred_info **, val) - OLDDECLARG(int *, retlen) +asn1_error_code asn1_encode_sequence_of_krb_cred_info(buf, val, retlen) + asn1buf * buf; + const krb5_cred_info ** val; + int * retlen; { asn1_setup(); int i; @@ -792,12 +732,10 @@ asn1_error_code asn1_encode_sequence_of_krb_cred_info(DECLARG(asn1buf *, buf), asn1_cleanup(); } -asn1_error_code asn1_encode_krb_cred_info(DECLARG(asn1buf *, buf), - DECLARG(const krb5_cred_info *, val), - DECLARG(int *, retlen)) - OLDDECLARG(asn1buf *, buf) - OLDDECLARG(const krb5_cred_info *, val) - OLDDECLARG(int *, retlen) +asn1_error_code asn1_encode_krb_cred_info(buf, val, retlen) + asn1buf * buf; + const krb5_cred_info * val; + int * retlen; { asn1_setup(); @@ -830,12 +768,10 @@ asn1_error_code asn1_encode_krb_cred_info(DECLARG(asn1buf *, buf), asn1_cleanup(); } -asn1_error_code asn1_encode_sequence_of_passwdsequence(DECLARG(asn1buf *, buf), - DECLARG(const passwd_phrase_element **, val), - DECLARG(int *, retlen)) - OLDDECLARG(asn1buf *,buf) - OLDDECLARG(const passwd_phrase_element **, val) - OLDDECLARG(int *, retlen) +asn1_error_code asn1_encode_sequence_of_passwdsequence(buf, val, retlen) + asn1buf * buf; + const passwd_phrase_element ** val; + int * retlen; { asn1_setup(); int i; @@ -852,12 +788,10 @@ asn1_error_code asn1_encode_sequence_of_passwdsequence(DECLARG(asn1buf *, buf), asn1_cleanup(); } -asn1_error_code asn1_encode_passwdsequence(DECLARG(asn1buf *, buf), - DECLARG(const passwd_phrase_element *, val), - DECLARG(int *, retlen)) - OLDDECLARG(asn1buf *,buf) - OLDDECLARG(const passwd_phrase_element *, val) - OLDDECLARG(int *, retlen) +asn1_error_code asn1_encode_passwdsequence(buf, val, retlen) + asn1buf * buf; + const passwd_phrase_element * val; + int * retlen; { asn1_setup(); asn1_addlenfield(val->phrase->length,val->phrase->data,1,asn1_encode_charstring); diff --git a/src/lib/krb5/asn.1/asn1_get.c b/src/lib/krb5/asn.1/asn1_get.c index f75f67aae..12935e762 100644 --- a/src/lib/krb5/asn.1/asn1_get.c +++ b/src/lib/krb5/asn.1/asn1_get.c @@ -23,16 +23,12 @@ #include "asn1_get.h" -asn1_error_code asn1_get_tag(DECLARG(asn1buf *, buf), - DECLARG(asn1_class *, class), - DECLARG(asn1_construction *, construction), - DECLARG(asn1_tagnum *, tagnum), - DECLARG(int *, retlen)) - OLDDECLARG(asn1buf *, buf) - OLDDECLARG(asn1_class *, class) - OLDDECLARG(asn1_construction *, construction) - OLDDECLARG(asn1_tagnum *, tagnum) - OLDDECLARG(int *, retlen) +asn1_error_code asn1_get_tag(buf, class, construction, tagnum, retlen) + asn1buf * buf; + asn1_class * class; + asn1_construction * construction; + asn1_tagnum * tagnum; + int * retlen; { asn1_error_code retval; @@ -47,10 +43,9 @@ asn1_error_code asn1_get_tag(DECLARG(asn1buf *, buf), return 0; } -asn1_error_code asn1_get_sequence(DECLARG(asn1buf *, buf), - DECLARG(int *, retlen)) - OLDDECLARG(asn1buf *, buf) - OLDDECLARG(int *, retlen) +asn1_error_code asn1_get_sequence(buf, retlen) + asn1buf * buf; + int * retlen; { asn1_error_code retval; asn1_class class; @@ -68,14 +63,11 @@ asn1_error_code asn1_get_sequence(DECLARG(asn1buf *, buf), /****************************************************************/ /* Private Procedures */ -asn1_error_code asn1_get_id(DECLARG(asn1buf *, buf), - DECLARG(asn1_class *, class), - DECLARG(asn1_construction *, construction), - DECLARG(asn1_tagnum *, tagnum)) - OLDDECLARG(asn1buf *, buf) - OLDDECLARG(asn1_class *, class) - OLDDECLARG(asn1_construction *, construction) - OLDDECLARG(asn1_tagnum *, tagnum) +asn1_error_code asn1_get_id(buf, class, construction, tagnum) + asn1buf * buf; + asn1_class * class; + asn1_construction * construction; + asn1_tagnum * tagnum; { asn1_error_code retval; asn1_tagnum tn=0; @@ -107,10 +99,9 @@ asn1_error_code asn1_get_id(DECLARG(asn1buf *, buf), return 0; } -asn1_error_code asn1_get_length(DECLARG(asn1buf *, buf), - DECLARG(int *, retlen)) - OLDDECLARG(asn1buf *, buf) - OLDDECLARG(int *, retlen) +asn1_error_code asn1_get_length(buf, retlen) + asn1buf * buf; + int * retlen; { asn1_error_code retval; asn1_octet o; diff --git a/src/lib/krb5/asn.1/asn1_make.c b/src/lib/krb5/asn.1/asn1_make.c index 786bba0f8..09ca3d060 100644 --- a/src/lib/krb5/asn.1/asn1_make.c +++ b/src/lib/krb5/asn.1/asn1_make.c @@ -23,32 +23,23 @@ #include "asn1_make.h" -asn1_error_code asn1_make_etag(DECLARG(asn1buf *, buf), - DECLARG(const asn1_class , class), - DECLARG(const asn1_tagnum , tagnum), - DECLARG(const int , in_len), - DECLARG(int *, retlen)) - OLDDECLARG(asn1buf *, buf) - OLDDECLARG(const asn1_class , class) - OLDDECLARG(const asn1_tagnum , tagnum) - OLDDECLARG(const int , in_len) - OLDDECLARG(int *, retlen) +asn1_error_code asn1_make_etag(buf, class, tagnum, in_len, retlen) + asn1buf * buf; + const asn1_class class; + const asn1_tagnum tagnum; + const int in_len; + int * retlen; { return asn1_make_tag(buf,class,CONSTRUCTED,tagnum,in_len,retlen); } -asn1_error_code asn1_make_tag(DECLARG(asn1buf *, buf), - DECLARG(const asn1_class , class), - DECLARG(const asn1_construction , construction), - DECLARG(const asn1_tagnum , tagnum), - DECLARG(const int , in_len), - DECLARG(int *, retlen)) - OLDDECLARG(asn1buf *, buf) - OLDDECLARG(const asn1_class , class) - OLDDECLARG(const asn1_construction , construction) - OLDDECLARG(const asn1_tagnum , tagnum) - OLDDECLARG(const int , in_len) - OLDDECLARG(int *, 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 int in_len; + int * retlen; { asn1_error_code retval; int sumlen=0, length; @@ -66,12 +57,10 @@ asn1_error_code asn1_make_tag(DECLARG(asn1buf *, buf), return 0; } -asn1_error_code asn1_make_length(DECLARG(asn1buf *, buf), - DECLARG(const int , in_len), - DECLARG(int *, retlen)) - OLDDECLARG(asn1buf *, buf) - OLDDECLARG(const int , in_len) - OLDDECLARG(int *, retlen) +asn1_error_code asn1_make_length(buf, in_len, retlen) + asn1buf * buf; + const int in_len; + int * retlen; { asn1_error_code retval; @@ -97,16 +86,12 @@ asn1_error_code asn1_make_length(DECLARG(asn1buf *, buf), return 0; } -asn1_error_code asn1_make_id(DECLARG(asn1buf *, buf), - DECLARG(const asn1_class , class), - DECLARG(const asn1_construction , construction), - DECLARG(const asn1_tagnum , tagnum), - DECLARG(int *, retlen)) - OLDDECLARG(asn1buf *, buf) - OLDDECLARG(const asn1_class , class) - OLDDECLARG(const asn1_construction , construction) - OLDDECLARG(const asn1_tagnum , tagnum) - OLDDECLARG(int *, retlen) +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; + int * retlen; { asn1_error_code retval; @@ -139,12 +124,10 @@ asn1_error_code asn1_make_id(DECLARG(asn1buf *, buf), return 0; } -asn1_error_code asn1_make_sequence(DECLARG(asn1buf *, buf), - DECLARG(const int , seq_len), - DECLARG(int *, retlen)) - OLDDECLARG(asn1buf *, buf) - OLDDECLARG(const int , seq_len) - OLDDECLARG(int *, retlen) +asn1_error_code asn1_make_sequence(buf, seq_len, retlen) + asn1buf * buf; + const int seq_len; + int * retlen; { asn1_error_code retval; int len, sum=0; @@ -160,12 +143,10 @@ asn1_error_code asn1_make_sequence(DECLARG(asn1buf *, buf), return 0; } -asn1_error_code asn1_make_set(DECLARG(asn1buf *, buf), - DECLARG(const int , set_len), - DECLARG(int *, retlen)) - OLDDECLARG(asn1buf *, buf) - OLDDECLARG(const int , set_len) - OLDDECLARG(int *, retlen) +asn1_error_code asn1_make_set(buf, set_len, retlen) + asn1buf * buf; + const int set_len; + int * retlen; { asn1_error_code retval; int len, sum=0; @@ -181,14 +162,11 @@ asn1_error_code asn1_make_set(DECLARG(asn1buf *, buf), return 0; } -asn1_error_code asn1_make_string(DECLARG(asn1buf *, buf), - DECLARG(const int , length), - DECLARG(const char *, string), - DECLARG(int *, retlen)) - OLDDECLARG(asn1buf *, buf) - OLDDECLARG(const int , length) - OLDDECLARG(const char *, string) - OLDDECLARG(int *, retlen) +asn1_error_code asn1_make_string(buf, length, string, retlen) + asn1buf * buf; + const int length; + const char * string; + int * retlen; { asn1_error_code retval; diff --git a/src/lib/krb5/asn.1/asn1_misc.c b/src/lib/krb5/asn.1/asn1_misc.c index fec965096..83fbdbe62 100644 --- a/src/lib/krb5/asn.1/asn1_misc.c +++ b/src/lib/krb5/asn.1/asn1_misc.c @@ -23,10 +23,9 @@ #include "asn1_misc.h" -asn1_error_code asn1_krb5_realm_copy(DECLARG(krb5_principal, target), - DECLARG(krb5_principal, source)) - OLDDECLARG(krb5_principal, target) - OLDDECLARG(krb5_principal, source) +asn1_error_code asn1_krb5_realm_copy(target, source) + krb5_principal target; + krb5_principal source; { target->realm.length = source->realm.length; target->realm.data = (char*)calloc(target->realm.length, diff --git a/src/lib/krb5/asn.1/asn1buf.c b/src/lib/krb5/asn.1/asn1buf.c index 81c7df309..61ddaad34 100644 --- a/src/lib/krb5/asn.1/asn1buf.c +++ b/src/lib/krb5/asn.1/asn1buf.c @@ -51,8 +51,8 @@ #include "asn1buf.h" #include -asn1_error_code asn1buf_create(DECLARG(asn1buf **, buf)) - OLDDECLARG(asn1buf **, buf) +asn1_error_code asn1buf_create(buf) + asn1buf ** buf; { *buf = (asn1buf*)calloc(1,sizeof(asn1buf)); if (*buf == NULL) return ENOMEM; @@ -62,10 +62,9 @@ asn1_error_code asn1buf_create(DECLARG(asn1buf **, buf)) return 0; } -asn1_error_code asn1buf_wrap_data(DECLARG(asn1buf *, buf), - DECLARG(const krb5_data *, code)) - OLDDECLARG(asn1buf *, buf) - OLDDECLARG(const krb5_data *, code) +asn1_error_code asn1buf_wrap_data(buf, code) + asn1buf * buf; + const krb5_data * code; { if(code == NULL || code->data == NULL) return ASN1_MISSING_FIELD; buf->next = buf->base = code->data; @@ -73,12 +72,10 @@ asn1_error_code asn1buf_wrap_data(DECLARG(asn1buf *, buf), return 0; } -asn1_error_code asn1buf_imbed(DECLARG(asn1buf *, subbuf), - DECLARG(const asn1buf *, buf), - DECLARG(const int , length)) - OLDDECLARG(asn1buf *, subbuf) - OLDDECLARG(const asn1buf *, buf) - OLDDECLARG(const int , length) +asn1_error_code asn1buf_imbed(subbuf, buf, length) + asn1buf * subbuf; + const asn1buf * buf; + const int length; { subbuf->base = subbuf->next = buf->next; subbuf->bound = subbuf->base + length - 1; @@ -86,16 +83,15 @@ asn1_error_code asn1buf_imbed(DECLARG(asn1buf *, subbuf), return 0; } -void asn1buf_sync(DECLARG(asn1buf *, buf), - DECLARG(asn1buf *, subbuf)) - OLDDECLARG(asn1buf *, buf) - OLDDECLARG(asn1buf *, subbuf) +void asn1buf_sync(buf, subbuf) + asn1buf * buf; + asn1buf * subbuf; { buf->next = subbuf->next; } -asn1_error_code asn1buf_destroy(DECLARG(asn1buf **, buf)) - OLDDECLARG(asn1buf **, buf) +asn1_error_code asn1buf_destroy(buf) + asn1buf ** buf; { if (*buf != NULL) { if ((*buf)->base != NULL) free((*buf)->base); @@ -105,10 +101,9 @@ asn1_error_code asn1buf_destroy(DECLARG(asn1buf **, buf)) return 0; } -asn1_error_code asn1buf_insert_octet(DECLARG(asn1buf *, buf), - DECLARG(const asn1_octet , o)) - OLDDECLARG(asn1buf *, buf) - OLDDECLARG(const asn1_octet , o) +asn1_error_code asn1buf_insert_octet(buf, o) + asn1buf * buf; + const asn1_octet o; { asn1_error_code retval; @@ -119,12 +114,10 @@ asn1_error_code asn1buf_insert_octet(DECLARG(asn1buf *, buf), return 0; } -asn1_error_code asn1buf_insert_octetstring(DECLARG(asn1buf *, buf), - DECLARG(const int , len), - DECLARG(const krb5_octet *, s)) - OLDDECLARG(asn1buf *, buf) - OLDDECLARG(const int , len) - OLDDECLARG(const krb5_octet *, s) +asn1_error_code asn1buf_insert_octetstring(buf, len, s) + asn1buf * buf; + const int len; + const krb5_octet * s; { asn1_error_code retval; int length; @@ -136,12 +129,10 @@ asn1_error_code asn1buf_insert_octetstring(DECLARG(asn1buf *, buf), return 0; } -asn1_error_code asn1buf_insert_charstring(DECLARG(asn1buf *, buf), - DECLARG(const int , len), - DECLARG(const char *, s)) - OLDDECLARG(asn1buf *, buf) - OLDDECLARG(const int , len) - OLDDECLARG(const char *, s) +asn1_error_code asn1buf_insert_charstring(buf, len, s) + asn1buf * buf; + const int len; + const char * s; { asn1_error_code retval; int length; @@ -153,22 +144,19 @@ asn1_error_code asn1buf_insert_charstring(DECLARG(asn1buf *, buf), return 0; } -asn1_error_code asn1buf_remove_octet(DECLARG(asn1buf *, buf), - DECLARG(asn1_octet *, o)) - OLDDECLARG(asn1buf *, buf) - OLDDECLARG(asn1_octet *, o) +asn1_error_code asn1buf_remove_octet(buf, o) + 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(DECLARG(asn1buf *, buf), - DECLARG(const int , len), - DECLARG(asn1_octet **, s)) - OLDDECLARG(asn1buf *, buf) - OLDDECLARG(const int , len) - OLDDECLARG(asn1_octet **, s) +asn1_error_code asn1buf_remove_octetstring(buf, len, s) + asn1buf * buf; + const int len; + asn1_octet ** s; { int i; @@ -186,12 +174,10 @@ asn1_error_code asn1buf_remove_octetstring(DECLARG(asn1buf *, buf), return 0; } -asn1_error_code asn1buf_remove_charstring(DECLARG(asn1buf *, buf), - DECLARG(const int , len), - DECLARG(char **, s)) - OLDDECLARG(asn1buf *, buf) - OLDDECLARG(const int , len) - OLDDECLARG(char **, s) +asn1_error_code asn1buf_remove_charstring(buf, len, s) + asn1buf * buf; + const int len; + char ** s; { int i; @@ -208,17 +194,16 @@ asn1_error_code asn1buf_remove_charstring(DECLARG(asn1buf *, buf), return 0; } -int asn1buf_remains(DECLARG(const asn1buf *, buf)) - OLDDECLARG(const asn1buf *, buf) +int asn1buf_remains(buf) + const asn1buf * buf; { if(buf == NULL || buf->base == NULL) return 0; else return buf->bound - buf->next + 1; } -asn1_error_code asn12krb5_buf(DECLARG(const asn1buf *, buf), - DECLARG(krb5_data **, code)) - OLDDECLARG(const asn1buf *, buf) - OLDDECLARG(krb5_data **, code) +asn1_error_code asn12krb5_buf(buf, code) + const asn1buf * buf; + krb5_data ** code; { int i; *code = (krb5_data*)calloc(1,sizeof(krb5_data)); @@ -238,10 +223,9 @@ asn1_error_code asn12krb5_buf(DECLARG(const asn1buf *, buf), /* 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(DECLARG(const asn1buf *, buf), - DECLARG(char **, s)) - OLDDECLARG(const asn1buf *, buf) - OLDDECLARG(char **, s) +asn1_error_code asn1buf_unparse(buf, s) + const asn1buf * buf; + char ** s; { if(*s != NULL) free(*s); if(buf == NULL){ @@ -259,16 +243,15 @@ asn1_error_code asn1buf_unparse(DECLARG(const asn1buf *, buf), *s = calloc(length+1, sizeof(char)); if(*s == NULL) return ENOMEM; (*s)[length] = '\0'; - for(i=0; ibase)[length-i-1]) + for(i=0; ibase)[length-i-1]) */ } return 0; } -asn1_error_code asn1buf_hex_unparse(DECLARG(const asn1buf *, buf), - DECLARG(char **, s)) - OLDDECLARG(const asn1buf *, buf) - OLDDECLARG(char **, s) +asn1_error_code asn1buf_hex_unparse(buf, s) + const asn1buf * buf; + char ** s; { #define hexchar(d) ((d)<=9 ? ('0'+(d)) :\ ((d)<=15 ? ('A'+(d)-10) :\ @@ -303,24 +286,23 @@ asn1_error_code asn1buf_hex_unparse(DECLARG(const asn1buf *, buf), /****************************************************************/ /* Private Procedures */ -int asn1buf_size(DECLARG(const asn1buf *, buf)) - OLDDECLARG(const asn1buf *, buf) +int asn1buf_size(buf) + const asn1buf * buf; { if(buf == NULL || buf->base == NULL) return 0; return buf->bound - buf->base + 1; } -int asn1buf_free(DECLARG(const asn1buf *, buf)) - OLDDECLARG(const asn1buf *, buf) +int asn1buf_free(buf) + const asn1buf * buf; { if(buf == NULL || buf->base == NULL) return 0; else return buf->bound - buf->next + 1; } -asn1_error_code asn1buf_ensure_space(DECLARG(asn1buf *, buf), - DECLARG(const int , amount)) - OLDDECLARG(asn1buf *, buf) - OLDDECLARG(const int , amount) +asn1_error_code asn1buf_ensure_space(buf, amount) + asn1buf * buf; + const int amount; { int free = asn1buf_free(buf); if(free < amount){ @@ -330,10 +312,9 @@ asn1_error_code asn1buf_ensure_space(DECLARG(asn1buf *, buf), return 0; } -asn1_error_code asn1buf_expand(DECLARG(asn1buf *, buf), - DECLARG(const int , inc)) - OLDDECLARG(asn1buf *, buf) - OLDDECLARG(const int , inc) +asn1_error_code asn1buf_expand(buf, inc) + asn1buf * buf; + const int inc; { #define STANDARD_INCREMENT 200 int next_offset = buf->next - buf->base; @@ -356,8 +337,8 @@ asn1_error_code asn1buf_expand(DECLARG(asn1buf *, buf), return 0; } -int asn1buf_len(DECLARG(const asn1buf *, buf)) - OLDDECLARG(const asn1buf *, buf) +int asn1buf_len(buf) + const asn1buf * buf; { return buf->next - buf->base; } diff --git a/src/lib/krb5/asn.1/kkdcr2kdcr.c b/src/lib/krb5/asn.1/kkdcr2kdcr.c index f6204b5fb..807ab094b 100644 --- a/src/lib/krb5/asn.1/kkdcr2kdcr.c +++ b/src/lib/krb5/asn.1/kkdcr2kdcr.c @@ -87,10 +87,9 @@ struct element_KRB5_11 *krb5_pa_data2element_KRB5_11(val, error) } struct type_KRB5_TGS__REP * -krb5_kdc_rep2KRB5_KDC__REP(DECLARG(register const krb5_kdc_rep *,val), - DECLARG(register int *,error)) -OLDDECLARG(register const krb5_kdc_rep *,val) -OLDDECLARG(register int *,error) +krb5_kdc_rep2KRB5_KDC__REP(val, error) + register const krb5_kdc_rep * val; + register int * error; { register struct type_KRB5_TGS__REP *retval; diff --git a/src/lib/krb5/asn.1/krb5_decode.c b/src/lib/krb5/asn.1/krb5_decode.c index db0ca1966..f94914550 100644 --- a/src/lib/krb5/asn.1/krb5_decode.c +++ b/src/lib/krb5/asn.1/krb5_decode.c @@ -147,10 +147,9 @@ if(tagnum == (tagexpect)){\ #define cleanup()\ return 0 -krb5_error_code decode_krb5_authenticator(DECLARG(const krb5_data *, code), - DECLARG(krb5_authenticator **, rep)) - OLDDECLARG(const krb5_data *, code) - OLDDECLARG(krb5_authenticator **, rep) +krb5_error_code decode_krb5_authenticator(code, rep) + const krb5_data * code; + krb5_authenticator ** rep; { setup(); alloc_field(*rep,krb5_authenticator); @@ -177,10 +176,9 @@ krb5_error_code decode_krb5_authenticator(DECLARG(const krb5_data *, code), cleanup(); } -krb5_error_code decode_krb5_ticket(DECLARG(const krb5_data *, code), - DECLARG(krb5_ticket **, rep)) - OLDDECLARG(const krb5_data *, code) - OLDDECLARG(krb5_ticket **, rep) +krb5_error_code decode_krb5_ticket(code, rep) + const krb5_data * code; + krb5_ticket ** rep; { setup(); alloc_field(*rep,krb5_ticket); @@ -200,10 +198,9 @@ krb5_error_code decode_krb5_ticket(DECLARG(const krb5_data *, code), cleanup(); } -krb5_error_code decode_krb5_encryption_key(DECLARG(const krb5_data *, code), - DECLARG(krb5_keyblock **, rep)) - OLDDECLARG(const krb5_data *, code) - OLDDECLARG(krb5_keyblock **, rep) +krb5_error_code decode_krb5_encryption_key(code, rep) + const krb5_data * code; + krb5_keyblock ** rep; { setup(); alloc_field(*rep,krb5_keyblock); @@ -218,10 +215,9 @@ krb5_error_code decode_krb5_encryption_key(DECLARG(const krb5_data *, code), cleanup(); } -krb5_error_code decode_krb5_enc_tkt_part(DECLARG(const krb5_data *, code), - DECLARG(krb5_enc_tkt_part **, rep)) - OLDDECLARG(const krb5_data *, code) - OLDDECLARG(krb5_enc_tkt_part **, rep) +krb5_error_code decode_krb5_enc_tkt_part(code, rep) + const krb5_data * code; + krb5_enc_tkt_part ** rep; { setup(); alloc_field(*rep,krb5_enc_tkt_part); @@ -246,10 +242,9 @@ krb5_error_code decode_krb5_enc_tkt_part(DECLARG(const krb5_data *, code), cleanup(); } -krb5_error_code decode_krb5_enc_kdc_rep_part(DECLARG(const krb5_data *, code), - DECLARG(krb5_enc_kdc_rep_part **, rep)) - OLDDECLARG(const krb5_data *, code) - OLDDECLARG(krb5_enc_kdc_rep_part **, rep) +krb5_error_code decode_krb5_enc_kdc_rep_part(code, rep) + const krb5_data * code; + krb5_enc_kdc_rep_part ** rep; { setup_no_length(); alloc_field(*rep,krb5_enc_kdc_rep_part); @@ -267,10 +262,9 @@ krb5_error_code decode_krb5_enc_kdc_rep_part(DECLARG(const krb5_data *, code), cleanup(); } -krb5_error_code decode_krb5_as_rep(DECLARG(const krb5_data *, code), - DECLARG(krb5_kdc_rep **, rep)) - OLDDECLARG(const krb5_data *, code) - OLDDECLARG(krb5_kdc_rep **, rep) +krb5_error_code decode_krb5_as_rep(code, rep) + const krb5_data * code; + krb5_kdc_rep ** rep; { setup_no_length(); alloc_field(*rep,krb5_kdc_rep); @@ -286,10 +280,9 @@ krb5_error_code decode_krb5_as_rep(DECLARG(const krb5_data *, code), cleanup(); } -krb5_error_code decode_krb5_tgs_rep(DECLARG(const krb5_data *, code), - DECLARG(krb5_kdc_rep **, rep)) - OLDDECLARG(const krb5_data *, code) - OLDDECLARG(krb5_kdc_rep **, rep) +krb5_error_code decode_krb5_tgs_rep(code, rep) + const krb5_data * code; + krb5_kdc_rep ** rep; { setup_no_length(); alloc_field(*rep,krb5_kdc_rep); @@ -304,10 +297,9 @@ krb5_error_code decode_krb5_tgs_rep(DECLARG(const krb5_data *, code), cleanup(); } -krb5_error_code decode_krb5_ap_req(DECLARG(const krb5_data *, code), - DECLARG(krb5_ap_req **, rep)) - OLDDECLARG(const krb5_data *, code) - OLDDECLARG(krb5_ap_req **, rep) +krb5_error_code decode_krb5_ap_req(code, rep) + const krb5_data * code; + krb5_ap_req ** rep; { setup(); alloc_field(*rep,krb5_ap_req); @@ -332,10 +324,9 @@ krb5_error_code decode_krb5_ap_req(DECLARG(const krb5_data *, code), cleanup(); } -krb5_error_code decode_krb5_ap_rep(DECLARG(const krb5_data *, code), - DECLARG(krb5_ap_rep **, rep)) - OLDDECLARG(const krb5_data *, code) - OLDDECLARG(krb5_ap_rep **, rep) +krb5_error_code decode_krb5_ap_rep(code, rep) + const krb5_data * code; + krb5_ap_rep ** rep; { setup(); alloc_field(*rep,krb5_ap_rep); @@ -357,10 +348,9 @@ krb5_error_code decode_krb5_ap_rep(DECLARG(const krb5_data *, code), cleanup(); } -krb5_error_code decode_krb5_ap_rep_enc_part(DECLARG(const krb5_data *, code), - DECLARG(krb5_ap_rep_enc_part **, rep)) - OLDDECLARG(const krb5_data *, code) - OLDDECLARG(krb5_ap_rep_enc_part **, rep) +krb5_error_code decode_krb5_ap_rep_enc_part(code, rep) + const krb5_data * code; + krb5_ap_rep_enc_part ** rep; { setup(); alloc_field(*rep,krb5_ap_rep_enc_part); @@ -377,10 +367,9 @@ krb5_error_code decode_krb5_ap_rep_enc_part(DECLARG(const krb5_data *, code), cleanup(); } -krb5_error_code decode_krb5_as_req(DECLARG(const krb5_data *, code), - DECLARG(krb5_kdc_req **, rep)) - OLDDECLARG(const krb5_data *, code) - OLDDECLARG(krb5_kdc_req **, rep) +krb5_error_code decode_krb5_as_req(code, rep) + const krb5_data * code; + krb5_kdc_req ** rep; { setup_no_length(); alloc_field(*rep,krb5_kdc_req); @@ -395,10 +384,9 @@ krb5_error_code decode_krb5_as_req(DECLARG(const krb5_data *, code), cleanup(); } -krb5_error_code decode_krb5_tgs_req(DECLARG(const krb5_data *, code), - DECLARG(krb5_kdc_req **, rep)) - OLDDECLARG(const krb5_data *, code) - OLDDECLARG(krb5_kdc_req **, rep) +krb5_error_code decode_krb5_tgs_req(code, rep) + const krb5_data * code; + krb5_kdc_req ** rep; { setup_no_length(); alloc_field(*rep,krb5_kdc_req); @@ -413,10 +401,9 @@ krb5_error_code decode_krb5_tgs_req(DECLARG(const krb5_data *, code), cleanup(); } -krb5_error_code decode_krb5_kdc_req_body(DECLARG(const krb5_data *, code), - DECLARG(krb5_kdc_req **, rep)) - OLDDECLARG(const krb5_data *, code) - OLDDECLARG(krb5_kdc_req **, rep) +krb5_error_code decode_krb5_kdc_req_body(code, rep) + const krb5_data * code; + krb5_kdc_req ** rep; { setup_buf_only(); alloc_field(*rep,krb5_kdc_req); @@ -427,10 +414,9 @@ krb5_error_code decode_krb5_kdc_req_body(DECLARG(const krb5_data *, code), cleanup(); } -krb5_error_code decode_krb5_safe(DECLARG(const krb5_data *, code), - DECLARG(krb5_safe **, rep)) - OLDDECLARG(const krb5_data *, code) - OLDDECLARG(krb5_safe **, rep) +krb5_error_code decode_krb5_safe(code, rep) + const krb5_data * code; + krb5_safe ** rep; { setup(); alloc_field(*rep,krb5_safe); @@ -454,10 +440,9 @@ krb5_error_code decode_krb5_safe(DECLARG(const krb5_data *, code), cleanup(); } -krb5_error_code decode_krb5_priv(DECLARG(const krb5_data *, code), - DECLARG(krb5_priv **, rep)) - OLDDECLARG(const krb5_data *, code) - OLDDECLARG(krb5_priv **, rep) +krb5_error_code decode_krb5_priv(code, rep) + const krb5_data * code; + krb5_priv ** rep; { setup(); alloc_field(*rep,krb5_priv); @@ -479,10 +464,9 @@ krb5_error_code decode_krb5_priv(DECLARG(const krb5_data *, code), cleanup(); } -krb5_error_code decode_krb5_enc_priv_part(DECLARG(const krb5_data *, code), - DECLARG(krb5_priv_enc_part **, rep)) - OLDDECLARG(const krb5_data *, code) - OLDDECLARG(krb5_priv_enc_part **, rep) +krb5_error_code decode_krb5_enc_priv_part(code, rep) + const krb5_data * code; + krb5_priv_enc_part ** rep; { setup(); alloc_field(*rep,krb5_priv_enc_part); @@ -502,10 +486,9 @@ krb5_error_code decode_krb5_enc_priv_part(DECLARG(const krb5_data *, code), cleanup(); } -krb5_error_code decode_krb5_cred(DECLARG(const krb5_data *, code), - DECLARG(krb5_cred **, rep)) - OLDDECLARG(const krb5_data *, code) - OLDDECLARG(krb5_cred **, rep) +krb5_error_code decode_krb5_cred(code, rep) + const krb5_data * code; + krb5_cred ** rep; { setup(); alloc_field(*rep,krb5_cred); @@ -528,10 +511,9 @@ krb5_error_code decode_krb5_cred(DECLARG(const krb5_data *, code), cleanup(); } -krb5_error_code decode_krb5_enc_cred_part(DECLARG(const krb5_data *, code), - DECLARG(krb5_cred_enc_part **, rep)) - OLDDECLARG(const krb5_data *, code) - OLDDECLARG(krb5_cred_enc_part **, rep) +krb5_error_code decode_krb5_enc_cred_part(code, rep) + const krb5_data * code; + krb5_cred_enc_part ** rep; { setup(); alloc_field(*rep,krb5_cred_enc_part); @@ -551,10 +533,9 @@ krb5_error_code decode_krb5_enc_cred_part(DECLARG(const krb5_data *, code), cleanup(); } -krb5_error_code decode_krb5_error(DECLARG(const krb5_data *, code), - DECLARG(krb5_error **, rep)) - OLDDECLARG(const krb5_data *, code) - OLDDECLARG(krb5_error **, rep) +krb5_error_code decode_krb5_error(code, rep) + const krb5_data * code; + krb5_error ** rep; { setup(); alloc_field(*rep,krb5_error); @@ -588,10 +569,9 @@ krb5_error_code decode_krb5_error(DECLARG(const krb5_data *, code), cleanup(); } -krb5_error_code decode_krb5_authdata(DECLARG(const krb5_data *, code), - DECLARG(krb5_authdata ***, rep)) - OLDDECLARG(const krb5_data *, code) - OLDDECLARG(krb5_authdata ***, rep) +krb5_error_code decode_krb5_authdata(code, rep) + const krb5_data * code; + krb5_authdata *** rep; { setup_buf_only(); *rep = 0; @@ -600,10 +580,9 @@ krb5_error_code decode_krb5_authdata(DECLARG(const krb5_data *, code), cleanup(); } -krb5_error_code decode_krb5_pwd_sequence(DECLARG(const krb5_data *, code), - DECLARG(passwd_phrase_element **, rep)) - OLDDECLARG(const krb5_data *, code) - OLDDECLARG(passwd_phrase_element **, rep) +krb5_error_code decode_krb5_pwd_sequence(code, rep) + const krb5_data * code; + passwd_phrase_element ** rep; { setup_buf_only(); alloc_field(*rep,passwd_phrase_element); @@ -612,10 +591,9 @@ krb5_error_code decode_krb5_pwd_sequence(DECLARG(const krb5_data *, code), cleanup(); } -krb5_error_code decode_krb5_pwd_data(DECLARG(const krb5_data *, code), - DECLARG(krb5_pwd_data **, rep)) - OLDDECLARG(const krb5_data *, code) - OLDDECLARG(krb5_pwd_data **, rep) +krb5_error_code decode_krb5_pwd_data(code, rep) + const krb5_data * code; + krb5_pwd_data ** rep; { setup(); alloc_field(*rep,krb5_pwd_data); diff --git a/src/lib/krb5/asn.1/krb5_encode.c b/src/lib/krb5/asn.1/krb5_encode.c index 3f0241ac4..1d69686f3 100644 --- a/src/lib/krb5/asn.1/krb5_encode.c +++ b/src/lib/krb5/asn.1/krb5_encode.c @@ -141,10 +141,9 @@ \ return 0 -krb5_error_code encode_krb5_authenticator(DECLARG(const krb5_authenticator *, rep), - DECLARG(krb5_data **, code)) - OLDDECLARG(const krb5_authenticator *, rep) - OLDDECLARG(krb5_data **, code) +krb5_error_code encode_krb5_authenticator(rep, code) + const krb5_authenticator * rep; + krb5_data ** code; { krb5_setup(); @@ -199,10 +198,9 @@ krb5_error_code encode_krb5_authenticator(DECLARG(const krb5_authenticator *, re krb5_cleanup(); } -krb5_error_code encode_krb5_ticket(DECLARG(const krb5_ticket *, rep), - DECLARG(krb5_data **, code)) - OLDDECLARG(const krb5_ticket *, rep) - OLDDECLARG(krb5_data **, code) +krb5_error_code encode_krb5_ticket(rep, code) + const krb5_ticket * rep; + krb5_data ** code; { krb5_setup(); @@ -225,10 +223,9 @@ krb5_error_code encode_krb5_ticket(DECLARG(const krb5_ticket *, rep), krb5_cleanup(); } -krb5_error_code encode_krb5_encryption_key(DECLARG(const krb5_keyblock *, rep), - DECLARG(krb5_data **, code)) - OLDDECLARG(const krb5_keyblock *, rep) - OLDDECLARG(krb5_data **, code) +krb5_error_code encode_krb5_encryption_key(rep, code) + const krb5_keyblock * rep; + krb5_data ** code; { krb5_setup(); @@ -244,10 +241,9 @@ krb5_error_code encode_krb5_encryption_key(DECLARG(const krb5_keyblock *, rep), krb5_cleanup(); } -krb5_error_code encode_krb5_enc_tkt_part(DECLARG(const krb5_enc_tkt_part *, rep), - DECLARG(krb5_data **, code)) - OLDDECLARG(const krb5_enc_tkt_part *, rep) - OLDDECLARG(krb5_data **, code) +krb5_error_code encode_krb5_enc_tkt_part(rep, code) + const krb5_enc_tkt_part * rep; + krb5_data ** code; { krb5_setup(); @@ -297,10 +293,9 @@ krb5_error_code encode_krb5_enc_tkt_part(DECLARG(const krb5_enc_tkt_part *, rep) krb5_cleanup(); } -krb5_error_code encode_krb5_enc_kdc_rep_part(DECLARG(const krb5_enc_kdc_rep_part *, rep), - DECLARG(krb5_data **, code)) - OLDDECLARG(const krb5_enc_kdc_rep_part *, rep) - OLDDECLARG(krb5_data **, code) +krb5_error_code encode_krb5_enc_kdc_rep_part(rep, code) + const krb5_enc_kdc_rep_part * rep; + krb5_data ** code; { asn1_error_code retval; asn1buf *buf=NULL; @@ -326,10 +321,9 @@ krb5_error_code encode_krb5_enc_kdc_rep_part(DECLARG(const krb5_enc_kdc_rep_part } /* yes, the translation is identical to that used for KDC__REP */ -krb5_error_code encode_krb5_as_rep(DECLARG(const krb5_kdc_rep *, rep), - DECLARG(krb5_data **, code)) - OLDDECLARG(const krb5_kdc_rep *, rep) - OLDDECLARG(krb5_data **, code) +krb5_error_code encode_krb5_as_rep(rep, code) + const krb5_kdc_rep * rep; + krb5_data ** code; { krb5_setup(); @@ -344,10 +338,9 @@ krb5_error_code encode_krb5_as_rep(DECLARG(const krb5_kdc_rep *, rep), } /* yes, the translation is identical to that used for KDC__REP */ -krb5_error_code encode_krb5_tgs_rep(DECLARG(const krb5_kdc_rep *, rep), - DECLARG(krb5_data **, code)) - OLDDECLARG(const krb5_kdc_rep *, rep) - OLDDECLARG(krb5_data **, code) +krb5_error_code encode_krb5_tgs_rep( rep, code) + const krb5_kdc_rep * rep; + krb5_data ** code; { krb5_setup(); @@ -361,10 +354,9 @@ krb5_error_code encode_krb5_tgs_rep(DECLARG(const krb5_kdc_rep *, rep), krb5_cleanup(); } -krb5_error_code encode_krb5_ap_req(DECLARG(const krb5_ap_req *, rep), - DECLARG(krb5_data **, code)) - OLDDECLARG(const krb5_ap_req *, rep) - OLDDECLARG(krb5_data **, code) +krb5_error_code encode_krb5_ap_req(rep, code) + const krb5_ap_req * rep; + krb5_data ** code; { krb5_setup(); @@ -390,10 +382,9 @@ krb5_error_code encode_krb5_ap_req(DECLARG(const krb5_ap_req *, rep), krb5_cleanup(); } -krb5_error_code encode_krb5_ap_rep(DECLARG(const krb5_ap_rep *, rep), - DECLARG(krb5_data **, code)) - OLDDECLARG(const krb5_ap_rep *, rep) - OLDDECLARG(krb5_data **, code) +krb5_error_code encode_krb5_ap_rep(rep, code) + const krb5_ap_rep * rep; + krb5_data ** code; { krb5_setup(); @@ -414,10 +405,9 @@ krb5_error_code encode_krb5_ap_rep(DECLARG(const krb5_ap_rep *, rep), } -krb5_error_code encode_krb5_ap_rep_enc_part(DECLARG(const krb5_ap_rep_enc_part *, rep), - DECLARG(krb5_data **, code)) - OLDDECLARG(const krb5_ap_rep_enc_part *, rep) - OLDDECLARG(krb5_data **, code) +krb5_error_code encode_krb5_ap_rep_enc_part(rep, code) + const krb5_ap_rep_enc_part * rep; + krb5_data ** code; { krb5_setup(); @@ -442,10 +432,9 @@ krb5_error_code encode_krb5_ap_rep_enc_part(DECLARG(const krb5_ap_rep_enc_part * krb5_cleanup(); } -krb5_error_code encode_krb5_as_req(DECLARG(const krb5_kdc_req *, rep), - DECLARG(krb5_data **, code)) - OLDDECLARG(const krb5_kdc_req *, rep) - OLDDECLARG(krb5_data **, code) +krb5_error_code encode_krb5_as_req(rep, code) + const krb5_kdc_req * rep; + krb5_data ** code; { krb5_setup(); @@ -459,10 +448,9 @@ krb5_error_code encode_krb5_as_req(DECLARG(const krb5_kdc_req *, rep), krb5_cleanup(); } -krb5_error_code encode_krb5_tgs_req(DECLARG(const krb5_kdc_req *, rep), - DECLARG(krb5_data **, code)) - OLDDECLARG(const krb5_kdc_req *, rep) - OLDDECLARG(krb5_data **, code) +krb5_error_code encode_krb5_tgs_req(rep, code) + const krb5_kdc_req * rep; + krb5_data ** code; { krb5_setup(); @@ -476,10 +464,9 @@ krb5_error_code encode_krb5_tgs_req(DECLARG(const krb5_kdc_req *, rep), krb5_cleanup(); } -krb5_error_code encode_krb5_kdc_req_body(DECLARG(const krb5_kdc_req *, rep), - DECLARG(krb5_data **, code)) - OLDDECLARG(const krb5_kdc_req *, rep) - OLDDECLARG(krb5_data **, code) +krb5_error_code encode_krb5_kdc_req_body(rep, code) + const krb5_kdc_req * rep; + krb5_data ** code; { krb5_setup(); @@ -491,10 +478,9 @@ krb5_error_code encode_krb5_kdc_req_body(DECLARG(const krb5_kdc_req *, rep), } -krb5_error_code encode_krb5_safe(DECLARG(const krb5_safe *, rep), - DECLARG(krb5_data **, code)) - OLDDECLARG(const krb5_safe *, rep) - OLDDECLARG(krb5_data **, code) +krb5_error_code encode_krb5_safe(rep, code) + const krb5_safe * rep; + krb5_data ** code; { krb5_setup(); @@ -517,10 +503,9 @@ krb5_error_code encode_krb5_safe(DECLARG(const krb5_safe *, rep), krb5_cleanup(); } -krb5_error_code encode_krb5_priv(DECLARG(const krb5_priv *, rep), - DECLARG(krb5_data **, code)) - OLDDECLARG(const krb5_priv *, rep) - OLDDECLARG(krb5_data **, code) +krb5_error_code encode_krb5_priv(rep, code) + const krb5_priv * rep; + krb5_data ** code; { krb5_setup(); @@ -540,10 +525,9 @@ krb5_error_code encode_krb5_priv(DECLARG(const krb5_priv *, rep), krb5_cleanup(); } -krb5_error_code encode_krb5_enc_priv_part(DECLARG(const krb5_priv_enc_part *, rep), - DECLARG(krb5_data **, code)) - OLDDECLARG(const krb5_priv_enc_part *, rep) - OLDDECLARG(krb5_data **, code) +krb5_error_code encode_krb5_enc_priv_part(rep, code) + const krb5_priv_enc_part * rep; + krb5_data ** code; { krb5_setup(); @@ -575,10 +559,9 @@ krb5_error_code encode_krb5_enc_priv_part(DECLARG(const krb5_priv_enc_part *, re krb5_cleanup(); } -krb5_error_code encode_krb5_cred(DECLARG(const krb5_cred *, rep), - DECLARG(krb5_data **, code)) - OLDDECLARG(const krb5_cred *, rep) - OLDDECLARG(krb5_data **, code) +krb5_error_code encode_krb5_cred(rep, code) + const krb5_cred * rep; + krb5_data ** code; { krb5_setup(); @@ -601,10 +584,9 @@ krb5_error_code encode_krb5_cred(DECLARG(const krb5_cred *, rep), krb5_cleanup(); } -krb5_error_code encode_krb5_enc_cred_part(DECLARG(const krb5_cred_enc_part *, rep), - DECLARG(krb5_data **, code)) - OLDDECLARG(const krb5_cred_enc_part *, rep) - OLDDECLARG(krb5_data **, code) +krb5_error_code encode_krb5_enc_cred_part(rep, code) + const krb5_cred_enc_part * rep; + krb5_data ** code; { krb5_setup(); @@ -638,10 +620,9 @@ krb5_error_code encode_krb5_enc_cred_part(DECLARG(const krb5_cred_enc_part *, re krb5_cleanup(); } -krb5_error_code encode_krb5_error(DECLARG(const krb5_error *, rep), - DECLARG(krb5_data **, code)) - OLDDECLARG(const krb5_error *, rep) - OLDDECLARG(krb5_data **, code) +krb5_error_code encode_krb5_error(rep, code) + const krb5_error * rep; + krb5_data ** code; { krb5_setup(); @@ -696,10 +677,9 @@ krb5_error_code encode_krb5_error(DECLARG(const krb5_error *, rep), krb5_cleanup(); } -krb5_error_code encode_krb5_authdata(DECLARG(const krb5_authdata **, rep), - DECLARG(krb5_data **, code)) - OLDDECLARG(const krb5_authdata **, rep) - OLDDECLARG(krb5_data **, code) +krb5_error_code encode_krb5_authdata(rep, code) + const krb5_authdata ** rep; + krb5_data ** code; { asn1_error_code retval; asn1buf *buf=NULL; @@ -718,10 +698,9 @@ krb5_error_code encode_krb5_authdata(DECLARG(const krb5_authdata **, rep), } /* Sandia Additions */ -krb5_error_code encode_krb5_pwd_sequence(DECLARG(const passwd_phrase_element *, rep), - DECLARG(krb5_data **, code)) - OLDDECLARG(const passwd_phrase_element *, rep) - OLDDECLARG(krb5_data **, code) +krb5_error_code encode_krb5_pwd_sequence( rep, code) + const passwd_phrase_element * rep; + krb5_data ** code; { krb5_setup(); retval = asn1_encode_passwdsequence(buf,rep,&length); @@ -730,10 +709,9 @@ krb5_error_code encode_krb5_pwd_sequence(DECLARG(const passwd_phrase_element *, krb5_cleanup(); } -krb5_error_code encode_krb5_pwd_data(DECLARG(const krb5_pwd_data *, rep), - DECLARG(krb5_data **, code)) - OLDDECLARG(const krb5_pwd_data *, rep) - OLDDECLARG(krb5_data **, code) +krb5_error_code encode_krb5_pwd_data(rep, code) + const krb5_pwd_data * rep; + krb5_data ** code; { krb5_setup(); krb5_addfield((const passwd_phrase_element**)rep->element,1,asn1_encode_sequence_of_passwdsequence); diff --git a/src/lib/krb5/keytab/file/ktf_add.c b/src/lib/krb5/keytab/file/ktf_add.c index ff5f6e895..140fb6a2c 100644 --- a/src/lib/krb5/keytab/file/ktf_add.c +++ b/src/lib/krb5/keytab/file/ktf_add.c @@ -31,17 +31,18 @@ #include "ktfile.h" krb5_error_code -krb5_ktfile_add(id, entry) -krb5_keytab id; -krb5_keytab_entry *entry; +krb5_ktfile_add(context, id, entry) + krb5_context context; + krb5_keytab id; + krb5_keytab_entry *entry; { krb5_error_code retval; - if (retval = krb5_ktfileint_openw(id)) + if (retval = krb5_ktfileint_openw(context, id)) return retval; if (fseek(KTFILEP(id), 0, 2) == -1) return KRB5_KT_END; - retval = krb5_ktfileint_write_entry(id, entry); - krb5_ktfileint_close(id); + retval = krb5_ktfileint_write_entry(context, id, entry); + krb5_ktfileint_close(context, id); return retval; } diff --git a/src/lib/krb5/keytab/file/ktf_close.c b/src/lib/krb5/keytab/file/ktf_close.c index e399f04e2..ebe8726e3 100644 --- a/src/lib/krb5/keytab/file/ktf_close.c +++ b/src/lib/krb5/keytab/file/ktf_close.c @@ -32,7 +32,8 @@ #include "ktfile.h" krb5_error_code -krb5_ktfile_close(id) +krb5_ktfile_close(context, id) + krb5_context context; krb5_keytab id; /* * This routine is responsible for freeing all memory allocated diff --git a/src/lib/krb5/keytab/file/ktf_endget.c b/src/lib/krb5/keytab/file/ktf_endget.c index 8af0a7d29..a1f1fc40a 100644 --- a/src/lib/krb5/keytab/file/ktf_endget.c +++ b/src/lib/krb5/keytab/file/ktf_endget.c @@ -31,10 +31,11 @@ #include "ktfile.h" krb5_error_code -krb5_ktfile_end_get(id, cursor) +krb5_ktfile_end_get(context, id, cursor) + krb5_context context; krb5_keytab id; krb5_kt_cursor *cursor; { krb5_xfree(*cursor); - return krb5_ktfileint_close(id); + return krb5_ktfileint_close(context, id); } diff --git a/src/lib/krb5/keytab/file/ktf_get_en.c b/src/lib/krb5/keytab/file/ktf_get_en.c index fce13c840..fba8c5b7d 100644 --- a/src/lib/krb5/keytab/file/ktf_get_en.c +++ b/src/lib/krb5/keytab/file/ktf_get_en.c @@ -33,20 +33,18 @@ #include "ktfile.h" krb5_error_code -krb5_ktfile_get_entry(DECLARG(krb5_keytab, id), - DECLARG(krb5_principal, principal), - DECLARG(krb5_kvno, kvno), - DECLARG(krb5_keytab_entry *, entry)) -OLDDECLARG(krb5_keytab, id) -OLDDECLARG(krb5_principal, principal) -OLDDECLARG(krb5_kvno, kvno) -OLDDECLARG(krb5_keytab_entry *, entry) +krb5_ktfile_get_entry(context, id, principal, kvno, entry) + krb5_context context; + krb5_keytab id; + krb5_principal principal; + krb5_kvno kvno; + krb5_keytab_entry * entry; { krb5_keytab_entry cur_entry, new_entry; krb5_error_code kerror = 0; /* Open the keyfile for reading */ - if (kerror = krb5_ktfileint_openr(id)) + if (kerror = krb5_ktfileint_openr(context, id)) return(kerror); /* @@ -57,13 +55,13 @@ OLDDECLARG(krb5_keytab_entry *, entry) cur_entry.vno = 0; cur_entry.key.contents = 0; while (TRUE) { - if (kerror = krb5_ktfileint_read_entry(id, &new_entry)) + if (kerror = krb5_ktfileint_read_entry(context, id, &new_entry)) break; - if (krb5_principal_compare(principal, new_entry.principal)) { + if (krb5_principal_compare(context, principal, new_entry.principal)) { if (kvno == IGNORE_VNO) { if (cur_entry.vno < new_entry.vno) { - krb5_kt_free_entry(&cur_entry); + krb5_kt_free_entry(context, &cur_entry); cur_entry = new_entry; } } else { @@ -71,18 +69,18 @@ OLDDECLARG(krb5_keytab_entry *, entry) break; } } else { - krb5_kt_free_entry(&new_entry); + krb5_kt_free_entry(context, &new_entry); } } if (kerror == KRB5_KT_END) kerror = cur_entry.principal ? 0 : KRB5_KT_NOTFOUND; if (kerror) { - (void) krb5_ktfileint_close(id); - krb5_kt_free_entry(&cur_entry); + (void) krb5_ktfileint_close(context, id); + krb5_kt_free_entry(context, &cur_entry); return kerror; } - if ((kerror = krb5_ktfileint_close(id)) != 0) { - krb5_kt_free_entry(&cur_entry); + if ((kerror = krb5_ktfileint_close(context, id)) != 0) { + krb5_kt_free_entry(context, &cur_entry); return kerror; } *entry = cur_entry; diff --git a/src/lib/krb5/keytab/file/ktf_get_na.c b/src/lib/krb5/keytab/file/ktf_get_na.c index 54fc0d72d..62cd10e7f 100644 --- a/src/lib/krb5/keytab/file/ktf_get_na.c +++ b/src/lib/krb5/keytab/file/ktf_get_na.c @@ -31,7 +31,8 @@ #include "ktfile.h" krb5_error_code -krb5_ktfile_get_name(id, name, len) +krb5_ktfile_get_name(context, id, name, len) + krb5_context context; krb5_keytab id; char *name; int len; diff --git a/src/lib/krb5/keytab/file/ktf_next.c b/src/lib/krb5/keytab/file/ktf_next.c index 3c2bdc4aa..57b74ba75 100644 --- a/src/lib/krb5/keytab/file/ktf_next.c +++ b/src/lib/krb5/keytab/file/ktf_next.c @@ -31,7 +31,8 @@ #include "ktfile.h" krb5_error_code -krb5_ktfile_get_next(id, entry, cursor) +krb5_ktfile_get_next(context, id, entry, cursor) + krb5_context context; krb5_keytab id; krb5_keytab_entry *entry; krb5_kt_cursor *cursor; @@ -42,7 +43,7 @@ krb5_kt_cursor *cursor; if (fseek(KTFILEP(id), *fileoff, 0) == -1) return KRB5_KT_END; - if (kerror = krb5_ktfileint_read_entry(id, &cur_entry)) + if (kerror = krb5_ktfileint_read_entry(context, id, &cur_entry)) return kerror; *fileoff = ftell(KTFILEP(id)); *entry = cur_entry; diff --git a/src/lib/krb5/keytab/file/ktf_remove.c b/src/lib/krb5/keytab/file/ktf_remove.c index 60cd99fd4..8881d0275 100644 --- a/src/lib/krb5/keytab/file/ktf_remove.c +++ b/src/lib/krb5/keytab/file/ktf_remove.c @@ -31,7 +31,8 @@ #include "ktfile.h" krb5_error_code -krb5_ktfile_remove(id, entry) +krb5_ktfile_remove(context, id, entry) + krb5_context context; krb5_keytab id; krb5_keytab_entry *entry; { @@ -39,7 +40,7 @@ krb5_keytab_entry *entry; krb5_error_code kerror; krb5_int32 delete_point; - if (kerror = krb5_ktfileint_openw(id)) { + if (kerror = krb5_ktfileint_openw(context, id)) { return kerror; } @@ -48,34 +49,34 @@ krb5_keytab_entry *entry; * is exited with a break statement. */ while (TRUE) { - if (kerror = krb5_ktfileint_internal_read_entry(id, &cur_entry, + if (kerror = krb5_ktfileint_internal_read_entry(context, id, &cur_entry, &delete_point)) break; if ((entry->vno == cur_entry.vno) && (entry->key.keytype == cur_entry.key.keytype) && - krb5_principal_compare(entry->principal, cur_entry.principal)) { + krb5_principal_compare(context, entry->principal, cur_entry.principal)) { /* found a match */ - krb5_kt_free_entry(&cur_entry); + krb5_kt_free_entry(context, &cur_entry); break; } - krb5_kt_free_entry(&cur_entry); + krb5_kt_free_entry(context, &cur_entry); } if (kerror == KRB5_KT_END) kerror = KRB5_KT_NOTFOUND; if (kerror) { - (void) krb5_ktfileint_close(id); + (void) krb5_ktfileint_close(context, id); return kerror; } - kerror = krb5_ktfileint_delete_entry(id, delete_point); + kerror = krb5_ktfileint_delete_entry(context, id, delete_point); if (kerror) { - (void) krb5_ktfileint_close(id); + (void) krb5_ktfileint_close(context, id); } else { - kerror = krb5_ktfileint_close(id); + kerror = krb5_ktfileint_close(context, id); } return kerror; diff --git a/src/lib/krb5/keytab/file/ktf_resolv.c b/src/lib/krb5/keytab/file/ktf_resolv.c index 63b9aba06..e5bef9803 100644 --- a/src/lib/krb5/keytab/file/ktf_resolv.c +++ b/src/lib/krb5/keytab/file/ktf_resolv.c @@ -32,7 +32,8 @@ #include "ktfile.h" krb5_error_code -krb5_ktfile_resolve(name, id) +krb5_ktfile_resolve(context, name, id) + krb5_context context; const char *name; krb5_keytab *id; { diff --git a/src/lib/krb5/keytab/file/ktf_ssget.c b/src/lib/krb5/keytab/file/ktf_ssget.c index e822ba888..b9872d3f6 100644 --- a/src/lib/krb5/keytab/file/ktf_ssget.c +++ b/src/lib/krb5/keytab/file/ktf_ssget.c @@ -31,18 +31,19 @@ #include "ktfile.h" krb5_error_code -krb5_ktfile_start_seq_get(id, cursorp) +krb5_ktfile_start_seq_get(context, id, cursorp) + krb5_context context; krb5_keytab id; krb5_kt_cursor *cursorp; { krb5_error_code retval; long *fileoff; - if (retval = krb5_ktfileint_openr(id)) + if (retval = krb5_ktfileint_openr(context, id)) return retval; if (!(fileoff = (long *)malloc(sizeof(*fileoff)))) { - krb5_ktfileint_close(id); + krb5_ktfileint_close(context, id); return ENOMEM; } *fileoff = ftell(KTFILEP(id)); diff --git a/src/lib/krb5/keytab/file/ktf_util.c b/src/lib/krb5/keytab/file/ktf_util.c index 332611197..dc115df41 100644 --- a/src/lib/krb5/keytab/file/ktf_util.c +++ b/src/lib/krb5/keytab/file/ktf_util.c @@ -102,7 +102,8 @@ static char *fopen_mode_rb = "r"; extern int errno; static krb5_error_code -krb5_ktfileint_open(id, mode) +krb5_ktfileint_open(context, id, mode) + krb5_context context; krb5_keytab id; int mode; { @@ -116,7 +117,7 @@ int mode; if (!KTFILEP(id)) { if ((mode == KRB5_LOCKMODE_EXCLUSIVE) && (errno == ENOENT)) { /* try making it first time around */ - krb5_create_secure_file(KTFILENAME(id)); + krb5_create_secure_file(context, KTFILENAME(id)); KTFILEP(id) = fopen(KTFILENAME(id), fopen_mode_rbplus); if (!KTFILEP(id)) return errno; @@ -124,7 +125,7 @@ int mode; } else /* some other error */ return errno; } - if (kerror = krb5_lock_file(KTFILEP(id), KTFILENAME(id), + if (kerror = krb5_lock_file(context, KTFILEP(id), KTFILENAME(id), mode)) { (void) fclose(KTFILEP(id)); KTFILEP(id) = 0; @@ -139,7 +140,7 @@ int mode; KTVERSION(id) = krb5_kt_default_vno; if (!xfwrite(&kt_vno, sizeof(kt_vno), 1, KTFILEP(id))) { kerror = errno; - (void) krb5_unlock_file(KTFILEP(id), KTFILENAME(id)); + (void) krb5_unlock_file(context, KTFILEP(id), KTFILENAME(id)); (void) fclose(KTFILEP(id)); return kerror; } @@ -147,14 +148,14 @@ int mode; /* gotta verify it instead... */ if (!xfread(&kt_vno, sizeof(kt_vno), 1, KTFILEP(id))) { kerror = errno; - (void) krb5_unlock_file(KTFILEP(id), KTFILENAME(id)); + (void) krb5_unlock_file(context, KTFILEP(id), KTFILENAME(id)); (void) fclose(KTFILEP(id)); return kerror; } kt_vno = KTVERSION(id) = ntohs(kt_vno); if ((kt_vno != KRB5_KT_VNO) && (kt_vno != KRB5_KT_VNO_1)) { - (void) krb5_unlock_file(KTFILEP(id), KTFILENAME(id)); + (void) krb5_unlock_file(context, KTFILEP(id), KTFILENAME(id)); (void) fclose(KTFILEP(id)); return -1 /* KRB5_KEYTAB_BADVNO */; } @@ -163,35 +164,39 @@ int mode; } krb5_error_code -krb5_ktfileint_openr(id) +krb5_ktfileint_openr(context, id) + krb5_context context; krb5_keytab id; { - return krb5_ktfileint_open(id, KRB5_LOCKMODE_SHARED); + return krb5_ktfileint_open(context, id, KRB5_LOCKMODE_SHARED); } krb5_error_code -krb5_ktfileint_openw(id) +krb5_ktfileint_openw(context, id) + krb5_context context; krb5_keytab id; { - return krb5_ktfileint_open(id, KRB5_LOCKMODE_EXCLUSIVE); + return krb5_ktfileint_open(context, id, KRB5_LOCKMODE_EXCLUSIVE); } krb5_error_code -krb5_ktfileint_close(id) +krb5_ktfileint_close(context, id) + krb5_context context; krb5_keytab id; { krb5_error_code kerror; if (!KTFILEP(id)) return 0; - kerror = krb5_unlock_file(KTFILEP(id), KTFILENAME(id)); + kerror = krb5_unlock_file(context, KTFILEP(id), KTFILENAME(id)); (void) fclose(KTFILEP(id)); KTFILEP(id) = 0; return kerror; } krb5_error_code -krb5_ktfileint_delete_entry(id, delete_point) +krb5_ktfileint_delete_entry(context, id, delete_point) + krb5_context context; krb5_keytab id; krb5_int32 delete_point; { @@ -236,14 +241,15 @@ krb5_int32 delete_point; } } - return krb5_sync_disk_file(KTFILEP(id)); + return krb5_sync_disk_file(context, KTFILEP(id)); } return 0; } krb5_error_code -krb5_ktfileint_internal_read_entry(id, ret_entry, delete_point) +krb5_ktfileint_internal_read_entry(context, id, ret_entry, delete_point) + krb5_context context; krb5_keytab id; krb5_keytab_entry *ret_entry; krb5_int32 *delete_point; @@ -324,7 +330,7 @@ krb5_int32 *delete_point; error = KRB5_KT_END; goto fail; } - krb5_princ_set_realm_length(ret_entry->principal, princ_size); + krb5_princ_set_realm_length(context, ret_entry->principal, princ_size); tmpdata = malloc(princ_size+1); if (!tmpdata) { error = ENOMEM; @@ -338,10 +344,10 @@ krb5_int32 *delete_point; tmpdata[princ_size] = 0; /* Some things might be expecting null */ /* termination... ``Be conservative in */ /* what you send out'' */ - krb5_princ_set_realm_data(ret_entry->principal, tmpdata); + krb5_princ_set_realm_data(context, ret_entry->principal, tmpdata); for (i = 0; i < count; i++) { - princ = krb5_princ_component(ret_entry->principal, i); + princ = krb5_princ_component(context, ret_entry->principal, i); if (!xfread(&princ_size, sizeof(princ_size), 1, KTFILEP(id))) { error = KRB5_KT_END; goto fail; @@ -434,7 +440,7 @@ krb5_int32 *delete_point; fail: for (i = 0; i < ret_entry->principal->length; i++) { - princ = krb5_princ_component(ret_entry->principal, i); + princ = krb5_princ_component(context, ret_entry->principal, i); if (princ->data) free(princ->data); } @@ -446,17 +452,19 @@ fail: } krb5_error_code -krb5_ktfileint_read_entry(id, entryp) +krb5_ktfileint_read_entry(context, id, entryp) + krb5_context context; krb5_keytab id; krb5_keytab_entry *entryp; { krb5_int32 delete_point; - return krb5_ktfileint_internal_read_entry(id, entryp, &delete_point); + return krb5_ktfileint_internal_read_entry(context, id, entryp, &delete_point); } krb5_error_code -krb5_ktfileint_write_entry(id, entry) +krb5_ktfileint_write_entry(context, id, entry) + krb5_context context; krb5_keytab id; krb5_keytab_entry *entry; { @@ -470,10 +478,10 @@ krb5_keytab_entry *entry; int i; char iobuf[BUFSIZ]; - retval = krb5_ktfileint_size_entry(entry, &size_needed); + retval = krb5_ktfileint_size_entry(context, entry, &size_needed); if (retval) return retval; - retval = krb5_ktfileint_find_slot(id, &size_needed, &commit_point); + retval = krb5_ktfileint_find_slot(context, id, &size_needed, &commit_point); if (retval) return retval; @@ -497,20 +505,20 @@ krb5_keytab_entry *entry; setbuf(KTFILEP(id), 0); return KRB5_KT_IOERR; } - size = krb5_princ_realm(entry->principal)->length; + size = krb5_princ_realm(context, entry->principal)->length; if (KTVERSION(id) != KRB5_KT_VNO_1) size = htons(size); if (!xfwrite(&size, sizeof(size), 1, KTFILEP(id))) { goto abend; } - if (!xfwrite(krb5_princ_realm(entry->principal)->data, sizeof(char), - krb5_princ_realm(entry->principal)->length, KTFILEP(id))) { + if (!xfwrite(krb5_princ_realm(context, entry->principal)->data, sizeof(char), + krb5_princ_realm(context, entry->principal)->length, KTFILEP(id))) { goto abend; } count = entry->principal->length; for (i = 0; i < count; i++) { - princ = krb5_princ_component(entry->principal, i); + princ = krb5_princ_component(context, entry->principal, i); size = princ->length; if (KTVERSION(id) != KRB5_KT_VNO_1) size = htons(size); @@ -526,7 +534,7 @@ krb5_keytab_entry *entry; * Write out the principal type */ if (KTVERSION(id) != KRB5_KT_VNO_1) { - princ_type = htonl(krb5_princ_type(entry->principal)); + princ_type = htonl(krb5_princ_type(context, entry->principal)); if (!xfwrite(&princ_type, sizeof(princ_type), 1, KTFILEP(id))) { goto abend; } @@ -535,7 +543,7 @@ krb5_keytab_entry *entry; /* * Fill in the time of day the entry was written to the keytab. */ - if (krb5_timeofday(&entry->timestamp)) { + if (krb5_timeofday(context, &entry->timestamp)) { entry->timestamp = 0; } if (KTVERSION(id) == KRB5_KT_VNO_1) @@ -573,7 +581,7 @@ krb5_keytab_entry *entry; return KRB5_KT_IOERR; } - retval = krb5_sync_disk_file(KTFILEP(id)); + retval = krb5_sync_disk_file(context, KTFILEP(id)); (void) memset(iobuf, 0, sizeof(iobuf)); setbuf(KTFILEP(id), 0); @@ -589,7 +597,7 @@ krb5_keytab_entry *entry; if (!xfwrite(&size_needed, sizeof(size_needed), 1, KTFILEP(id))) { goto abend; } - retval = krb5_sync_disk_file(KTFILEP(id)); + retval = krb5_sync_disk_file(context, KTFILEP(id)); return retval; } @@ -599,7 +607,8 @@ krb5_keytab_entry *entry; * keytab entry. */ krb5_error_code -krb5_ktfileint_size_entry(entry, size_needed) +krb5_ktfileint_size_entry(context, entry, size_needed) + krb5_context context; krb5_keytab_entry *entry; krb5_int32 *size_needed; { @@ -610,10 +619,10 @@ krb5_int32 *size_needed; count = entry->principal->length; total_size = sizeof(count); - total_size += krb5_princ_realm(entry->principal)->length + (sizeof(size)); + total_size += krb5_princ_realm(context, entry->principal)->length + (sizeof(size)); for (i = 0; i < count; i++) { - total_size += krb5_princ_component(entry->principal,i)->length + total_size += krb5_princ_component(context, entry->principal,i)->length + (sizeof(size)); } @@ -640,7 +649,8 @@ krb5_int32 *size_needed; * block in the file rather than the size of the actual entry) */ krb5_error_code -krb5_ktfileint_find_slot(id, size_needed, commit_point) +krb5_ktfileint_find_slot(context, id, size_needed, commit_point) + krb5_context context; krb5_keytab id; krb5_int32 *size_needed; krb5_int32 *commit_point; diff --git a/src/lib/krb5/keytab/file/ktf_wreslv.c b/src/lib/krb5/keytab/file/ktf_wreslv.c index a8b16bc9f..9d6632ac4 100644 --- a/src/lib/krb5/keytab/file/ktf_wreslv.c +++ b/src/lib/krb5/keytab/file/ktf_wreslv.c @@ -32,7 +32,8 @@ #include "ktfile.h" krb5_error_code -krb5_ktfile_wresolve(name, id) +krb5_ktfile_wresolve(context, name, id) + krb5_context context; const char *name; krb5_keytab *id; { diff --git a/src/lib/krb5/keytab/file/ktfile.h b/src/lib/krb5/keytab/file/ktfile.h index e81fea943..2a3f3a622 100644 --- a/src/lib/krb5/keytab/file/ktfile.h +++ b/src/lib/krb5/keytab/file/ktfile.h @@ -64,48 +64,104 @@ extern struct _krb5_kt_ops krb5_ktf_writable_ops; /* widen prototypes, if needed */ #include -krb5_error_code krb5_ktfile_resolve PROTOTYPE((const char *, - krb5_keytab *)); -krb5_error_code krb5_ktfile_wresolve PROTOTYPE((const char *, - krb5_keytab *)); -krb5_error_code krb5_ktfile_get_name PROTOTYPE((krb5_keytab, - char *, - int)); -krb5_error_code krb5_ktfile_close PROTOTYPE((krb5_keytab)); -krb5_error_code krb5_ktfile_get_entry PROTOTYPE((krb5_keytab, - krb5_principal, - krb5_kvno, - krb5_keytab_entry *)); -krb5_error_code krb5_ktfile_start_seq_get PROTOTYPE((krb5_keytab, - krb5_kt_cursor *)); -krb5_error_code krb5_ktfile_get_next PROTOTYPE((krb5_keytab, - krb5_keytab_entry *, - krb5_kt_cursor *)); -krb5_error_code krb5_ktfile_end_get PROTOTYPE((krb5_keytab, - krb5_kt_cursor *)); +krb5_error_code krb5_ktfile_resolve + PROTOTYPE((krb5_context, + const char *, + krb5_keytab *)); + +krb5_error_code krb5_ktfile_wresolve + PROTOTYPE((krb5_context, + const char *, + krb5_keytab *)); + +krb5_error_code krb5_ktfile_get_name + PROTOTYPE((krb5_context, + krb5_keytab, + char *, + int)); + +krb5_error_code krb5_ktfile_close + PROTOTYPE((krb5_context, + krb5_keytab)); + +krb5_error_code krb5_ktfile_get_entry + PROTOTYPE((krb5_context, + krb5_keytab, + krb5_principal, + krb5_kvno, + krb5_keytab_entry *)); + +krb5_error_code krb5_ktfile_start_seq_get + PROTOTYPE((krb5_context, + krb5_keytab, + krb5_kt_cursor *)); + +krb5_error_code krb5_ktfile_get_next + PROTOTYPE((krb5_context, + krb5_keytab, + krb5_keytab_entry *, + krb5_kt_cursor *)); + +krb5_error_code krb5_ktfile_end_get + PROTOTYPE((krb5_context, + krb5_keytab, + krb5_kt_cursor *)); + /* routines to be included on extended version (write routines) */ -krb5_error_code krb5_ktfile_add PROTOTYPE((krb5_keytab, - krb5_keytab_entry *)); -krb5_error_code krb5_ktfile_remove PROTOTYPE((krb5_keytab, - krb5_keytab_entry *)); - -krb5_error_code krb5_ktfileint_openr PROTOTYPE((krb5_keytab)); -krb5_error_code krb5_ktfileint_openw PROTOTYPE((krb5_keytab)); -krb5_error_code krb5_ktfileint_close PROTOTYPE((krb5_keytab)); -krb5_error_code krb5_ktfileint_read_entry PROTOTYPE((krb5_keytab, - krb5_keytab_entry *)); -krb5_error_code krb5_ktfileint_write_entry PROTOTYPE((krb5_keytab, - krb5_keytab_entry *)); -krb5_error_code krb5_ktfileint_delete_entry PROTOTYPE((krb5_keytab, - krb5_int32)); -krb5_error_code krb5_ktfileint_internal_read_entry PROTOTYPE((krb5_keytab, - krb5_keytab_entry *, - krb5_int32 *)); -krb5_error_code krb5_ktfileint_size_entry PROTOTYPE((krb5_keytab_entry *, - krb5_int32 *)); -krb5_error_code krb5_ktfileint_find_slot PROTOTYPE((krb5_keytab, - krb5_int32 *, - krb5_int32 *)); +krb5_error_code krb5_ktfile_add + PROTOTYPE((krb5_context, + krb5_keytab, + krb5_keytab_entry *)); + +krb5_error_code krb5_ktfile_remove + PROTOTYPE((krb5_context, + krb5_keytab, + krb5_keytab_entry *)); + +krb5_error_code krb5_ktfileint_openr + PROTOTYPE((krb5_context, + krb5_keytab)); + +krb5_error_code krb5_ktfileint_openw + PROTOTYPE((krb5_context, + krb5_keytab)); + +krb5_error_code krb5_ktfileint_close + PROTOTYPE((krb5_context, + krb5_keytab)); + +krb5_error_code krb5_ktfileint_read_entry + PROTOTYPE((krb5_context, + krb5_keytab, + krb5_keytab_entry *)); + +krb5_error_code krb5_ktfileint_write_entry + PROTOTYPE((krb5_context, + krb5_keytab, + krb5_keytab_entry *)); + +krb5_error_code krb5_ktfileint_delete_entry + PROTOTYPE((krb5_context, + krb5_keytab, + krb5_int32)); + +krb5_error_code krb5_ktfileint_internal_read_entry + PROTOTYPE((krb5_context, + krb5_keytab, + krb5_keytab_entry *, + krb5_int32 *)); + +krb5_error_code krb5_ktfileint_size_entry + PROTOTYPE((krb5_context, + krb5_keytab_entry *, + krb5_int32 *)); + +krb5_error_code krb5_ktfileint_find_slot + PROTOTYPE((krb5_context, + krb5_keytab, + krb5_int32 *, + krb5_int32 *)); + /* and back to normal... */ #include -- 2.26.2