diff options
-rw-r--r-- | src/lib/krb5/keytab/kt_file.c | 171 | ||||
-rw-r--r-- | src/lib/krb5/keytab/kt_memory.c | 80 | ||||
-rw-r--r-- | src/lib/krb5/keytab/kt_srvtab.c | 82 | ||||
-rw-r--r-- | src/lib/krb5/keytab/t_keytab.c | 12 |
4 files changed, 139 insertions, 206 deletions
diff --git a/src/lib/krb5/keytab/kt_file.c b/src/lib/krb5/keytab/kt_file.c index c27829c..3583506 100644 --- a/src/lib/krb5/keytab/kt_file.c +++ b/src/lib/krb5/keytab/kt_file.c @@ -94,104 +94,67 @@ typedef struct _krb5_ktfile_data { extern const struct _krb5_kt_ops krb5_ktf_ops; extern const struct _krb5_kt_ops krb5_ktf_writable_ops; -static krb5_error_code KRB5_CALLCONV krb5_ktfile_resolve -(krb5_context, - const char *, - krb5_keytab *); - -static krb5_error_code KRB5_CALLCONV krb5_ktfile_wresolve -(krb5_context, - const char *, - krb5_keytab *); - -static krb5_error_code KRB5_CALLCONV krb5_ktfile_get_name -(krb5_context, - krb5_keytab, - char *, - unsigned int); - -static krb5_error_code KRB5_CALLCONV krb5_ktfile_close -(krb5_context, - krb5_keytab); - -static krb5_error_code KRB5_CALLCONV krb5_ktfile_get_entry -(krb5_context, - krb5_keytab, - krb5_const_principal, - krb5_kvno, - krb5_enctype, - krb5_keytab_entry *); - -static krb5_error_code KRB5_CALLCONV krb5_ktfile_start_seq_get -(krb5_context, - krb5_keytab, - krb5_kt_cursor *); - -static krb5_error_code KRB5_CALLCONV krb5_ktfile_get_next -(krb5_context, - krb5_keytab, - krb5_keytab_entry *, - krb5_kt_cursor *); - -static krb5_error_code KRB5_CALLCONV krb5_ktfile_end_get -(krb5_context, - krb5_keytab, - krb5_kt_cursor *); +static krb5_error_code KRB5_CALLCONV +krb5_ktfile_resolve(krb5_context, const char *, krb5_keytab *); + +static krb5_error_code KRB5_CALLCONV +krb5_ktfile_wresolve(krb5_context, const char *, krb5_keytab *); + +static krb5_error_code KRB5_CALLCONV +krb5_ktfile_get_name(krb5_context, krb5_keytab, char *, unsigned int); + +static krb5_error_code KRB5_CALLCONV +krb5_ktfile_close(krb5_context, krb5_keytab); + +static krb5_error_code KRB5_CALLCONV +krb5_ktfile_get_entry(krb5_context, krb5_keytab, krb5_const_principal, + krb5_kvno, krb5_enctype, krb5_keytab_entry *); + +static krb5_error_code KRB5_CALLCONV +krb5_ktfile_start_seq_get(krb5_context, krb5_keytab, krb5_kt_cursor *); + +static krb5_error_code KRB5_CALLCONV +krb5_ktfile_get_next(krb5_context, krb5_keytab, krb5_keytab_entry *, + krb5_kt_cursor *); + +static krb5_error_code KRB5_CALLCONV +krb5_ktfile_end_get(krb5_context, krb5_keytab, krb5_kt_cursor *); /* routines to be included on extended version (write routines) */ -static krb5_error_code KRB5_CALLCONV krb5_ktfile_add -(krb5_context, - krb5_keytab, - krb5_keytab_entry *); - -static krb5_error_code KRB5_CALLCONV krb5_ktfile_remove -(krb5_context, - krb5_keytab, - krb5_keytab_entry *); - -static krb5_error_code krb5_ktfileint_openr -(krb5_context, - krb5_keytab); - -static krb5_error_code krb5_ktfileint_openw -(krb5_context, - krb5_keytab); - -static krb5_error_code krb5_ktfileint_close -(krb5_context, - krb5_keytab); - -static krb5_error_code krb5_ktfileint_read_entry -(krb5_context, - krb5_keytab, - krb5_keytab_entry *); - -static krb5_error_code krb5_ktfileint_write_entry -(krb5_context, - krb5_keytab, - krb5_keytab_entry *); - -static krb5_error_code krb5_ktfileint_delete_entry -(krb5_context, - krb5_keytab, - krb5_int32); - -static krb5_error_code krb5_ktfileint_internal_read_entry -(krb5_context, - krb5_keytab, - krb5_keytab_entry *, - krb5_int32 *); - -static krb5_error_code krb5_ktfileint_size_entry -(krb5_context, - krb5_keytab_entry *, - krb5_int32 *); - -static krb5_error_code krb5_ktfileint_find_slot -(krb5_context, - krb5_keytab, - krb5_int32 *, - krb5_int32 *); +static krb5_error_code KRB5_CALLCONV +krb5_ktfile_add(krb5_context, krb5_keytab, krb5_keytab_entry *); + +static krb5_error_code KRB5_CALLCONV +krb5_ktfile_remove(krb5_context, krb5_keytab, krb5_keytab_entry *); + +static krb5_error_code +krb5_ktfileint_openr(krb5_context, krb5_keytab); + +static krb5_error_code +krb5_ktfileint_openw(krb5_context, krb5_keytab); + +static krb5_error_code +krb5_ktfileint_close(krb5_context, krb5_keytab); + +static krb5_error_code +krb5_ktfileint_read_entry(krb5_context, krb5_keytab, krb5_keytab_entry *); + +static krb5_error_code +krb5_ktfileint_write_entry(krb5_context, krb5_keytab, krb5_keytab_entry *); + +static krb5_error_code +krb5_ktfileint_delete_entry(krb5_context, krb5_keytab, krb5_int32); + +static krb5_error_code +krb5_ktfileint_internal_read_entry(krb5_context, krb5_keytab, + krb5_keytab_entry *, krb5_int32 *); + +static krb5_error_code +krb5_ktfileint_size_entry(krb5_context, krb5_keytab_entry *, krb5_int32 *); + +static krb5_error_code +krb5_ktfileint_find_slot(krb5_context, krb5_keytab, krb5_int32 *, + krb5_int32 *); /* @@ -563,12 +526,16 @@ static const char ktfile_def_name[] = "."; * krb5_ktf_keytab_externalize(); * krb5_ktf_keytab_internalize(); */ -static krb5_error_code krb5_ktf_keytab_size -(krb5_context, krb5_pointer, size_t *); -static krb5_error_code krb5_ktf_keytab_externalize -(krb5_context, krb5_pointer, krb5_octet **, size_t *); -static krb5_error_code krb5_ktf_keytab_internalize -(krb5_context,krb5_pointer *, krb5_octet **, size_t *); +static krb5_error_code +krb5_ktf_keytab_size(krb5_context, krb5_pointer, size_t *); + +static krb5_error_code +krb5_ktf_keytab_externalize(krb5_context, krb5_pointer, krb5_octet **, + size_t *); + +static krb5_error_code +krb5_ktf_keytab_internalize(krb5_context,krb5_pointer *, krb5_octet **, + size_t *); /* * Serialization entry for this type. diff --git a/src/lib/krb5/keytab/kt_memory.c b/src/lib/krb5/keytab/kt_memory.c index d58ffee..54bbaf0 100644 --- a/src/lib/krb5/keytab/kt_memory.c +++ b/src/lib/krb5/keytab/kt_memory.c @@ -104,61 +104,45 @@ static k5_mutex_t krb5int_mkt_mutex = K5_MUTEX_PARTIAL_INITIALIZER; extern const struct _krb5_kt_ops krb5_mkt_ops; -krb5_error_code KRB5_CALLCONV krb5_mkt_resolve -(krb5_context, - const char *, - krb5_keytab *); - -krb5_error_code KRB5_CALLCONV krb5_mkt_get_name -(krb5_context, - krb5_keytab, - char *, - unsigned int); - -krb5_error_code KRB5_CALLCONV krb5_mkt_close -(krb5_context, - krb5_keytab); - -krb5_error_code KRB5_CALLCONV krb5_mkt_get_entry -(krb5_context, - krb5_keytab, - krb5_const_principal, - krb5_kvno, - krb5_enctype, - krb5_keytab_entry *); - -krb5_error_code KRB5_CALLCONV krb5_mkt_start_seq_get -(krb5_context, - krb5_keytab, - krb5_kt_cursor *); - -krb5_error_code KRB5_CALLCONV krb5_mkt_get_next -(krb5_context, - krb5_keytab, - krb5_keytab_entry *, - krb5_kt_cursor *); - -krb5_error_code KRB5_CALLCONV krb5_mkt_end_get -(krb5_context, - krb5_keytab, - krb5_kt_cursor *); +krb5_error_code KRB5_CALLCONV +krb5_mkt_resolve(krb5_context, const char *, krb5_keytab *); + +krb5_error_code KRB5_CALLCONV +krb5_mkt_get_name(krb5_context, krb5_keytab, char *, unsigned int); + +krb5_error_code KRB5_CALLCONV +krb5_mkt_close(krb5_context, krb5_keytab); + +krb5_error_code KRB5_CALLCONV +krb5_mkt_get_entry(krb5_context, krb5_keytab, krb5_const_principal, krb5_kvno, + krb5_enctype, krb5_keytab_entry *); + +krb5_error_code KRB5_CALLCONV +krb5_mkt_start_seq_get(krb5_context, krb5_keytab, krb5_kt_cursor *); + +krb5_error_code KRB5_CALLCONV +krb5_mkt_get_next(krb5_context, krb5_keytab, krb5_keytab_entry *, + krb5_kt_cursor *); + +krb5_error_code KRB5_CALLCONV +krb5_mkt_end_get(krb5_context, krb5_keytab, krb5_kt_cursor *); /* routines to be included on extended version (write routines) */ -krb5_error_code KRB5_CALLCONV krb5_mkt_add -(krb5_context, - krb5_keytab, - krb5_keytab_entry *); +krb5_error_code KRB5_CALLCONV +krb5_mkt_add(krb5_context, krb5_keytab, krb5_keytab_entry *); -krb5_error_code KRB5_CALLCONV krb5_mkt_remove -(krb5_context, - krb5_keytab, - krb5_keytab_entry *); +krb5_error_code KRB5_CALLCONV +krb5_mkt_remove(krb5_context, krb5_keytab, krb5_keytab_entry *); -int krb5int_mkt_initialize(void) { +int +krb5int_mkt_initialize(void) +{ return k5_mutex_finish_init(&krb5int_mkt_mutex); } -void krb5int_mkt_finalize(void) { +void +krb5int_mkt_finalize(void) +{ krb5_mkt_list_node *node, *next_node; krb5_mkt_cursor cursor, next_cursor; diff --git a/src/lib/krb5/keytab/kt_srvtab.c b/src/lib/krb5/keytab/kt_srvtab.c index a2e1304..01bd1ed 100644 --- a/src/lib/krb5/keytab/kt_srvtab.c +++ b/src/lib/krb5/keytab/kt_srvtab.c @@ -56,57 +56,37 @@ typedef struct _krb5_ktsrvtab_data { extern const struct _krb5_kt_ops krb5_kts_ops; -static krb5_error_code KRB5_CALLCONV krb5_ktsrvtab_resolve -(krb5_context, - const char *, - krb5_keytab *); - -static krb5_error_code KRB5_CALLCONV krb5_ktsrvtab_get_name -(krb5_context, - krb5_keytab, - char *, - unsigned int); - -static krb5_error_code KRB5_CALLCONV krb5_ktsrvtab_close -(krb5_context, - krb5_keytab); - -static krb5_error_code KRB5_CALLCONV krb5_ktsrvtab_get_entry -(krb5_context, - krb5_keytab, - krb5_const_principal, - krb5_kvno, - krb5_enctype, - krb5_keytab_entry *); - -static krb5_error_code KRB5_CALLCONV krb5_ktsrvtab_start_seq_get -(krb5_context, - krb5_keytab, - krb5_kt_cursor *); - -static krb5_error_code KRB5_CALLCONV krb5_ktsrvtab_get_next -(krb5_context, - krb5_keytab, - krb5_keytab_entry *, - krb5_kt_cursor *); - -static krb5_error_code KRB5_CALLCONV krb5_ktsrvtab_end_get -(krb5_context, - krb5_keytab, - krb5_kt_cursor *); - -static krb5_error_code krb5_ktsrvint_open -(krb5_context, - krb5_keytab); - -static krb5_error_code krb5_ktsrvint_close -(krb5_context, - krb5_keytab); - -static krb5_error_code krb5_ktsrvint_read_entry -(krb5_context, - krb5_keytab, - krb5_keytab_entry *); +static krb5_error_code KRB5_CALLCONV +krb5_ktsrvtab_resolve(krb5_context, const char *, krb5_keytab *); + +static krb5_error_code KRB5_CALLCONV +krb5_ktsrvtab_get_name(krb5_context, krb5_keytab, char *, unsigned int); + +static krb5_error_code KRB5_CALLCONV +krb5_ktsrvtab_close(krb5_context, krb5_keytab); + +static krb5_error_code KRB5_CALLCONV +krb5_ktsrvtab_get_entry(krb5_context, krb5_keytab, krb5_const_principal, + krb5_kvno, krb5_enctype, krb5_keytab_entry *); + +static krb5_error_code KRB5_CALLCONV +krb5_ktsrvtab_start_seq_get(krb5_context, krb5_keytab, krb5_kt_cursor *); + +static krb5_error_code KRB5_CALLCONV +krb5_ktsrvtab_get_next(krb5_context, krb5_keytab, krb5_keytab_entry *, + krb5_kt_cursor *); + +static krb5_error_code KRB5_CALLCONV +krb5_ktsrvtab_end_get(krb5_context, krb5_keytab, krb5_kt_cursor *); + +static krb5_error_code +krb5_ktsrvint_open(krb5_context, krb5_keytab); + +static krb5_error_code +krb5_ktsrvint_close(krb5_context, krb5_keytab); + +static krb5_error_code +krb5_ktsrvint_read_entry(krb5_context, krb5_keytab, krb5_keytab_entry *); /* * This is an implementation specific resolver. It returns a keytab id diff --git a/src/lib/krb5/keytab/t_keytab.c b/src/lib/krb5/keytab/t_keytab.c index 607ce9f..be7f684 100644 --- a/src/lib/krb5/keytab/t_keytab.c +++ b/src/lib/krb5/keytab/t_keytab.c @@ -60,7 +60,8 @@ extern const krb5_kt_ops krb5_ktf_writable_ops; exit(1); \ } else if(debug) printf("%s went ok\n", msg); -static void test_misc(krb5_context context) +static void +test_misc(krb5_context context) { /* Tests for certain error returns */ krb5_error_code kret; @@ -92,7 +93,8 @@ static void test_misc(krb5_context context) } } -static void kt_test(krb5_context context, const char *name) +static void +kt_test(krb5_context context, const char *name) { krb5_error_code kret; krb5_keytab kt; @@ -401,8 +403,8 @@ static void kt_test(krb5_context context, const char *name) } -static void do_test(krb5_context context, const char *prefix, - krb5_boolean delete) +static void +do_test(krb5_context context, const char *prefix, krb5_boolean delete) { char *name, *filename; @@ -425,7 +427,7 @@ static void do_test(krb5_context context, const char *prefix, } int -main (void) +main(void) { krb5_context context; krb5_error_code kret; |