diff options
| author | Chris Provenzano <proven@mit.edu> | 1995-01-13 22:05:49 +0000 |
|---|---|---|
| committer | Chris Provenzano <proven@mit.edu> | 1995-01-13 22:05:49 +0000 |
| commit | 7a3dfafc7c240ec64248269f97f25fed1009e362 (patch) | |
| tree | b31628fd34740ee0f0bd068df615759084eaa6bb /src/include | |
| parent | ef4a40eef2b466b34a015a9419dccee2a9fd5ee4 (diff) | |
| download | krb5-7a3dfafc7c240ec64248269f97f25fed1009e362.tar.gz krb5-7a3dfafc7c240ec64248269f97f25fed1009e362.tar.xz krb5-7a3dfafc7c240ec64248269f97f25fed1009e362.zip | |
Removed all references to DECLARG and OLDDECLARG.
Added krb5_context to all krb5_*() routines.
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@4815 dc483132-0cff-0310-8789-dd5450dbe970
Diffstat (limited to 'src/include')
| -rw-r--r-- | src/include/krb5/ChangeLog | 8 | ||||
| -rw-r--r-- | src/include/krb5/base-defs.h | 25 | ||||
| -rw-r--r-- | src/include/krb5/ccache.h | 68 | ||||
| -rw-r--r-- | src/include/krb5/encryption.h | 46 | ||||
| -rw-r--r-- | src/include/krb5/free.h | 2 | ||||
| -rw-r--r-- | src/include/krb5/func-proto.h | 365 | ||||
| -rw-r--r-- | src/include/krb5/kdb.h | 86 | ||||
| -rw-r--r-- | src/include/krb5/kdb_dbm.h | 80 | ||||
| -rw-r--r-- | src/include/krb5/keytab.h | 72 | ||||
| -rw-r--r-- | src/include/krb5/krb5.h | 11 | ||||
| -rw-r--r-- | src/include/krb5/los-proto.h | 73 | ||||
| -rw-r--r-- | src/include/krb5/preauth.h | 14 | ||||
| -rw-r--r-- | src/include/krb5/rcache.h | 68 |
13 files changed, 575 insertions, 343 deletions
diff --git a/src/include/krb5/ChangeLog b/src/include/krb5/ChangeLog index d91a4000b..2ae4419db 100644 --- a/src/include/krb5/ChangeLog +++ b/src/include/krb5/ChangeLog @@ -1,3 +1,11 @@ +Fri Jan 13 15:23:47 1995 Chris Provenzano (proven@mit.edu) + + * Added krb5_context to all krb5_routines + + * Removed DECLARG and OLDDECLARG from base-defs.h (and any file that + was using it.) The next thing to do is make all narrow types + wide types and remove narrow.h and wide.h. + Thu Jan 12 01:55:54 1995 Mark Eichin <eichin@cygnus.com> * Makefile.in (install): constructed headers come from the build diff --git a/src/include/krb5/base-defs.h b/src/include/krb5/base-defs.h index f4bfa0189..12bd76309 100644 --- a/src/include/krb5/base-defs.h +++ b/src/include/krb5/base-defs.h @@ -85,18 +85,9 @@ typedef char const * krb5_const_pointer; #else #define STDARG_P(x) () #endif /* defined(__STDC__) || defined(STDARG_PROTOTYPES) */ -#ifdef NARROW_PROTOTYPES -#define DECLARG(type, val) type val -#define OLDDECLARG(type, val) -#else -#define DECLARG(type, val) val -#define OLDDECLARG(type, val) type val; -#endif /* NARROW_PROTOTYPES */ #else #define PROTOTYPE(x) () #define STDARG_P(x) () -#define DECLARG(type, val) val -#define OLDDECLARG(type, val) type val; #endif /* STDC or PROTOTYPES */ #ifdef NO_NESTED_PROTOTYPES @@ -135,13 +126,13 @@ typedef krb5_principal_data *krb5_principal; /* constant version thereof: */ typedef const krb5_principal_data *krb5_const_principal; -#define krb5_princ_realm(princ) (&(princ)->realm) -#define krb5_princ_set_realm(princ,value) ((princ)->realm = *(value)) -#define krb5_princ_set_realm_length(princ,value) (princ)->realm.length = (value) -#define krb5_princ_set_realm_data(princ,value) (princ)->realm.data = (value) -#define krb5_princ_size(princ) (princ)->length -#define krb5_princ_type(princ) (princ)->type -#define krb5_princ_name(princ) (princ)->data -#define krb5_princ_component(princ,i) ((princ)->data + i) +#define krb5_princ_realm(context, princ) (&(princ)->realm) +#define krb5_princ_set_realm(context, princ,value) ((princ)->realm = *(value)) +#define krb5_princ_set_realm_length(context, princ,value) (princ)->realm.length = (value) +#define krb5_princ_set_realm_data(context, princ,value) (princ)->realm.data = (value) +#define krb5_princ_size(context, princ) (princ)->length +#define krb5_princ_type(context, princ) (princ)->type +#define krb5_princ_name(context, princ) (princ)->data +#define krb5_princ_component(context, princ,i) ((princ)->data + i) #endif /* KRB5_BASE_DEFS__ */ diff --git a/src/include/krb5/ccache.h b/src/include/krb5/ccache.h index beeb740b6..880275846 100644 --- a/src/include/krb5/ccache.h +++ b/src/include/krb5/ccache.h @@ -39,25 +39,31 @@ typedef struct _krb5_ccache { typedef struct _krb5_cc_ops { krb5_magic magic; char *prefix; - char *(*get_name) NPROTOTYPE((krb5_ccache)); - krb5_error_code (*resolve) NPROTOTYPE((krb5_ccache *, char *)); - krb5_error_code (*gen_new) NPROTOTYPE((krb5_ccache *)); - krb5_error_code (*init) NPROTOTYPE((krb5_ccache, krb5_principal)); - krb5_error_code (*destroy) NPROTOTYPE((krb5_ccache)); - krb5_error_code (*close) NPROTOTYPE((krb5_ccache)); - krb5_error_code (*store) NPROTOTYPE((krb5_ccache, krb5_creds *)); - krb5_error_code (*retrieve) NPROTOTYPE((krb5_ccache, krb5_flags, - krb5_creds *, krb5_creds *)); - krb5_error_code (*get_princ) NPROTOTYPE((krb5_ccache, - krb5_principal *)); - krb5_error_code (*get_first) NPROTOTYPE((krb5_ccache, - krb5_cc_cursor *)); - krb5_error_code (*get_next) NPROTOTYPE((krb5_ccache, krb5_cc_cursor *, + char *(*get_name) NPROTOTYPE((krb5_context, krb5_ccache)); + krb5_error_code (*resolve) NPROTOTYPE((krb5_context, krb5_ccache *, + char *)); + krb5_error_code (*gen_new) NPROTOTYPE((krb5_context, krb5_ccache *)); + krb5_error_code (*init) NPROTOTYPE((krb5_context, krb5_ccache, + krb5_principal)); + krb5_error_code (*destroy) NPROTOTYPE((krb5_context, krb5_ccache)); + krb5_error_code (*close) NPROTOTYPE((krb5_context, krb5_ccache)); + krb5_error_code (*store) NPROTOTYPE((krb5_context, krb5_ccache, krb5_creds *)); - krb5_error_code (*end_get) NPROTOTYPE((krb5_ccache, krb5_cc_cursor *)); - krb5_error_code (*remove_cred) NPROTOTYPE((krb5_ccache, krb5_flags, - krb5_creds *)); - krb5_error_code (*set_flags) NPROTOTYPE((krb5_ccache, krb5_flags)); + krb5_error_code (*retrieve) NPROTOTYPE((krb5_context, krb5_ccache, + krb5_flags, krb5_creds *, + krb5_creds *)); + krb5_error_code (*get_princ) NPROTOTYPE((krb5_context, krb5_ccache, + krb5_principal *)); + krb5_error_code (*get_first) NPROTOTYPE((krb5_context, krb5_ccache, + krb5_cc_cursor *)); + krb5_error_code (*get_next) NPROTOTYPE((krb5_context, krb5_ccache, + krb5_cc_cursor *, krb5_creds *)); + krb5_error_code (*end_get) NPROTOTYPE((krb5_context, krb5_ccache, + krb5_cc_cursor *)); + krb5_error_code (*remove_cred) NPROTOTYPE((krb5_context, krb5_ccache, + krb5_flags, krb5_creds *)); + krb5_error_code (*set_flags) NPROTOTYPE((krb5_context, krb5_ccache, + krb5_flags)); } krb5_cc_ops; /* for retrieve_cred */ @@ -73,19 +79,19 @@ typedef struct _krb5_cc_ops { /* for set_flags and other functions */ #define KRB5_TC_OPENCLOSE 0x00000001 -#define krb5_cc_initialize(cache, principal) (*(cache)->ops->init)(cache, principal) -#define krb5_cc_gen_new(cache) (*(cache)->ops->gen_new)(cache) -#define krb5_cc_destroy(cache) (*(cache)->ops->destroy)(cache) -#define krb5_cc_close(cache) (*(cache)->ops->close)(cache) -#define krb5_cc_store_cred(cache, creds) (*(cache)->ops->store)(cache, creds) -#define krb5_cc_retrieve_cred(cache, flags, mcreds, creds) (*(cache)->ops->retrieve)(cache, flags, mcreds, creds) -#define krb5_cc_get_principal(cache, principal) (*(cache)->ops->get_princ)(cache, principal) -#define krb5_cc_start_seq_get(cache, cursor) (*(cache)->ops->get_first)(cache, cursor) -#define krb5_cc_next_cred(cache, cursor, creds) (*(cache)->ops->get_next)(cache, cursor, creds) -#define krb5_cc_end_seq_get(cache, cursor) (*(cache)->ops->end_get)(cache, cursor) -#define krb5_cc_remove_cred(cache, flags, creds) (*(cache)->ops->remove_cred)(cache,flags, creds) -#define krb5_cc_set_flags(cache, flags) (*(cache)->ops->set_flags)(cache, flags) -#define krb5_cc_get_name(cache) (*(cache)->ops->get_name)(cache) +#define krb5_cc_initialize(context, cache, principal) (*(cache)->ops->init)(context, cache, principal) +#define krb5_cc_gen_new(context, cache) (*(cache)->ops->gen_new)(context, cache) +#define krb5_cc_destroy(context, cache) (*(cache)->ops->destroy)(context, cache) +#define krb5_cc_close(context, cache) (*(cache)->ops->close)(context, cache) +#define krb5_cc_store_cred(context, cache, creds) (*(cache)->ops->store)(context, cache, creds) +#define krb5_cc_retrieve_cred(context, cache, flags, mcreds, creds) (*(cache)->ops->retrieve)(context, cache, flags, mcreds, creds) +#define krb5_cc_get_principal(context, cache, principal) (*(cache)->ops->get_princ)(context, cache, principal) +#define krb5_cc_start_seq_get(context, cache, cursor) (*(cache)->ops->get_first)(context, cache, cursor) +#define krb5_cc_next_cred(context, cache, cursor, creds) (*(cache)->ops->get_next)(context, cache, cursor, creds) +#define krb5_cc_end_seq_get(context, cache, cursor) (*(cache)->ops->end_get)(context, cache, cursor) +#define krb5_cc_remove_cred(context, cache, flags, creds) (*(cache)->ops->remove_cred)(context, cache,flags, creds) +#define krb5_cc_set_flags(context, cache, flags) (*(cache)->ops->set_flags)(context, cache, flags) +#define krb5_cc_get_name(context, cache) (*(cache)->ops->get_name)(context, cache) extern krb5_cc_ops *krb5_cc_dfl_ops; diff --git a/src/include/krb5/encryption.h b/src/include/krb5/encryption.h index b8978d7a9..0e538cc14 100644 --- a/src/include/krb5/encryption.h +++ b/src/include/krb5/encryption.h @@ -63,28 +63,28 @@ typedef struct _krb5_enc_data { /* could be used in a table to find an etype and initialize a block */ typedef struct _krb5_cryptosystem_entry { krb5_magic magic; - krb5_error_code (*encrypt_func) NPROTOTYPE((krb5_const_pointer /* in */, + krb5_error_code (*encrypt_func) NPROTOTYPE(( krb5_const_pointer /* in */, krb5_pointer /* out */, const size_t, krb5_encrypt_block *, krb5_pointer)); - krb5_error_code (*decrypt_func) NPROTOTYPE((krb5_const_pointer /* in */, + krb5_error_code (*decrypt_func) NPROTOTYPE(( krb5_const_pointer /* in */, krb5_pointer /* out */, const size_t, krb5_encrypt_block *, krb5_pointer)); - krb5_error_code (*process_key) NPROTOTYPE((krb5_encrypt_block *, + krb5_error_code (*process_key) NPROTOTYPE(( krb5_encrypt_block *, const krb5_keyblock *)); - krb5_error_code (*finish_key) NPROTOTYPE((krb5_encrypt_block *)); - krb5_error_code (*string_to_key) NPROTOTYPE((const krb5_encrypt_block *, + krb5_error_code (*finish_key) NPROTOTYPE(( krb5_encrypt_block *)); + krb5_error_code (*string_to_key) NPROTOTYPE(( const krb5_encrypt_block *, const krb5_keytype, krb5_keyblock *, const krb5_data *, const krb5_data *)); - krb5_error_code (*init_random_key) NPROTOTYPE((const krb5_keyblock *, + krb5_error_code (*init_random_key) NPROTOTYPE(( const krb5_keyblock *, krb5_pointer *)); - krb5_error_code (*finish_random_key) NPROTOTYPE((krb5_pointer *)); - krb5_error_code (*random_key) NPROTOTYPE((const krb5_encrypt_block *, + krb5_error_code (*finish_random_key) NPROTOTYPE(( krb5_pointer *)); + krb5_error_code (*random_key) NPROTOTYPE(( const krb5_encrypt_block *, krb5_pointer, krb5_keyblock **)); int block_length; @@ -109,7 +109,7 @@ typedef struct _krb5_cs_table_entry { /* could be used in a table to find a sumtype */ typedef struct _krb5_checksum_entry { krb5_magic magic; - krb5_error_code (*sum_func) NPROTOTYPE ((krb5_pointer /* in */, + krb5_error_code (*sum_func) NPROTOTYPE (( krb5_pointer /* in */, size_t /* in_length */, krb5_pointer /* key/seed */, size_t /* key/seed size */, @@ -180,26 +180,26 @@ extern int krb5_max_cksum; /* max entry in array */ #define is_keyed_cksum(cktype) (krb5_cksumarray[cktype]->uses_key) /* set up *eblockp to use etype */ -#define krb5_use_cstype(eblockp, etype) (eblockp)->crypto_entry = krb5_csarray[(etype)]->system +#define krb5_use_cstype(context, eblockp, etype) (eblockp)->crypto_entry = krb5_csarray[(etype)]->system /* ...or keytype */ -#define krb5_use_keytype(eblockp, keytype) (eblockp)->crypto_entry = krb5_keytype_array[(keytype)]->system +#define krb5_use_keytype(context, eblockp, keytype) (eblockp)->crypto_entry = krb5_keytype_array[(keytype)]->system -#define krb5_encrypt(inptr, outptr, size, eblock, ivec) (*(eblock)->crypto_entry->encrypt_func)(inptr, outptr, size, eblock, ivec) -#define krb5_decrypt(inptr, outptr, size, eblock, ivec) (*(eblock)->crypto_entry->decrypt_func)(inptr, outptr, size, eblock, ivec) -#define krb5_process_key(eblock, key) (*(eblock)->crypto_entry->process_key)(eblock, key) -#define krb5_finish_key(eblock) (*(eblock)->crypto_entry->finish_key)(eblock) -#define krb5_string_to_key(eblock, keytype, keyblock, data, princ) (*(eblock)->crypto_entry->string_to_key)(eblock, keytype, keyblock, data, princ) -#define krb5_init_random_key(eblock, keyblock, ptr) (*(eblock)->crypto_entry->init_random_key)(keyblock, ptr) -#define krb5_finish_random_key(eblock, ptr) (*(eblock)->crypto_entry->finish_random_key)(ptr) -#define krb5_random_key(eblock, ptr, keyblock) (*(eblock)->crypto_entry->random_key)(eblock, ptr, keyblock) +#define krb5_encrypt(context, inptr, outptr, size, eblock, ivec) (*(eblock)->crypto_entry->encrypt_func)(inptr, outptr, size, eblock, ivec) +#define krb5_decrypt(context, inptr, outptr, size, eblock, ivec) (*(eblock)->crypto_entry->decrypt_func)(inptr, outptr, size, eblock, ivec) +#define krb5_process_key(context, eblock, key) (*(eblock)->crypto_entry->process_key)(eblock, key) +#define krb5_finish_key(context, eblock) (*(eblock)->crypto_entry->finish_key)(eblock) +#define krb5_string_to_key(context, eblock, keytype, keyblock, data, princ) (*(eblock)->crypto_entry->string_to_key)(eblock, keytype, keyblock, data, princ) +#define krb5_init_random_key(context, eblock, keyblock, ptr) (*(eblock)->crypto_entry->init_random_key)(keyblock, ptr) +#define krb5_finish_random_key(context, eblock, ptr) (*(eblock)->crypto_entry->finish_random_key)(ptr) +#define krb5_random_key(context, eblock, ptr, keyblock) (*(eblock)->crypto_entry->random_key)(eblock, ptr, keyblock) -#define krb5_eblock_keytype(eblockp) ((eblockp)->crypto_entry->proto_keytype) -#define krb5_eblock_enctype(eblockp) ((eblockp)->crypto_entry->proto_enctype) +#define krb5_eblock_keytype(context, eblockp) ((eblockp)->crypto_entry->proto_keytype) +#define krb5_eblock_enctype(context, eblockp) ((eblockp)->crypto_entry->proto_enctype) /* * Here's the stuff for the checksum switch: */ -#define krb5_checksum_size(ctype) (krb5_cksumarray[ctype]->checksum_length) -#define krb5_calculate_checksum(ctype, in, in_length, seed, seed_length, outcksum) ((*krb5_cksumarray[ctype]->sum_func)(in, in_length, seed, seed_length, outcksum)) +#define krb5_checksum_size(context, ctype) (krb5_cksumarray[ctype]->checksum_length) +#define krb5_calculate_checksum(context, ctype, in, in_length, seed, seed_length, outcksum) ((*krb5_cksumarray[ctype]->sum_func)(in, in_length, seed, seed_length, outcksum)) #endif /* KRB5_ENCRYPTION__ */ diff --git a/src/include/krb5/free.h b/src/include/krb5/free.h index 637a7f4bf..600f3cd7c 100644 --- a/src/include/krb5/free.h +++ b/src/include/krb5/free.h @@ -31,6 +31,6 @@ /* to keep lint happy */ #define krb5_xfree(val) free((char *)(val)) -#define krb5_free_data(val) { krb5_xfree((val)->data); krb5_xfree(val);} +#define krb5_free_data(context, val) { krb5_xfree((val)->data); krb5_xfree(val);} #endif /* KRB5_FREE__ */ diff --git a/src/include/krb5/func-proto.h b/src/include/krb5/func-proto.h index f5def17a5..b4b6245e7 100644 --- a/src/include/krb5/func-proto.h +++ b/src/include/krb5/func-proto.h @@ -32,44 +32,57 @@ krb5_error_code krb5_init_context void krb5_free_context PROTOTYPE((krb5_context)); +/* This is a hack to find what needs fixing later, when we've all forgotten + which rotuines still need fixing */ +extern krb5_context global_context; + /* libkrb.spec */ krb5_error_code krb5_kdc_rep_decrypt_proc - PROTOTYPE((const krb5_keyblock *, + PROTOTYPE((krb5_context, + const krb5_keyblock *, krb5_const_pointer, krb5_kdc_rep * )); krb5_error_code krb5_encode_ticket - PROTOTYPE((const krb5_ticket *, + PROTOTYPE((krb5_context, + const krb5_ticket *, krb5_data ** )); krb5_error_code krb5_encrypt_tkt_part - PROTOTYPE((krb5_encrypt_block *, + PROTOTYPE((krb5_context, + krb5_encrypt_block *, const krb5_keyblock *, krb5_ticket * )); krb5_error_code krb5_decrypt_tkt_part - PROTOTYPE((const krb5_keyblock *, + PROTOTYPE((krb5_context, + const krb5_keyblock *, krb5_ticket * )); krb5_error_code krb5_get_cred_from_kdc - PROTOTYPE((krb5_ccache, /* not const, as reading may save + PROTOTYPE((krb5_context, + krb5_ccache, /* not const, as reading may save state */ krb5_creds *, krb5_creds *** )); void krb5_free_tgt_creds - PROTOTYPE((krb5_creds ** )); /* XXX too hard to do with const */ + PROTOTYPE((krb5_context, + krb5_creds ** )); /* XXX too hard to do with const */ #define KRB5_GC_USER_USER 1 /* want user-user ticket */ #define KRB5_GC_CACHED 2 /* want cached ticket only */ krb5_error_code krb5_get_credentials - PROTOTYPE((const krb5_flags, + PROTOTYPE((krb5_context, + const krb5_flags, krb5_ccache, krb5_creds * )); krb5_error_code krb5_mk_req - PROTOTYPE((krb5_const_principal, + PROTOTYPE((krb5_context, + krb5_const_principal, const krb5_flags, const krb5_checksum *, krb5_ccache, krb5_data * )); krb5_error_code krb5_mk_req_extended - PROTOTYPE((const krb5_flags, + PROTOTYPE((krb5_context, + const krb5_flags, const krb5_checksum *, const krb5_flags, krb5_int32, @@ -79,26 +92,32 @@ krb5_error_code krb5_mk_req_extended krb5_authenticator *, krb5_data * )); krb5_error_code krb5_rd_req_simple - PROTOTYPE((const krb5_data *, + PROTOTYPE((krb5_context, + const krb5_data *, krb5_const_principal, const krb5_address *, krb5_tkt_authent ** )); krb5_error_code krb5_mk_rep - PROTOTYPE((const krb5_ap_rep_enc_part *, + PROTOTYPE((krb5_context, + const krb5_ap_rep_enc_part *, const krb5_keyblock *, krb5_data *)); krb5_error_code krb5_rd_rep - PROTOTYPE((const krb5_data *, + PROTOTYPE((krb5_context, + const krb5_data *, const krb5_keyblock *, krb5_ap_rep_enc_part **)); krb5_error_code krb5_mk_error - PROTOTYPE((const krb5_error *, + PROTOTYPE((krb5_context, + const krb5_error *, krb5_data * )); krb5_error_code krb5_rd_error - PROTOTYPE((const krb5_data *, + PROTOTYPE((krb5_context, + const krb5_data *, krb5_error ** )); krb5_error_code krb5_rd_safe - PROTOTYPE((const krb5_data *, + PROTOTYPE((krb5_context, + const krb5_data *, const krb5_keyblock *, const krb5_address *, const krb5_address *, @@ -106,7 +125,8 @@ krb5_error_code krb5_rd_safe krb5_rcache, krb5_data * )); krb5_error_code krb5_rd_priv - PROTOTYPE((const krb5_data *, + PROTOTYPE((krb5_context, + const krb5_data *, const krb5_keyblock *, const krb5_address *, const krb5_address *, @@ -115,202 +135,270 @@ krb5_error_code krb5_rd_priv krb5_rcache, krb5_data * )); krb5_error_code krb5_parse_name - PROTOTYPE((const char *, + PROTOTYPE((krb5_context, + const char *, krb5_principal * )); krb5_error_code krb5_unparse_name - PROTOTYPE((krb5_const_principal, + PROTOTYPE((krb5_context, + krb5_const_principal, char ** )); krb5_error_code krb5_unparse_name_ext - PROTOTYPE((krb5_const_principal, + PROTOTYPE((krb5_context, + krb5_const_principal, char **, int *)); krb5_boolean krb5_address_search - PROTOTYPE((const krb5_address *, + PROTOTYPE((krb5_context, + const krb5_address *, krb5_address * const *)); krb5_boolean krb5_address_compare - PROTOTYPE((const krb5_address *, + PROTOTYPE((krb5_context, + const krb5_address *, const krb5_address *)); int krb5_address_order - PROTOTYPE((const krb5_address *, + PROTOTYPE((krb5_context, + const krb5_address *, const krb5_address *)); krb5_boolean krb5_realm_compare - PROTOTYPE((krb5_const_principal, + PROTOTYPE((krb5_context, + krb5_const_principal, krb5_const_principal)); krb5_boolean krb5_principal_compare - PROTOTYPE((krb5_const_principal, + PROTOTYPE((krb5_context, + krb5_const_principal, krb5_const_principal)); int krb5_fulladdr_order - PROTOTYPE((const krb5_fulladdr *, + PROTOTYPE((krb5_context, + const krb5_fulladdr *, const krb5_fulladdr *)); krb5_error_code krb5_copy_keyblock - PROTOTYPE((const krb5_keyblock *, + PROTOTYPE((krb5_context, + const krb5_keyblock *, krb5_keyblock **)); krb5_error_code krb5_copy_keyblock_contents - PROTOTYPE((const krb5_keyblock *, + PROTOTYPE((krb5_context, + const krb5_keyblock *, krb5_keyblock *)); krb5_error_code krb5_copy_creds - PROTOTYPE((const krb5_creds *, + PROTOTYPE((krb5_context, + const krb5_creds *, krb5_creds **)); krb5_error_code krb5_copy_data - PROTOTYPE((const krb5_data *, + PROTOTYPE((krb5_context, + const krb5_data *, krb5_data **)); krb5_error_code krb5_copy_principal - PROTOTYPE((krb5_const_principal, + PROTOTYPE((krb5_context, + krb5_const_principal, krb5_principal *)); krb5_error_code krb5_copy_addresses - PROTOTYPE((krb5_address * const *, + PROTOTYPE((krb5_context, + krb5_address * const *, krb5_address ***)); krb5_error_code krb5_copy_ticket - PROTOTYPE((const krb5_ticket *, krb5_ticket **)); + PROTOTYPE((krb5_context, + const krb5_ticket *, krb5_ticket **)); krb5_error_code krb5_copy_authdata - PROTOTYPE((krb5_authdata * const *, + PROTOTYPE((krb5_context, + krb5_authdata * const *, krb5_authdata ***)); krb5_error_code krb5_copy_authenticator - PROTOTYPE((const krb5_authenticator *, + PROTOTYPE((krb5_context, + const krb5_authenticator *, krb5_authenticator **)); krb5_error_code krb5_copy_checksum - PROTOTYPE((const krb5_checksum *, + PROTOTYPE((krb5_context, + const krb5_checksum *, krb5_checksum **)); -void krb5_init_ets PROTOTYPE((void)); +void krb5_init_ets PROTOTYPE((krb5_context)); krb5_error_code krb5_generate_subkey - PROTOTYPE((const krb5_keyblock *, krb5_keyblock **)); + PROTOTYPE((krb5_context, + const krb5_keyblock *, krb5_keyblock **)); krb5_error_code krb5_generate_seq_number - PROTOTYPE((const krb5_keyblock *, krb5_int32 *)); + PROTOTYPE((krb5_context, + const krb5_keyblock *, krb5_int32 *)); krb5_error_code krb5_get_server_rcache - PROTOTYPE((const krb5_data *, krb5_rcache *)); + PROTOTYPE((krb5_context, + const krb5_data *, krb5_rcache *)); krb5_error_code krb5_build_principal_ext - STDARG_P((krb5_principal *, int, const char *, ...)); + STDARG_P((krb5_context, krb5_principal *, int, const char *, ...)); krb5_error_code krb5_build_principal - STDARG_P((krb5_principal *, int, const char *, ...)); + STDARG_P((krb5_context, krb5_principal *, int, const char *, ...)); #ifdef va_start /* XXX depending on varargs include file defining va_start... */ krb5_error_code krb5_build_principal_va - PROTOTYPE((krb5_principal *, int, const char *, va_list)); + PROTOTYPE((krb5_context, + krb5_principal *, int, const char *, va_list)); #endif krb5_error_code krb5_425_conv_principal - PROTOTYPE((const char *name, const char *instance, const char *realm, + PROTOTYPE((krb5_context, + const char *name, const char *instance, const char *realm, krb5_principal *princ)); krb5_error_code krb5_obtain_padata - PROTOTYPE((int type, krb5_principal client, krb5_address **src_addr, + PROTOTYPE((krb5_context, + int type, krb5_principal client, krb5_address **src_addr, krb5_keyblock *encrypt_key, krb5_pa_data **data)); krb5_error_code krb5_verify_padata - PROTOTYPE((krb5_pa_data * data, krb5_principal client, + PROTOTYPE((krb5_context, + krb5_pa_data * data, krb5_principal client, krb5_address **src_addr, krb5_keyblock *decrypt_key, int *req_id, int *flags)); /* libkt.spec */ krb5_error_code krb5_kt_register - PROTOTYPE((krb5_kt_ops * )); + PROTOTYPE((krb5_context, + krb5_kt_ops * )); krb5_error_code krb5_kt_resolve - PROTOTYPE((const char *, + PROTOTYPE((krb5_context, + const char *, krb5_keytab * )); krb5_error_code krb5_kt_default_name - PROTOTYPE((char *, + PROTOTYPE((krb5_context, + char *, int )); krb5_error_code krb5_kt_default - PROTOTYPE((krb5_keytab * )); + PROTOTYPE((krb5_context, + krb5_keytab * )); krb5_error_code krb5_kt_free_entry - PROTOTYPE((krb5_keytab_entry * )); + PROTOTYPE((krb5_context, + krb5_keytab_entry * )); /* remove and add are functions, so that they can return NOWRITE if not a writable keytab */ krb5_error_code krb5_kt_remove_entry - PROTOTYPE((krb5_keytab, + PROTOTYPE((krb5_context, + krb5_keytab, krb5_keytab_entry * )); krb5_error_code krb5_kt_add_entry - PROTOTYPE((krb5_keytab, + PROTOTYPE((krb5_context, + krb5_keytab, krb5_keytab_entry * )); krb5_error_code krb5_principal2salt - PROTOTYPE((krb5_const_principal, krb5_data *)); + PROTOTYPE((krb5_context, + krb5_const_principal, krb5_data *)); krb5_error_code krb5_principal2salt_norealm - PROTOTYPE((krb5_const_principal, krb5_data *)); + PROTOTYPE((krb5_context, + krb5_const_principal, krb5_data *)); /* librc.spec--see rcache.h */ /* libcc.spec */ krb5_error_code krb5_cc_resolve - PROTOTYPE((char *, + PROTOTYPE((krb5_context, + char *, krb5_ccache * )); krb5_error_code krb5_cc_generate_new - PROTOTYPE((krb5_cc_ops *, + PROTOTYPE((krb5_context, + krb5_cc_ops *, krb5_ccache * )); char *krb5_cc_default_name - PROTOTYPE((void )); + PROTOTYPE((krb5_context)); krb5_error_code krb5_cc_default - PROTOTYPE((krb5_ccache *)); + PROTOTYPE((krb5_context, + krb5_ccache *)); /* chk_trans.c */ krb5_error_code krb5_check_transited_list - PROTOTYPE((krb5_data *trans, krb5_data *realm1, krb5_data *realm2)); + PROTOTYPE((krb5_context, + krb5_data *trans, krb5_data *realm1, krb5_data *realm2)); /* free_rtree.c */ void krb5_free_realm_tree - PROTOTYPE((krb5_principal *)); + PROTOTYPE((krb5_context, + krb5_principal *)); /* krb5_free.c */ void krb5_free_principal - PROTOTYPE((krb5_principal )); + PROTOTYPE((krb5_context, + krb5_principal )); void krb5_free_authenticator - PROTOTYPE((krb5_authenticator * )); + PROTOTYPE((krb5_context, + krb5_authenticator * )); void krb5_free_authenticator_contents - PROTOTYPE((krb5_authenticator * )); + PROTOTYPE((krb5_context, + krb5_authenticator * )); void krb5_free_addresses - PROTOTYPE((krb5_address ** )); + PROTOTYPE((krb5_context, + krb5_address ** )); void krb5_free_address - PROTOTYPE((krb5_address * )); + PROTOTYPE((krb5_context, + krb5_address * )); void krb5_free_authdata - PROTOTYPE((krb5_authdata ** )); + PROTOTYPE((krb5_context, + krb5_authdata ** )); void krb5_free_enc_tkt_part - PROTOTYPE((krb5_enc_tkt_part * )); + PROTOTYPE((krb5_context, + krb5_enc_tkt_part * )); void krb5_free_ticket - PROTOTYPE((krb5_ticket * )); + PROTOTYPE((krb5_context, + krb5_ticket * )); void krb5_free_tickets - PROTOTYPE((krb5_ticket ** )); + PROTOTYPE((krb5_context, + krb5_ticket ** )); void krb5_free_kdc_req - PROTOTYPE((krb5_kdc_req * )); + PROTOTYPE((krb5_context, + krb5_kdc_req * )); void krb5_free_kdc_rep - PROTOTYPE((krb5_kdc_rep * )); + PROTOTYPE((krb5_context, + krb5_kdc_rep * )); void krb5_free_last_req - PROTOTYPE((krb5_last_req_entry ** )); + PROTOTYPE((krb5_context, + krb5_last_req_entry ** )); void krb5_free_enc_kdc_rep_part - PROTOTYPE((krb5_enc_kdc_rep_part * )); + PROTOTYPE((krb5_context, + krb5_enc_kdc_rep_part * )); void krb5_free_error - PROTOTYPE((krb5_error * )); + PROTOTYPE((krb5_context, + krb5_error * )); void krb5_free_ap_req - PROTOTYPE((krb5_ap_req * )); + PROTOTYPE((krb5_context, + krb5_ap_req * )); void krb5_free_ap_rep - PROTOTYPE((krb5_ap_rep * )); + PROTOTYPE((krb5_context, + krb5_ap_rep * )); void krb5_free_safe - PROTOTYPE((krb5_safe * )); + PROTOTYPE((krb5_context, + krb5_safe * )); void krb5_free_priv - PROTOTYPE((krb5_priv * )); + PROTOTYPE((krb5_context, + krb5_priv * )); void krb5_free_priv_enc_part - PROTOTYPE((krb5_priv_enc_part * )); + PROTOTYPE((krb5_context, + krb5_priv_enc_part * )); void krb5_free_kdc_req - PROTOTYPE((krb5_kdc_req * )); + PROTOTYPE((krb5_context, + krb5_kdc_req * )); void krb5_free_creds - PROTOTYPE((krb5_creds *)); + PROTOTYPE((krb5_context, + krb5_creds *)); void krb5_free_cred_contents - PROTOTYPE((krb5_creds *)); + PROTOTYPE((krb5_context, + krb5_creds *)); void krb5_free_checksum - PROTOTYPE((krb5_checksum *)); + PROTOTYPE((krb5_context, + krb5_checksum *)); void krb5_free_keyblock - PROTOTYPE((krb5_keyblock *)); + PROTOTYPE((krb5_context, + krb5_keyblock *)); void krb5_free_pa_data - PROTOTYPE((krb5_pa_data **)); + PROTOTYPE((krb5_context, + krb5_pa_data **)); void krb5_free_ap_rep_enc_part - PROTOTYPE((krb5_ap_rep_enc_part *)); + PROTOTYPE((krb5_context, + krb5_ap_rep_enc_part *)); void krb5_free_tkt_authent - PROTOTYPE((krb5_tkt_authent *)); + PROTOTYPE((krb5_context, + krb5_tkt_authent *)); #include <krb5/widen.h> /* Only put things which don't have pointers to the narrow types in this section */ krb5_error_code krb5_encode_kdc_rep - PROTOTYPE((const krb5_msgtype, + PROTOTYPE((krb5_context, + const krb5_msgtype, const krb5_enc_kdc_rep_part *, krb5_encrypt_block *, const krb5_keyblock *, @@ -318,7 +406,8 @@ krb5_error_code krb5_encode_kdc_rep krb5_data ** )); krb5_error_code krb5_send_tgs - PROTOTYPE((const krb5_flags, + PROTOTYPE((krb5_context, + const krb5_flags, const krb5_ticket_times *, const krb5_enctype, const krb5_cksumtype, @@ -331,17 +420,20 @@ krb5_error_code krb5_send_tgs krb5_response * )); krb5_error_code krb5_get_in_tkt - PROTOTYPE((const krb5_flags, + PROTOTYPE((krb5_context, + const krb5_flags, krb5_address * const *, const krb5_preauthtype, const krb5_enctype, const krb5_keytype, - krb5_error_code (* )(const krb5_keytype, + krb5_error_code (* )(krb5_context, + const krb5_keytype, krb5_keyblock **, krb5_const_pointer, krb5_pa_data **), krb5_const_pointer, - krb5_error_code (* )(const krb5_keyblock *, + krb5_error_code (* )(krb5_context, + const krb5_keyblock *, krb5_const_pointer, krb5_kdc_rep * ), krb5_const_pointer, @@ -350,7 +442,8 @@ krb5_error_code krb5_get_in_tkt krb5_kdc_rep ** )); krb5_error_code krb5_get_in_tkt_with_password - PROTOTYPE((const krb5_flags, + PROTOTYPE((krb5_context, + const krb5_flags, krb5_address * const *, const krb5_preauthtype pre_auth_type, const krb5_enctype, @@ -361,7 +454,8 @@ krb5_error_code krb5_get_in_tkt_with_password krb5_kdc_rep ** )); krb5_error_code krb5_get_in_tkt_with_skey - PROTOTYPE((const krb5_flags, + PROTOTYPE((krb5_context, + const krb5_flags, krb5_address * const *, const krb5_preauthtype pre_auth_type, const krb5_enctype, @@ -371,19 +465,22 @@ krb5_error_code krb5_get_in_tkt_with_skey krb5_kdc_rep ** )); krb5_error_code krb5_decode_kdc_rep - PROTOTYPE((krb5_data *, + PROTOTYPE((krb5_context, + krb5_data *, const krb5_keyblock *, const krb5_enctype, krb5_kdc_rep ** )); -typedef krb5_error_code (*krb5_rdreq_key_proc) PROTOTYPE((krb5_pointer, +typedef krb5_error_code (*krb5_rdreq_key_proc) PROTOTYPE((krb5_context, + krb5_pointer, krb5_principal, krb5_kvno, krb5_keyblock **)); krb5_error_code krb5_rd_req - PROTOTYPE((const krb5_data *, + PROTOTYPE((krb5_context, + const krb5_data *, krb5_const_principal, const krb5_address *, const char *, @@ -393,7 +490,8 @@ krb5_error_code krb5_rd_req krb5_tkt_authent ** )); krb5_error_code krb5_rd_req_decoded - PROTOTYPE((const krb5_ap_req *, + PROTOTYPE((krb5_context, + const krb5_ap_req *, krb5_const_principal, const krb5_address *, const char *, @@ -403,12 +501,14 @@ krb5_error_code krb5_rd_req_decoded krb5_tkt_authent ** )); krb5_error_code krb5_kt_read_service_key - PROTOTYPE((krb5_pointer, + PROTOTYPE((krb5_context, + krb5_pointer, krb5_principal, krb5_kvno, krb5_keyblock **)); krb5_error_code krb5_mk_safe - PROTOTYPE((const krb5_data *, + PROTOTYPE((krb5_context, + const krb5_data *, const krb5_cksumtype , const krb5_keyblock *, const krb5_address *, @@ -417,7 +517,8 @@ krb5_error_code krb5_mk_safe krb5_rcache, krb5_data * )); krb5_error_code krb5_mk_priv - PROTOTYPE((const krb5_data *, + PROTOTYPE((krb5_context, + const krb5_data *, const krb5_enctype, const krb5_keyblock *, const krb5_address *, @@ -427,46 +528,52 @@ krb5_error_code krb5_mk_priv krb5_pointer, krb5_data * )); krb5_error_code krb5_cc_register - PROTOTYPE((krb5_cc_ops *, + PROTOTYPE((krb5_context, + krb5_cc_ops *, krb5_boolean )); -krb5_error_code krb5_sendauth PROTOTYPE((krb5_pointer, - char *, - krb5_principal, - krb5_principal, - krb5_flags, - krb5_checksum *, - krb5_creds *, - krb5_ccache, - krb5_int32 *, - krb5_keyblock **, - krb5_error **, - krb5_ap_rep_enc_part **)); +krb5_error_code krb5_sendauth + PROTOTYPE((krb5_context, + krb5_pointer, + char *, + krb5_principal, + krb5_principal, + krb5_flags, + krb5_checksum *, + krb5_creds *, + krb5_ccache, + krb5_int32 *, + krb5_keyblock **, + krb5_error **, + krb5_ap_rep_enc_part **)); -krb5_error_code krb5_recvauth PROTOTYPE((krb5_pointer, - char *, - krb5_principal, - krb5_address *, - krb5_pointer, - krb5_rdreq_key_proc, - krb5_pointer, - char *, - krb5_int32, - krb5_int32 *, - krb5_principal*, - krb5_ticket **, - krb5_authenticator **)); +krb5_error_code krb5_recvauth PROTOTYPE((krb5_context, + krb5_pointer, + char *, + krb5_principal, + krb5_address *, + krb5_pointer, + krb5_rdreq_key_proc, + krb5_pointer, + char *, + krb5_int32, + krb5_int32 *, + krb5_principal*, + krb5_ticket **, + krb5_authenticator **)); #ifdef NARROW_PROTOTYPES krb5_error_code krb5_walk_realm_tree - PROTOTYPE((const krb5_data *, + PROTOTYPE((krb5_context, + const krb5_data *, const krb5_data *, krb5_principal **, char)); #else krb5_error_code krb5_walk_realm_tree - PROTOTYPE((const krb5_data *, + PROTOTYPE((krb5_context, + const krb5_data *, const krb5_data *, krb5_principal **, int)); diff --git a/src/include/krb5/kdb.h b/src/include/krb5/kdb.h index 8bf2e9e0f..2f954fd29 100644 --- a/src/include/krb5/kdb.h +++ b/src/include/krb5/kdb.h @@ -101,8 +101,8 @@ typedef struct _krb5_db_entry { /* XXX depends on knowledge of krb5_parse_name() formats */ #define KRB5_KDB_M_NAME "K/M" /* Kerberos/Master */ -#define KDB_CONVERT_KEY_TO_DB(in,out) krb5_kdb_encrypt_key(&master_encblock, in, out) -#define KDB_CONVERT_KEY_OUTOF_DB(in, out) krb5_kdb_decrypt_key(&master_encblock, in, out) +#define KDB_CONVERT_KEY_TO_DB(context,in,out) krb5_kdb_encrypt_key(context,&master_encblock, in, out) +#define KDB_CONVERT_KEY_OUTOF_DB(context,in, out) krb5_kdb_decrypt_key(context,&master_encblock, in, out) /* prompts used by default when reading the KDC password from the keyboard. */ #define KRB5_KDC_MKEY_1 "Enter KDC database master key:" @@ -114,71 +114,96 @@ extern char *krb5_mkey_pwd_prompt2; /* libkdb.spec */ krb5_error_code krb5_db_set_name - PROTOTYPE((char * )); + PROTOTYPE((krb5_context, + char * )); krb5_error_code krb5_db_init - PROTOTYPE((void )); + PROTOTYPE((krb5_context)); krb5_error_code krb5_db_fini - PROTOTYPE((void )); + PROTOTYPE((krb5_context)); krb5_error_code krb5_db_get_age - PROTOTYPE((char *, + PROTOTYPE((krb5_context, + char *, time_t * )); krb5_error_code krb5_db_create - PROTOTYPE((char * )); + PROTOTYPE((krb5_context, + char * )); krb5_error_code krb5_db_rename - PROTOTYPE((char *, + PROTOTYPE((krb5_context, + char *, char * )); krb5_error_code krb5_db_get_principal - PROTOTYPE((krb5_principal , + PROTOTYPE((krb5_context, + krb5_principal , krb5_db_entry *, int *, krb5_boolean * )); void krb5_db_free_principal - PROTOTYPE((krb5_db_entry *, + PROTOTYPE((krb5_context, + krb5_db_entry *, int )); krb5_error_code krb5_db_put_principal - PROTOTYPE((krb5_db_entry *, + PROTOTYPE((krb5_context, + krb5_db_entry *, int * )); krb5_error_code krb5_db_delete_principal - PROTOTYPE((krb5_principal, + PROTOTYPE((krb5_context, + krb5_principal, int * )); krb5_error_code krb5_db_iterate - PROTOTYPE((krb5_error_code (* ) PROTOTYPE((krb5_pointer, + PROTOTYPE((krb5_context, + krb5_error_code (* ) PROTOTYPE((krb5_pointer, krb5_db_entry *)), krb5_pointer )); krb5_error_code krb5_db_verify_master_key - PROTOTYPE((krb5_principal, krb5_keyblock *, krb5_encrypt_block *)); -krb5_error_code krb5_db_store_mkey PROTOTYPE((char *, - krb5_principal, - krb5_keyblock *)); + PROTOTYPE((krb5_context, + krb5_principal, + krb5_keyblock *, + krb5_encrypt_block *)); +krb5_error_code krb5_db_store_mkey + PROTOTYPE((krb5_context, + char *, + krb5_principal, + krb5_keyblock *)); krb5_error_code krb5_kdb_encrypt_key - PROTOTYPE((krb5_encrypt_block *, + PROTOTYPE((krb5_context, + krb5_encrypt_block *, const krb5_keyblock *, krb5_encrypted_keyblock *)); krb5_error_code krb5_kdb_decrypt_key - PROTOTYPE((krb5_encrypt_block *, + PROTOTYPE((krb5_context, + krb5_encrypt_block *, const krb5_encrypted_keyblock *, krb5_keyblock *)); krb5_error_code krb5_db_setup_mkey_name - PROTOTYPE((const char *, const char *, char **, krb5_principal *)); + PROTOTYPE((krb5_context, + const char *, + const char *, + char **, + krb5_principal *)); krb5_error_code krb5_db_lock - PROTOTYPE((int )); + PROTOTYPE((krb5_context, + int )); krb5_error_code krb5_db_unlock - PROTOTYPE ((void )); + PROTOTYPE((krb5_context)); /* need to play games here, since we take a pointer and the real thing, and it might be narrow. */ #ifdef NARROW_PROTOTYPES krb5_error_code krb5_db_set_nonblocking - PROTOTYPE((krb5_boolean, + PROTOTYPE((krb5_context, + krb5_boolean, krb5_boolean * )); krb5_boolean krb5_db_set_lockmode - PROTOTYPE((krb5_boolean )); + PROTOTYPE((krb5_context, + krb5_boolean )); #else krb5_error_code krb5_db_set_nonblocking - PROTOTYPE((int, /* krb5_boolean */ + PROTOTYPE((krb5_context, + int, /* krb5_boolean */ krb5_boolean * )); krb5_boolean krb5_db_set_lockmode - PROTOTYPE((int /* krb5_boolean */ )); + PROTOTYPE((krb5_context, + int /* krb5_boolean */ )); #endif /* NARROW_PROTOTYPES */ #include <krb5/widen.h> @@ -186,8 +211,13 @@ krb5_boolean krb5_db_set_lockmode section */ krb5_error_code krb5_db_fetch_mkey - PROTOTYPE((krb5_principal, krb5_encrypt_block *, krb5_boolean, - krb5_boolean, krb5_data *, krb5_keyblock * )); + PROTOTYPE((krb5_context, + krb5_principal, + krb5_encrypt_block *, + krb5_boolean, + krb5_boolean, + krb5_data *, + krb5_keyblock * )); #include <krb5/narrow.h> diff --git a/src/include/krb5/kdb_dbm.h b/src/include/krb5/kdb_dbm.h index ade24da71..2e516d50a 100644 --- a/src/include/krb5/kdb_dbm.h +++ b/src/include/krb5/kdb_dbm.h @@ -57,40 +57,70 @@ #define krb5_dbm_db_open_database krb5_db_open_database /* libkdb.spec */ -krb5_error_code krb5_dbm_db_set_name PROTOTYPE((char * )); -krb5_error_code krb5_dbm_db_init PROTOTYPE((void )); -krb5_error_code krb5_dbm_db_fini PROTOTYPE((void )); -krb5_error_code krb5_dbm_db_get_age PROTOTYPE((char *, time_t * )); -krb5_error_code krb5_dbm_db_create PROTOTYPE((char * )); -krb5_error_code krb5_dbm_db_destroy PROTOTYPE((char * )); -krb5_error_code krb5_dbm_db_rename PROTOTYPE((char *, char * )); -krb5_error_code krb5_dbm_db_get_principal PROTOTYPE((krb5_principal, - krb5_db_entry *, - int *, - krb5_boolean * )); -void krb5_dbm_db_free_principal PROTOTYPE((krb5_db_entry *, int )); -krb5_error_code krb5_dbm_db_put_principal PROTOTYPE((krb5_db_entry *, - int * )); +krb5_error_code krb5_dbm_db_set_name + PROTOTYPE((krb5_context, + char * )); +krb5_error_code krb5_dbm_db_init + PROTOTYPE((krb5_context)); +krb5_error_code krb5_dbm_db_fini + PROTOTYPE((krb5_context)); +krb5_error_code krb5_dbm_db_get_age + PROTOTYPE((krb5_context, + char *, + time_t * )); +krb5_error_code krb5_dbm_db_create + PROTOTYPE((krb5_context, + char * )); +krb5_error_code krb5_dbm_db_destroy + PROTOTYPE((krb5_context, + char * )); +krb5_error_code krb5_dbm_db_rename + PROTOTYPE((krb5_context, + char *, + char * )); +krb5_error_code krb5_dbm_db_get_principal + PROTOTYPE((krb5_context, + krb5_principal, + krb5_db_entry *, + int *, + krb5_boolean * )); +void krb5_dbm_db_free_principal + PROTOTYPE((krb5_context, + krb5_db_entry *, + int )); +krb5_error_code krb5_dbm_db_put_principal + PROTOTYPE((krb5_context, + krb5_db_entry *, + int * )); krb5_error_code krb5_dbm_db_iterate - PROTOTYPE((krb5_error_code (*) PROTOTYPE((krb5_pointer, - krb5_db_entry *)), - krb5_pointer )); + PROTOTYPE((krb5_context, + krb5_error_code (*) PROTOTYPE((krb5_pointer, + krb5_db_entry *)), + krb5_pointer )); /* need to play games here, since we take a pointer and the real thing, and it might be narrow. */ #ifdef NARROW_PROTOTYPES -krb5_error_code krb5_dbm_db_set_nonblocking PROTOTYPE((krb5_boolean, - krb5_boolean * )); +krb5_error_code krb5_dbm_db_set_nonblocking + PROTOTYPE((krb5_context, + krb5_boolean, + krb5_boolean * )); krb5_boolean krb5_dbm_db_set_lockmode - PROTOTYPE((krb5_boolean )); + PROTOTYPE((krb5_context, + krb5_boolean )); #else -krb5_error_code krb5_dbm_db_set_nonblocking PROTOTYPE((int, /* krb5_boolean */ - krb5_boolean * )); +krb5_error_code krb5_dbm_db_set_nonblocking + PROTOTYPE((krb5_context, + int, /* krb5_boolean */ + krb5_boolean * )); krb5_boolean krb5_dbm_db_set_lockmode - PROTOTYPE((int /* krb5_boolean */ )); + PROTOTYPE((krb5_context, + int /* krb5_boolean */ )); #endif /* NARROW_PROTOTYPES */ -krb5_error_code krb5_dbm_db_open_database PROTOTYPE ((void)); -krb5_error_code krb5_dbm_db_close_database PROTOTYPE ((void)); +krb5_error_code krb5_dbm_db_open_database + PROTOTYPE((krb5_context)); +krb5_error_code krb5_dbm_db_close_database + PROTOTYPE((krb5_context)); #endif /* KRB5_KDB5_DBM__ */ diff --git a/src/include/krb5/keytab.h b/src/include/krb5/keytab.h index fb7a85120..f9e6ce98f 100644 --- a/src/include/krb5/keytab.h +++ b/src/include/krb5/keytab.h @@ -57,39 +57,57 @@ typedef struct _krb5_kt_ops { krb5_magic magic; char *prefix; /* routines always present */ - krb5_error_code (*resolve) NPROTOTYPE((const char *, - krb5_keytab *)); - krb5_error_code (*get_name) NPROTOTYPE((krb5_keytab, - char *, - int)); - krb5_error_code (*close) NPROTOTYPE((krb5_keytab)); - krb5_error_code (*get) NPROTOTYPE((krb5_keytab, - krb5_principal, - krb5_kvno, - krb5_keytab_entry *)); - krb5_error_code (*start_seq_get) NPROTOTYPE((krb5_keytab, - krb5_kt_cursor *)); - krb5_error_code (*get_next) NPROTOTYPE((krb5_keytab, - krb5_keytab_entry *, - krb5_kt_cursor *)); - krb5_error_code (*end_get) NPROTOTYPE((krb5_keytab, - krb5_kt_cursor *)); + krb5_error_code (*resolve) + NPROTOTYPE((krb5_context, + const char *, + krb5_keytab *)); + krb5_error_code (*get_name) + NPROTOTYPE((krb5_context, + krb5_keytab, + char *, + int)); + krb5_error_code (*close) + NPROTOTYPE((krb5_context, + krb5_keytab)); + krb5_error_code (*get) + NPROTOTYPE((krb5_context, + krb5_keytab, + krb5_principal, + krb5_kvno, + krb5_keytab_entry *)); + krb5_error_code (*start_seq_get) + NPROTOTYPE((krb5_context, + krb5_keytab, + krb5_kt_cursor *)); + krb5_error_code (*get_next) + NPROTOTYPE((krb5_context, + krb5_keytab, + krb5_keytab_entry *, + krb5_kt_cursor *)); + krb5_error_code (*end_get) + NPROTOTYPE((krb5_context, + krb5_keytab, + krb5_kt_cursor *)); /* routines to be included on extended version (write routines) */ - krb5_error_code (*add) NPROTOTYPE((krb5_keytab, - krb5_keytab_entry *)); - krb5_error_code (*remove) NPROTOTYPE((krb5_keytab, - krb5_keytab_entry *)); + krb5_error_code (*add) + NPROTOTYPE((krb5_context, + krb5_keytab, + krb5_keytab_entry *)); + krb5_error_code (*remove) + NPROTOTYPE((krb5_context, + krb5_keytab, + krb5_keytab_entry *)); } krb5_kt_ops; /* and back to narrow */ #include <krb5/narrow.h> -#define krb5_kt_get_name(keytab, name, namelen) (*(keytab)->ops->get_name)(keytab,name,namelen) -#define krb5_kt_close(keytab) (*(keytab)->ops->close)(keytab) -#define krb5_kt_get_entry(keytab, principal, vno, entry) (*(keytab)->ops->get)(keytab, principal, vno, entry) -#define krb5_kt_start_seq_get(keytab, cursor) (*(keytab)->ops->start_seq_get)(keytab, cursor) -#define krb5_kt_next_entry(keytab, entry, cursor) (*(keytab)->ops->get_next)(keytab, entry, cursor) -#define krb5_kt_end_seq_get(keytab, cursor) (*(keytab)->ops->end_get)(keytab, cursor) +#define krb5_kt_get_name(context, keytab, name, namelen) (*(keytab)->ops->get_name)(context, keytab,name,namelen) +#define krb5_kt_close(context, keytab) (*(keytab)->ops->close)(context, keytab) +#define krb5_kt_get_entry(context, keytab, principal, vno, entry) (*(keytab)->ops->get)(context, keytab, principal, vno, entry) +#define krb5_kt_start_seq_get(context, keytab, cursor) (*(keytab)->ops->start_seq_get)(context, keytab, cursor) +#define krb5_kt_next_entry(context, keytab, entry, cursor) (*(keytab)->ops->get_next)(context, keytab, entry, cursor) +#define krb5_kt_end_seq_get(context, keytab, cursor) (*(keytab)->ops->end_get)(context, keytab, cursor) /* remove and add are functions, so that they can return NOWRITE if not a writable keytab */ diff --git a/src/include/krb5/krb5.h b/src/include/krb5/krb5.h index fccbd9213..150281961 100644 --- a/src/include/krb5/krb5.h +++ b/src/include/krb5/krb5.h @@ -36,6 +36,12 @@ #include <krb5/base-defs.h> #include <krb5/hostaddr.h> + +typedef struct _krb5_context { + krb5_magic magic; + void *os_context; +} *krb5_context; + #include <krb5/encryption.h> #include <krb5/fieldbits.h> #include <krb5/errors.h> @@ -43,11 +49,6 @@ #include <krb5/macros.h> #include <krb5/error_def.h> -typedef struct _krb5_context { - krb5_magic magic; - void *os_context; -} *krb5_context; - /* Time set */ typedef struct _krb5_ticket_times { krb5_timestamp authtime; /* XXX ? should ktime in KDC_REP == authtime diff --git a/src/include/krb5/los-proto.h b/src/include/krb5/los-proto.h index 7f162d703..ed2d4e431 100644 --- a/src/include/krb5/los-proto.h +++ b/src/include/krb5/los-proto.h @@ -36,81 +36,108 @@ void krb5_free_os_context /* libos.spec */ krb5_error_code krb5_read_password - PROTOTYPE((char *, + PROTOTYPE((krb5_context, + char *, char *, char *, int * )); krb5_error_code krb5_lock_file - PROTOTYPE((FILE *, + PROTOTYPE((krb5_context, + FILE *, char *, int )); krb5_error_code krb5_unlock_file - PROTOTYPE((FILE *, + PROTOTYPE((krb5_context, + FILE *, char * )); krb5_error_code krb5_timeofday - PROTOTYPE((krb5_int32 * )); + PROTOTYPE((krb5_context, + krb5_int32 * )); krb5_error_code krb5_us_timeofday - PROTOTYPE((krb5_int32 *, + PROTOTYPE((krb5_context, + krb5_int32 *, krb5_int32 * )); int krb5_net_read - PROTOTYPE((int , + PROTOTYPE((krb5_context, + int , char *, int )); int krb5_net_write - PROTOTYPE((int , + PROTOTYPE((krb5_context, + int , const char *, int )); /* get all the addresses of this host */ krb5_error_code krb5_os_localaddr PROTOTYPE((krb5_address ***)); krb5_error_code krb5_sendto_kdc - PROTOTYPE((const krb5_data *, + PROTOTYPE((krb5_context, + const krb5_data *, const krb5_data *, krb5_data * )); krb5_error_code krb5_get_krbhst - PROTOTYPE((const krb5_data *, + PROTOTYPE((krb5_context, + const krb5_data *, char *** )); krb5_error_code krb5_free_krbhst - PROTOTYPE((char * const * )); + PROTOTYPE((krb5_context, + char * const * )); krb5_error_code krb5_aname_to_localname - PROTOTYPE((krb5_const_principal, + PROTOTYPE((krb5_context, + krb5_const_principal, const int, char * )); krb5_error_code krb5_get_default_realm - PROTOTYPE(( char ** )); + PROTOTYPE((krb5_context, + char ** )); krb5_error_code krb5_get_host_realm - PROTOTYPE((const char *, + PROTOTYPE((krb5_context, + const char *, char *** )); krb5_error_code krb5_free_host_realm - PROTOTYPE((char * const * )); + PROTOTYPE((krb5_context, + char * const * )); krb5_error_code krb5_get_realm_domain - PROTOTYPE((const char *, + PROTOTYPE((krb5_context, + const char *, char ** )); krb5_boolean krb5_kuserok - PROTOTYPE((krb5_principal, const char *)); + PROTOTYPE((krb5_context, + krb5_principal, const char *)); krb5_error_code krb5_random_confounder PROTOTYPE((int, krb5_pointer )); krb5_error_code krb5_gen_replay_name - PROTOTYPE((const krb5_address *, + PROTOTYPE((krb5_context, + const krb5_address *, const char *, char **)); krb5_error_code krb5_gen_portaddr - PROTOTYPE((const krb5_address *, + PROTOTYPE((krb5_context, + const krb5_address *, krb5_const_pointer, krb5_address **)); krb5_error_code krb5_create_secure_file - PROTOTYPE((const char * pathname)); + PROTOTYPE((krb5_context, + const char * pathname)); krb5_error_code krb5_sync_disk_file - PROTOTYPE((FILE *fp)); + PROTOTYPE((krb5_context, + FILE *fp)); -krb5_error_code krb5_read_message PROTOTYPE((krb5_pointer, krb5_data *)); -krb5_error_code krb5_write_message PROTOTYPE((krb5_pointer, krb5_data *)); +krb5_error_code krb5_read_message + PROTOTYPE((krb5_context, + krb5_pointer, + krb5_data *)); +krb5_error_code krb5_write_message + PROTOTYPE((krb5_context, + krb5_pointer, + krb5_data *)); #include <krb5/widen.h> krb5_error_code krb5_sname_to_principal - PROTOTYPE((const char *, + PROTOTYPE((krb5_context, + const char *, const char *, krb5_int32, krb5_principal *)); diff --git a/src/include/krb5/preauth.h b/src/include/krb5/preauth.h index 649bf5e4b..cd59af748 100644 --- a/src/include/krb5/preauth.h +++ b/src/include/krb5/preauth.h @@ -34,11 +34,11 @@ * Note: these typedefs are subject to change.... [tytso:19920903.1609EDT] */ typedef krb5_error_code (krb5_preauth_obtain_proc) - PROTOTYPE((krb5_principal client, krb5_address **src_addr, + PROTOTYPE((krb5_context, krb5_principal client, krb5_address **src_addr, krb5_pa_data *pa_data)); typedef krb5_error_code (krb5_preauth_verify_proc) - PROTOTYPE((krb5_principal client, krb5_address **src_addr, + PROTOTYPE((krb5_context, krb5_principal client, krb5_address **src_addr, krb5_data *data)); typedef struct _krb5_preauth_ops { @@ -66,18 +66,18 @@ krb5_error_code verify_random_padata #endif krb5_error_code get_unixtime_padata - PROTOTYPE((krb5_principal client, krb5_address **src_addr, - krb5_pa_data *data)); + PROTOTYPE((krb5_context, krb5_principal client, + krb5_address **src_addr, krb5_pa_data *data)); krb5_error_code verify_unixtime_padata - PROTOTYPE((krb5_principal client, krb5_address **src_addr, + PROTOTYPE((krb5_context, krb5_principal client, krb5_address **src_addr, krb5_data *data)); krb5_error_code get_securid_padata - PROTOTYPE((krb5_principal client, krb5_address **src_addr, + PROTOTYPE((krb5_context, krb5_principal client, krb5_address **src_addr, krb5_pa_data *data)); krb5_error_code verify_securid_padata - PROTOTYPE((krb5_principal client, krb5_address **src_addr, + PROTOTYPE((krb5_context, krb5_principal client, krb5_address **src_addr, krb5_data *data)); diff --git a/src/include/krb5/rcache.h b/src/include/krb5/rcache.h index 4bd531116..cadacff5c 100644 --- a/src/include/krb5/rcache.h +++ b/src/include/krb5/rcache.h @@ -45,36 +45,50 @@ typedef struct _krb5_donot_replay { typedef struct _krb5_rc_ops { krb5_magic magic; char *type; - krb5_error_code (*init)NPROTOTYPE((krb5_rcache,krb5_deltat)); /* create */ - krb5_error_code (*recover)NPROTOTYPE((krb5_rcache)); /* open */ - krb5_error_code (*destroy)NPROTOTYPE((krb5_rcache)); - krb5_error_code (*close)NPROTOTYPE((krb5_rcache)); - krb5_error_code (*store)NPROTOTYPE((krb5_rcache,krb5_donot_replay *)); - krb5_error_code (*expunge)NPROTOTYPE((krb5_rcache)); - krb5_error_code (*get_span)NPROTOTYPE((krb5_rcache,krb5_deltat *)); - char *(*get_name)NPROTOTYPE((krb5_rcache)); - krb5_error_code (*resolve)NPROTOTYPE((krb5_rcache, char *)); + krb5_error_code (*init)NPROTOTYPE((krb5_context, krb5_rcache,krb5_deltat)); /* create */ + krb5_error_code (*recover)NPROTOTYPE((krb5_context, krb5_rcache)); /* open */ + krb5_error_code (*destroy)NPROTOTYPE((krb5_context, krb5_rcache)); + krb5_error_code (*close)NPROTOTYPE((krb5_context, krb5_rcache)); + krb5_error_code (*store)NPROTOTYPE((krb5_context, krb5_rcache,krb5_donot_replay *)); + krb5_error_code (*expunge)NPROTOTYPE((krb5_context, krb5_rcache)); + krb5_error_code (*get_span)NPROTOTYPE((krb5_context, krb5_rcache,krb5_deltat *)); + char *(*get_name)NPROTOTYPE((krb5_context, krb5_rcache)); + krb5_error_code (*resolve)NPROTOTYPE((krb5_context, krb5_rcache, char *)); } krb5_rc_ops; -krb5_error_code krb5_rc_default PROTOTYPE((krb5_rcache *)); -krb5_error_code krb5_rc_register_type PROTOTYPE((krb5_rc_ops *)); -krb5_error_code krb5_rc_resolve_type PROTOTYPE((krb5_rcache *,char *)); -krb5_error_code krb5_rc_resolve_full PROTOTYPE((krb5_rcache *,char *)); -char *krb5_rc_get_type PROTOTYPE((krb5_rcache)); -char *krb5_rc_default_type PROTOTYPE((void)); -char *krb5_rc_default_name PROTOTYPE((void)); -krb5_error_code krb5_auth_to_rep PROTOTYPE((krb5_tkt_authent *, - krb5_donot_replay *)); +krb5_error_code krb5_rc_default + PROTOTYPE((krb5_context, + krb5_rcache *)); +krb5_error_code krb5_rc_register_type + PROTOTYPE((krb5_context, + krb5_rc_ops *)); +krb5_error_code krb5_rc_resolve_type + PROTOTYPE((krb5_context, + krb5_rcache *,char *)); +krb5_error_code krb5_rc_resolve_full + PROTOTYPE((krb5_context, + krb5_rcache *,char *)); +char *krb5_rc_get_type + PROTOTYPE((krb5_context, + krb5_rcache)); +char *krb5_rc_default_type + PROTOTYPE((krb5_context)); +char *krb5_rc_default_name + PROTOTYPE((krb5_context)); +krb5_error_code krb5_auth_to_rep + PROTOTYPE((krb5_context, + krb5_tkt_authent *, + krb5_donot_replay *)); -#define krb5_rc_initialize(id, span) (*(id)->ops->init)(id, span) -#define krb5_rc_recover(id) (*(id)->ops->recover)(id) -#define krb5_rc_destroy(id) (*(id)->ops->destroy)(id) -#define krb5_rc_close(id) (*(id)->ops->close)(id) -#define krb5_rc_store(id, dontreplay) (*(id)->ops->store)(id, dontreplay) -#define krb5_rc_expunge(id) (*(id)->ops->expunge)(id) -#define krb5_rc_get_lifespan(id, spanp) (*(id)->ops->get_span)(id, spanp) -#define krb5_rc_get_name(id) (*(id)->ops->get_name)(id) -#define krb5_rc_resolve(id, name) (*(id)->ops->resolve)(id, name) +#define krb5_rc_initialize(context, id, span) (*(id)->ops->init)(context, id, span) +#define krb5_rc_recover(context, id) (*(id)->ops->recover)(context, id) +#define krb5_rc_destroy(context, id) (*(id)->ops->destroy)(context, id) +#define krb5_rc_close(context, id) (*(id)->ops->close)(context, id) +#define krb5_rc_store(context, id, dontreplay) (*(id)->ops->store)(context, id, dontreplay) +#define krb5_rc_expunge(context, id) (*(id)->ops->expunge)(context, id) +#define krb5_rc_get_lifespan(context, id, spanp) (*(id)->ops->get_span)(context, id, spanp) +#define krb5_rc_get_name(context, id) (*(id)->ops->get_name)(context, id) +#define krb5_rc_resolve(context, id, name) (*(id)->ops->resolve)(context, id, name) extern krb5_rc_ops krb5_rc_dfl_ops; |
