From 21254625b6ce94e8340756c6cbd6b603fcfe720e Mon Sep 17 00:00:00 2001 From: Greg Hudson Date: Sat, 31 Oct 2009 03:03:54 +0000 Subject: [PATCH] In lib/krb5/krb, ensure all function definition headers are in ANSI style and have the function name at the beginning of a line. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@23102 dc483132-0cff-0310-8789-dd5450dbe970 --- src/lib/krb5/krb/appdefault.c | 6 +- src/lib/krb5/krb/copy_auth.c | 25 +++---- src/lib/krb5/krb/fast.c | 64 ++++++++++------- src/lib/krb5/krb/get_in_tkt.c | 3 +- src/lib/krb5/krb/gic_pwd.c | 10 +-- src/lib/krb5/krb/init_keyblock.c | 6 +- src/lib/krb5/krb/preauth2.c | 118 +++++++++++-------------------- src/lib/krb5/krb/t_authdata.c | 3 +- src/lib/krb5/krb/t_etypes.c | 9 +-- src/lib/krb5/krb/t_kerb.c | 18 +++-- 10 files changed, 122 insertions(+), 140 deletions(-) diff --git a/src/lib/krb5/krb/appdefault.c b/src/lib/krb5/krb/appdefault.c index 6fa8cd365..e3d14be37 100644 --- a/src/lib/krb5/krb/appdefault.c +++ b/src/lib/krb5/krb/appdefault.c @@ -21,7 +21,8 @@ static const char *const conf_no[] = { 0, }; -static int conf_boolean(char *s) +static int +conf_boolean(char *s) { const char * const *p; for(p=conf_yes; *p; p++) { @@ -36,7 +37,8 @@ static int conf_boolean(char *s) return 0; } -static krb5_error_code appdefault_get(krb5_context context, const char *appname, const krb5_data *realm, const char *option, char **ret_value) +static krb5_error_code +appdefault_get(krb5_context context, const char *appname, const krb5_data *realm, const char *option, char **ret_value) { profile_t profile; const char *names[5]; diff --git a/src/lib/krb5/krb/copy_auth.c b/src/lib/krb5/krb/copy_auth.c index 303badd2f..0262fe5bb 100644 --- a/src/lib/krb5/krb/copy_auth.c +++ b/src/lib/krb5/krb/copy_auth.c @@ -195,9 +195,9 @@ struct find_authdata_context { size_t length; }; -static krb5_error_code grow_find_authdata -(krb5_context context, struct find_authdata_context *fctx, - krb5_authdata *elem) +static krb5_error_code +grow_find_authdata(krb5_context context, struct find_authdata_context *fctx, + krb5_authdata *elem) { krb5_error_code retval = 0; if (fctx->length == fctx->space) { @@ -221,12 +221,9 @@ static krb5_error_code grow_find_authdata return retval; } - - - -static krb5_error_code find_authdata_1 -(krb5_context context, krb5_authdata *const *in_authdat, krb5_authdatatype ad_type, - struct find_authdata_context *fctx) +static krb5_error_code +find_authdata_1(krb5_context context, krb5_authdata *const *in_authdat, + krb5_authdatatype ad_type, struct find_authdata_context *fctx) { int i = 0; krb5_error_code retval=0; @@ -254,11 +251,11 @@ static krb5_error_code find_authdata_1 } -krb5_error_code krb5int_find_authdata -(krb5_context context, krb5_authdata *const * ticket_authdata, - krb5_authdata * const *ap_req_authdata, - krb5_authdatatype ad_type, - krb5_authdata ***results) +krb5_error_code +krb5int_find_authdata(krb5_context context, + krb5_authdata *const *ticket_authdata, + krb5_authdata *const *ap_req_authdata, + krb5_authdatatype ad_type, krb5_authdata ***results) { krb5_error_code retval = 0; struct find_authdata_context fctx; diff --git a/src/lib/krb5/krb/fast.c b/src/lib/krb5/krb/fast.c index ae5602cde..7d6bc274c 100644 --- a/src/lib/krb5/krb/fast.c +++ b/src/lib/krb5/krb/fast.c @@ -53,9 +53,10 @@ #include "int-proto.h" -static krb5_error_code fast_armor_ap_request -(krb5_context context, struct krb5int_fast_request_state *state, - krb5_ccache ccache, krb5_data *target_realm) +static krb5_error_code +fast_armor_ap_request(krb5_context context, + struct krb5int_fast_request_state *state, + krb5_ccache ccache, krb5_data *target_realm) { krb5_error_code retval = 0; krb5_creds creds, *out_creds = NULL; @@ -129,10 +130,11 @@ krb5int_fast_prep_req_body(krb5_context context, struct krb5int_fast_request_sta return retval; } -krb5_error_code krb5int_fast_as_armor -(krb5_context context, struct krb5int_fast_request_state *state, - krb5_gic_opt_ext *opte, - krb5_kdc_req *request) +krb5_error_code +krb5int_fast_as_armor(krb5_context context, + struct krb5int_fast_request_state *state, + krb5_gic_opt_ext *opte, + krb5_kdc_req *request) { krb5_error_code retval = 0; krb5_ccache ccache = NULL; @@ -159,10 +161,12 @@ krb5_error_code krb5int_fast_as_armor krb5_error_code -krb5int_fast_prep_req (krb5_context context, struct krb5int_fast_request_state *state, - krb5_kdc_req *request, - const krb5_data *to_be_checksummed, kdc_req_encoder_proc encoder, - krb5_data **encoded_request) +krb5int_fast_prep_req(krb5_context context, + struct krb5int_fast_request_state *state, + krb5_kdc_req *request, + const krb5_data *to_be_checksummed, + kdc_req_encoder_proc encoder, + krb5_data **encoded_request) { krb5_error_code retval = 0; krb5_pa_data *pa_array[2]; @@ -247,10 +251,11 @@ krb5int_fast_prep_req (krb5_context context, struct krb5int_fast_request_state * return retval; } -static krb5_error_code decrypt_fast_reply -(krb5_context context, struct krb5int_fast_request_state *state, - krb5_pa_data **in_padata, - krb5_fast_response **response) +static krb5_error_code +decrypt_fast_reply(krb5_context context, + struct krb5int_fast_request_state *state, + krb5_pa_data **in_padata, + krb5_fast_response **response) { krb5_error_code retval = 0; krb5_data scratch; @@ -319,8 +324,10 @@ static krb5_error_code decrypt_fast_reply * whenever padata is available (all the time with fast). */ krb5_error_code -krb5int_fast_process_error(krb5_context context, struct krb5int_fast_request_state *state, - krb5_error **err_replyptr , krb5_pa_data ***out_padata, +krb5int_fast_process_error(krb5_context context, + struct krb5int_fast_request_state *state, + krb5_error **err_replyptr, + krb5_pa_data ***out_padata, krb5_boolean *retry) { krb5_error_code retval = 0; @@ -410,10 +417,11 @@ krb5int_fast_process_error(krb5_context context, struct krb5int_fast_request_sta } -krb5_error_code krb5int_fast_process_response -(krb5_context context, struct krb5int_fast_request_state *state, - krb5_kdc_rep *resp, - krb5_keyblock **strengthen_key) +krb5_error_code +krb5int_fast_process_response(krb5_context context, + struct krb5int_fast_request_state *state, + krb5_kdc_rep *resp, + krb5_keyblock **strengthen_key) { krb5_error_code retval = 0; krb5_fast_response *fast_response = NULL; @@ -460,10 +468,11 @@ krb5_error_code krb5int_fast_process_response return retval; } -krb5_error_code krb5int_fast_reply_key(krb5_context context, - krb5_keyblock *strengthen_key, - krb5_keyblock *existing_key, - krb5_keyblock *out_key) +krb5_error_code +krb5int_fast_reply_key(krb5_context context, + krb5_keyblock *strengthen_key, + krb5_keyblock *existing_key, + krb5_keyblock *out_key) { krb5_keyblock *key = NULL; krb5_error_code retval = 0; @@ -503,8 +512,9 @@ krb5int_fast_free_state( krb5_context context, struct krb5int_fast_request_state free(state); } -krb5_pa_data * krb5int_find_pa_data -(krb5_context context, krb5_pa_data *const *padata, krb5_preauthtype pa_type) +krb5_pa_data * +krb5int_find_pa_data(krb5_context context, krb5_pa_data *const *padata, + krb5_preauthtype pa_type) { krb5_pa_data * const *tmppa; diff --git a/src/lib/krb5/krb/get_in_tkt.c b/src/lib/krb5/krb/get_in_tkt.c index 40afea56d..4fd837626 100644 --- a/src/lib/krb5/krb/get_in_tkt.c +++ b/src/lib/krb5/krb/get_in_tkt.c @@ -97,7 +97,8 @@ static krb5_error_code sort_krb5_padata_sequence(krb5_context context, * This function performs 32 bit bounded addition so we can generate * lifetimes without overflowing krb5_int32 */ -static krb5_int32 krb5int_addint32 (krb5_int32 x, krb5_int32 y) +static krb5_int32 +krb5int_addint32 (krb5_int32 x, krb5_int32 y) { if ((x > 0) && (y > (KRB5_INT32_MAX - x))) { /* sum will be be greater than KRB5_INT32_MAX */ diff --git a/src/lib/krb5/krb/gic_pwd.c b/src/lib/krb5/krb/gic_pwd.c index fa0c1739a..84e5b4965 100644 --- a/src/lib/krb5/krb/gic_pwd.c +++ b/src/lib/krb5/krb/gic_pwd.c @@ -407,10 +407,12 @@ cleanup: return(ret); } -krb5_error_code krb5int_populate_gic_opt ( - krb5_context context, krb5_gic_opt_ext **opte, - krb5_flags options, krb5_address * const *addrs, krb5_enctype *ktypes, - krb5_preauthtype *pre_auth_types, krb5_creds *creds) + +krb5_error_code +krb5int_populate_gic_opt(krb5_context context, krb5_gic_opt_ext **opte, + krb5_flags options, krb5_address *const *addrs, + krb5_enctype *ktypes, + krb5_preauthtype *pre_auth_types, krb5_creds *creds) { int i; krb5_int32 starttime; diff --git a/src/lib/krb5/krb/init_keyblock.c b/src/lib/krb5/krb/init_keyblock.c index baf7dabec..6fe663015 100644 --- a/src/lib/krb5/krb/init_keyblock.c +++ b/src/lib/krb5/krb/init_keyblock.c @@ -34,9 +34,9 @@ #include "k5-int.h" #include -krb5_error_code KRB5_CALLCONV krb5_init_keyblock -(krb5_context context, krb5_enctype enctype, - size_t length, krb5_keyblock **out) +krb5_error_code KRB5_CALLCONV +krb5_init_keyblock(krb5_context context, krb5_enctype enctype, + size_t length, krb5_keyblock **out) { return krb5int_c_init_keyblock (context, enctype, length, out); } diff --git a/src/lib/krb5/krb/preauth2.c b/src/lib/krb5/krb/preauth2.c index 7ee086037..c96f0f5b3 100644 --- a/src/lib/krb5/krb/preauth2.c +++ b/src/lib/krb5/krb/preauth2.c @@ -624,16 +624,11 @@ padata2data(krb5_pa_data p) return d; } -static -krb5_error_code pa_salt(krb5_context context, - krb5_kdc_req *request, - krb5_pa_data *in_padata, - krb5_pa_data **out_padata, - krb5_data *salt, krb5_data *s2kparams, - krb5_enctype *etype, - krb5_keyblock *as_key, - krb5_prompter_fct prompter, void *prompter_data, - krb5_gic_get_as_key_fct gak_fct, void *gak_data) +static krb5_error_code +pa_salt(krb5_context context, krb5_kdc_req *request, krb5_pa_data *in_padata, + krb5_pa_data **out_padata, krb5_data *salt, krb5_data *s2kparams, + krb5_enctype *etype, krb5_keyblock *as_key, krb5_prompter_fct prompter, + void *prompter_data, krb5_gic_get_as_key_fct gak_fct, void *gak_data) { krb5_data tmp; krb5_error_code retval; @@ -650,19 +645,13 @@ krb5_error_code pa_salt(krb5_context context, return(0); } -static -krb5_error_code pa_fx_cookie(krb5_context context, - krb5_kdc_req *request, - krb5_pa_data *in_padata, - krb5_pa_data **out_padata, - krb5_data *salt, - krb5_data *s2kparams, - krb5_enctype *etype, - krb5_keyblock *as_key, - krb5_prompter_fct prompter, - void *prompter_data, - krb5_gic_get_as_key_fct gak_fct, - void *gak_data) +static krb5_error_code +pa_fx_cookie(krb5_context context, krb5_kdc_req *request, + krb5_pa_data *in_padata, krb5_pa_data **out_padata, + krb5_data *salt, krb5_data *s2kparams, krb5_enctype *etype, + krb5_keyblock *as_key, krb5_prompter_fct prompter, + void *prompter_data, krb5_gic_get_as_key_fct gak_fct, + void *gak_data) { krb5_pa_data *pa = calloc(1, sizeof(krb5_pa_data)); krb5_octet *contents; @@ -680,19 +669,13 @@ krb5_error_code pa_fx_cookie(krb5_context context, return 0; } -static -krb5_error_code pa_enc_timestamp(krb5_context context, - krb5_kdc_req *request, - krb5_pa_data *in_padata, - krb5_pa_data **out_padata, - krb5_data *salt, - krb5_data *s2kparams, - krb5_enctype *etype, - krb5_keyblock *as_key, - krb5_prompter_fct prompter, - void *prompter_data, - krb5_gic_get_as_key_fct gak_fct, - void *gak_data) +static krb5_error_code +pa_enc_timestamp(krb5_context context, krb5_kdc_req *request, + krb5_pa_data *in_padata, krb5_pa_data **out_padata, + krb5_data *salt, krb5_data *s2kparams, krb5_enctype *etype, + krb5_keyblock *as_key, krb5_prompter_fct prompter, + void *prompter_data, krb5_gic_get_as_key_fct gak_fct, + void *gak_data) { krb5_error_code ret; krb5_pa_enc_ts pa_enc; @@ -770,8 +753,8 @@ krb5_error_code pa_enc_timestamp(krb5_context context, return(0); } -static -char *sam_challenge_banner(krb5_int32 sam_type) +static char * +sam_challenge_banner(krb5_int32 sam_type) { char *label; @@ -820,19 +803,11 @@ char *sam_challenge_banner(krb5_int32 sam_type) draft. This draft cannot be implemented as written. This code is compatible with earlier versions of mit krb5 and cygnus kerbnet. */ -static -krb5_error_code pa_sam(krb5_context context, - krb5_kdc_req *request, - krb5_pa_data *in_padata, - krb5_pa_data **out_padata, - krb5_data *salt, - krb5_data *s2kparams, - krb5_enctype *etype, - krb5_keyblock *as_key, - krb5_prompter_fct prompter, - void *prompter_data, - krb5_gic_get_as_key_fct gak_fct, - void *gak_data) +static krb5_error_code +pa_sam(krb5_context context, krb5_kdc_req *request, krb5_pa_data *in_padata, + krb5_pa_data **out_padata, krb5_data *salt, krb5_data *s2kparams, + krb5_enctype *etype, krb5_keyblock *as_key, krb5_prompter_fct prompter, + void *prompter_data, krb5_gic_get_as_key_fct gak_fct, void *gak_data) { krb5_error_code ret; krb5_data tmpsam; @@ -1380,20 +1355,13 @@ error_out: } #endif /* APPLE_PKINIT */ -static -krb5_error_code pa_sam_2(krb5_context context, - krb5_kdc_req *request, - krb5_pa_data *in_padata, - krb5_pa_data **out_padata, - krb5_data *salt, - krb5_data *s2kparams, - krb5_enctype *etype, - krb5_keyblock *as_key, - krb5_prompter_fct prompter, - void *prompter_data, - krb5_gic_get_as_key_fct gak_fct, - void *gak_data) { - +static krb5_error_code +pa_sam_2(krb5_context context, krb5_kdc_req *request, krb5_pa_data *in_padata, + krb5_pa_data **out_padata, krb5_data *salt, krb5_data *s2kparams, + krb5_enctype *etype, krb5_keyblock *as_key, + krb5_prompter_fct prompter, void *prompter_data, + krb5_gic_get_as_key_fct gak_fct, void *gak_data) +{ krb5_error_code retval; krb5_sam_challenge_2 *sc2 = NULL; krb5_sam_challenge_2_body *sc2b = NULL; @@ -1707,19 +1675,13 @@ krb5_error_code pa_sam_2(krb5_context context, return(0); } -static krb5_error_code pa_s4u_x509_user( - krb5_context context, - krb5_kdc_req *request, - krb5_pa_data *in_padata, - krb5_pa_data **out_padata, - krb5_data *salt, - krb5_data *s2kparams, - krb5_enctype *etype, - krb5_keyblock *as_key, - krb5_prompter_fct prompter, - void *prompter_data, - krb5_gic_get_as_key_fct gak_fct, - void *gak_data) +static krb5_error_code +pa_s4u_x509_user(krb5_context context, krb5_kdc_req *request, + krb5_pa_data *in_padata, krb5_pa_data **out_padata, + krb5_data *salt, krb5_data *s2kparams, krb5_enctype *etype, + krb5_keyblock *as_key, krb5_prompter_fct prompter, + void *prompter_data, krb5_gic_get_as_key_fct gak_fct, + void *gak_data) { krb5_s4u_userid *userid = (krb5_s4u_userid *)gak_data; /* XXX private contract */ krb5_pa_data *s4u_padata; diff --git a/src/lib/krb5/krb/t_authdata.c b/src/lib/krb5/krb/t_authdata.c index ed847dfbd..ac1f7a7c2 100644 --- a/src/lib/krb5/krb/t_authdata.c +++ b/src/lib/krb5/krb/t_authdata.c @@ -79,7 +79,8 @@ static void compare_authdata(const krb5_authdata *adc1, krb5_authdata *adc2) { assert(memcmp(adc1->contents, adc2->contents, adc1->length) == 0); } -int main() +int +main() { krb5_context context; krb5_authdata **results; diff --git a/src/lib/krb5/krb/t_etypes.c b/src/lib/krb5/krb/t_etypes.c index 4af7918e5..47763e594 100644 --- a/src/lib/krb5/krb/t_etypes.c +++ b/src/lib/krb5/krb/t_etypes.c @@ -131,7 +131,8 @@ static struct { } }; -static void show_enctypes(krb5_context ctx, krb5_enctype *list) +static void +show_enctypes(krb5_context ctx, krb5_enctype *list) { unsigned int i; @@ -143,9 +144,9 @@ static void show_enctypes(krb5_context ctx, krb5_enctype *list) fprintf(stderr, "\n"); } -static void compare(krb5_context ctx, krb5_enctype *result, - krb5_enctype *expected, const char *profstr, - krb5_boolean weak) +static void +compare(krb5_context ctx, krb5_enctype *result, krb5_enctype *expected, + const char *profstr, krb5_boolean weak) { unsigned int i; diff --git a/src/lib/krb5/krb/t_kerb.c b/src/lib/krb5/krb/t_kerb.c index 465282561..0f27ce9ce 100644 --- a/src/lib/krb5/krb/t_kerb.c +++ b/src/lib/krb5/krb/t_kerb.c @@ -25,7 +25,8 @@ void test_parse_name (krb5_context, const char *); void test_set_realm (krb5_context, const char *, const char *); void usage (char *); -void test_string_to_timestamp(krb5_context ctx, char *ktime) +void +test_string_to_timestamp(krb5_context ctx, char *ktime) { krb5_timestamp timestamp; time_t t; @@ -40,7 +41,8 @@ void test_string_to_timestamp(krb5_context ctx, char *ktime) printf("Parsed time was %s", ctime(&t)); } -void test_425_conv_principal(krb5_context ctx, char *name, char *inst, char *realm) +void +test_425_conv_principal(krb5_context ctx, char *name, char *inst, char *realm) { krb5_error_code retval; krb5_principal princ; @@ -62,7 +64,8 @@ void test_425_conv_principal(krb5_context ctx, char *name, char *inst, char *rea krb5_free_principal(ctx, princ); } -void test_524_conv_principal(krb5_context ctx, char *name) +void +test_524_conv_principal(krb5_context ctx, char *name) { krb5_principal princ = 0; krb5_error_code retval; @@ -89,7 +92,8 @@ fail: krb5_free_principal (ctx, princ); } -void test_parse_name(krb5_context ctx, const char *name) +void +test_parse_name(krb5_context ctx, const char *name) { krb5_error_code retval; krb5_principal princ = 0, princ2 = 0; @@ -124,7 +128,8 @@ fail: krb5_free_principal(ctx, princ2); } -void test_set_realm(krb5_context ctx, const char *name, const char *realm) +void +test_set_realm(krb5_context ctx, const char *name, const char *realm) { krb5_error_code retval; krb5_principal princ = 0; @@ -154,7 +159,8 @@ fail: krb5_free_principal(ctx, princ); } -void usage(char *progname) +void +usage(char *progname) { fprintf(stderr, "%s: Usage: %s 425_conv_principal