From 95a3c7fe3fca3eea7dcf4cd01e98deb4bf37b812 Mon Sep 17 00:00:00 2001 From: Keith Vetter Date: Mon, 27 Feb 1995 21:32:03 +0000 Subject: [PATCH] Converted the krb5/krb directory to work under windows. Mostly added the windows INTERFACE keyword to functions. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@5002 dc483132-0cff-0310-8789-dd5450dbe970 --- src/include/krb5/ChangeLog | 8 ++ src/include/krb5/config.h | 15 +++- src/include/krb5/func-proto.h | 12 +-- src/include/krb5/preauth.h | 12 +-- src/lib/krb5/krb/ChangeLog | 47 +++-------- src/lib/krb5/krb/Makefile.in | 144 +++++++++++++++++---------------- src/lib/krb5/krb/addr_comp.c | 2 +- src/lib/krb5/krb/addr_order.c | 2 +- src/lib/krb5/krb/addr_srch.c | 2 +- src/lib/krb5/krb/bld_pr_ext.c | 2 +- src/lib/krb5/krb/bld_princ.c | 4 +- src/lib/krb5/krb/chk_trans.c | 3 +- src/lib/krb5/krb/compat_recv.c | 2 + src/lib/krb5/krb/conv_princ.c | 6 +- src/lib/krb5/krb/copy_addrs.c | 4 +- src/lib/krb5/krb/copy_athctr.c | 2 +- src/lib/krb5/krb/copy_auth.c | 2 +- src/lib/krb5/krb/copy_cksum.c | 2 +- src/lib/krb5/krb/copy_creds.c | 2 +- src/lib/krb5/krb/copy_data.c | 2 +- src/lib/krb5/krb/copy_key.c | 2 +- src/lib/krb5/krb/copy_princ.c | 2 +- src/lib/krb5/krb/copy_tick.c | 2 +- src/lib/krb5/krb/cp_key_cnt.c | 2 +- src/lib/krb5/krb/decode_kdc.c | 2 +- src/lib/krb5/krb/decrypt_tk.c | 2 +- src/lib/krb5/krb/encode_kdc.c | 2 +- src/lib/krb5/krb/encrypt_tk.c | 2 +- src/lib/krb5/krb/faddr_ordr.c | 2 +- src/lib/krb5/krb/free_rtree.c | 2 +- src/lib/krb5/krb/gc_2tgt.c | 2 +- src/lib/krb5/krb/gc_frm_kdc.c | 3 +- src/lib/krb5/krb/gc_via_tgt.c | 2 +- src/lib/krb5/krb/gen_seqnum.c | 2 +- src/lib/krb5/krb/gen_subkey.c | 2 +- src/lib/krb5/krb/get_creds.c | 2 +- src/lib/krb5/krb/get_fcreds.c | 5 +- src/lib/krb5/krb/get_in_tkt.c | 8 +- src/lib/krb5/krb/in_tkt_ktb.c | 12 ++- src/lib/krb5/krb/in_tkt_pwd.c | 12 ++- src/lib/krb5/krb/in_tkt_sky.c | 10 ++- src/lib/krb5/krb/init_ctx.c | 10 +-- src/lib/krb5/krb/int-proto.h | 6 +- src/lib/krb5/krb/kdc_rep_dc.c | 2 +- src/lib/krb5/krb/mk_cred.c | 2 +- src/lib/krb5/krb/mk_error.c | 2 +- src/lib/krb5/krb/mk_priv.c | 2 +- src/lib/krb5/krb/mk_rep.c | 2 +- src/lib/krb5/krb/mk_req.c | 2 +- src/lib/krb5/krb/mk_req_ext.c | 2 +- src/lib/krb5/krb/mk_safe.c | 2 +- src/lib/krb5/krb/parse.c | 4 +- src/lib/krb5/krb/pr_to_salt.c | 6 +- src/lib/krb5/krb/preauth.c | 16 ++-- src/lib/krb5/krb/princ_comp.c | 4 +- src/lib/krb5/krb/rd_cred.c | 4 +- src/lib/krb5/krb/rd_error.c | 2 +- src/lib/krb5/krb/rd_priv.c | 4 +- src/lib/krb5/krb/rd_rep.c | 2 +- src/lib/krb5/krb/rd_req.c | 2 +- src/lib/krb5/krb/rd_req_dec.c | 4 +- src/lib/krb5/krb/rd_req_sim.c | 2 +- src/lib/krb5/krb/rd_safe.c | 4 +- src/lib/krb5/krb/recvauth.c | 5 +- src/lib/krb5/krb/send_tgs.c | 4 +- src/lib/krb5/krb/sendauth.c | 6 +- src/lib/krb5/krb/srv_rcache.c | 2 +- src/lib/krb5/krb/tgtname.c | 2 +- src/lib/krb5/krb/unparse.c | 4 +- src/lib/krb5/krb/walk_rtree.c | 3 +- 70 files changed, 251 insertions(+), 216 deletions(-) diff --git a/src/include/krb5/ChangeLog b/src/include/krb5/ChangeLog index 865c2b82f..92bb602de 100644 --- a/src/include/krb5/ChangeLog +++ b/src/include/krb5/ChangeLog @@ -1,3 +1,11 @@ +Mon Feb 27 11:35:49 1995 Keith Vetter (keithv@fusion.com) + + * config.h: added windows interface keyword for varargs functions, + added defines to allows to be stdc compliant. + * func-proto.h: added windows INTERFACE_C keyword for functions + with varargs, and fixed const in prototype for krb5_send_tgs. + * preauth.h: added windows INTERFACE keyword to prototypes + Wed Feb 22 17:39:46 1995 Chris Provenzano (proven@mit.edu) * func-proto.h (krb5_get_credentials(), krb5_get_cred_from_kdc(), diff --git a/src/include/krb5/config.h b/src/include/krb5/config.h index 039433969..3f03ddae8 100644 --- a/src/include/krb5/config.h +++ b/src/include/krb5/config.h @@ -55,10 +55,21 @@ typedef unsigned char u_char; #endif #ifndef INTERFACE -#define INTERFACE __far __export __pascal +#define INTERFACE __far __export __pascal +#define INTERFACE_C __far __export __cdecl #endif #define FAR __far +/* + * The following defines are needed to make work + * in stdc mode (/Za flag). Winsock.h needs . + */ +#define _far __far +#define _near __near +#define _pascal __pascal +#define _cdecl __cdecl +#define _huge __huge + #else /* Rest of include file is for non-Microloss-Windows */ #ifndef KRB5_AUTOCONF__ @@ -116,7 +127,9 @@ typedef unsigned char u_char; * just define it as NULL. */ #define INTERFACE +#define INTERFACE_C #define FAR +#define labs(x) abs(x) #endif /* __windows__ */ diff --git a/src/include/krb5/func-proto.h b/src/include/krb5/func-proto.h index 92c7f2cec..038b458a3 100644 --- a/src/include/krb5/func-proto.h +++ b/src/include/krb5/func-proto.h @@ -235,13 +235,13 @@ krb5_error_code INTERFACE krb5_generate_seq_number krb5_error_code INTERFACE krb5_get_server_rcache PROTOTYPE((krb5_context, const krb5_data *, krb5_rcache *)); -krb5_error_code krb5_build_principal_ext +krb5_error_code INTERFACE_C krb5_build_principal_ext STDARG_P((krb5_context, krb5_principal *, int, const char *, ...)); -krb5_error_code krb5_build_principal +krb5_error_code INTERFACE_C krb5_build_principal 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 +krb5_error_code INTERFACE_C krb5_build_principal_va PROTOTYPE((krb5_context, krb5_principal *, int, const char *, va_list)); #endif @@ -439,7 +439,7 @@ krb5_error_code INTERFACE krb5_send_tgs const krb5_cksumtype, krb5_const_principal, krb5_address * const *, - krb5_authdata * const *, + const krb5_authdata **, krb5_pa_data * const *, const krb5_data *, krb5_creds *, @@ -451,13 +451,13 @@ krb5_error_code INTERFACE krb5_get_in_tkt krb5_address * const *, krb5_enctype *, krb5_preauthtype *, - krb5_error_code (* )(krb5_context, + krb5_error_code (INTERFACE * )(krb5_context, const krb5_keytype, krb5_data *, krb5_const_pointer, krb5_keyblock **), krb5_const_pointer, - krb5_error_code (* )(krb5_context, + krb5_error_code (INTERFACE * )(krb5_context, const krb5_keyblock *, krb5_const_pointer, krb5_kdc_rep * ), diff --git a/src/include/krb5/preauth.h b/src/include/krb5/preauth.h index a22e196b8..3a16ee5cc 100644 --- a/src/include/krb5/preauth.h +++ b/src/include/krb5/preauth.h @@ -35,11 +35,11 @@ /* * Note: these typedefs are subject to change.... [tytso:19920903.1609EDT] */ -typedef krb5_error_code (krb5_preauth_obtain_proc) +typedef krb5_error_code (INTERFACE krb5_preauth_obtain_proc) PROTOTYPE((krb5_context, krb5_principal client, krb5_address **src_addr, krb5_pa_data *pa_data)); -typedef krb5_error_code (krb5_preauth_verify_proc) +typedef krb5_error_code (INTERFACE krb5_preauth_verify_proc) PROTOTYPE((krb5_context, krb5_principal client, krb5_address **src_addr, krb5_data *data)); @@ -67,19 +67,19 @@ krb5_error_code verify_random_padata krb5_data *data)); #endif -krb5_error_code get_unixtime_padata +krb5_error_code INTERFACE get_unixtime_padata PROTOTYPE((krb5_context, krb5_principal client, krb5_address **src_addr, krb5_pa_data *data)); -krb5_error_code verify_unixtime_padata +krb5_error_code INTERFACE verify_unixtime_padata PROTOTYPE((krb5_context, krb5_principal client, krb5_address **src_addr, krb5_data *data)); -krb5_error_code get_securid_padata +krb5_error_code INTERFACE get_securid_padata PROTOTYPE((krb5_context, krb5_principal client, krb5_address **src_addr, krb5_pa_data *data)); -krb5_error_code verify_securid_padata +krb5_error_code INTERFACE verify_securid_padata PROTOTYPE((krb5_context, krb5_principal client, krb5_address **src_addr, krb5_data *data)); diff --git a/src/lib/krb5/krb/ChangeLog b/src/lib/krb5/krb/ChangeLog index 8223b84a9..a6c9e65a7 100644 --- a/src/lib/krb5/krb/ChangeLog +++ b/src/lib/krb5/krb/ChangeLog @@ -1,45 +1,18 @@ +Wed Feb 22 17:14:31 1995 Keith Vetter (keithv@fusion.com) + + * walk_rtr.c (krb5_walk_realm_tree): formal parameter wasn't declared. + * send_tgs.c: const in wrong place in the prototype. + * get_in_tkt.c, preauth.c, rd_cred.c, rd_priv.c, rd_req_dec.c, + rd_safe.c: needed a 32 bit abs() function. + * parse.c: removed call to fprintf on error the windows version + * send_auth.c: defined for windows the ECONNABORTED errno (will + be removed when the socket layer is fully implemented). + Tue Feb 21 23:38:34 1995 Theodore Y. Ts'o (tytso@dcl) * mk_cred.c (krb5_mk_cred): Fix argument type to krb5_free_cred_enc_part(). -Thu Feb 16 00:22:03 1995 Chris Provenzano (proven@mit.edu) - - * send_tgs.c (krb5_send_tgs()) Added check for a valid krb5_creds * arg. - - * mk_req_ext.c (krb5_mk_req_extended()) Require caller to pass in a - valid krb5_creds * arg, and removed kdc_options krb5_flags - and krb5_ccache from arg list. - * send_tgs.c (krb5_send_tgs()) - * sendauth.c (krb5_sendauth()) - Fix calls to krb5_mk_req_extended() - - * gc_frm_kdc.c (krb5_get_cred_from_kdc()) Changed krb5_creds * in/out - arg to be an in only arg and added krb5_creds ** out arg. - - * gc_via_tgt.c (krb5_get_cred_via_tgt()) Changed krb5_creds * in/out - arg to be an in only arg and added krb5_creds ** out arg. - - * gc_2tgt.c (krb5_get_cred_via_2tgt()) Changed krb5_creds * in/out - arg to be an in only arg and added krb5_creds ** out arg. - - * int-proto.h Updated prototypes for krb5_get_cred_via_tgt() and - krb5_get_cred_via_2tgt(). - - * get_creds.c (krb5_get_credentials()) Changed krb5_creds * in/out - arg to be an in only arg and added krb5_creds ** out arg. - * sendauth.c (krb5_sendauth()) - Routines that also require krb5_creds * in/out arg to be - appropriately changed because krb5_get_credentials() changed. - * gc_frm_kdc.c (krb5_get_cred_from_kdc()) - * get_fcreds.c (krb5_get_for_creds()) - * mk_req.c (krb5_mk_req()) - Other routines that needed adjusting because - krb5_get_credentials() changed but didn't need an API change. - - * int-proto.h Don't prototype krb5_get_cred_via_tgt() twice. Use the - second to prototype krb5_get_cred_via_2tgt(). - Mon Feb 13 20:25:20 1995 Theodore Y. Ts'o (tytso@dcl) * get_in_tkt.c (krb5_get_in_tkt): Fix memory leak --- the default diff --git a/src/lib/krb5/krb/Makefile.in b/src/lib/krb5/krb/Makefile.in index 64aab2a81..7ac5d079f 100644 --- a/src/lib/krb5/krb/Makefile.in +++ b/src/lib/krb5/krb/Makefile.in @@ -1,74 +1,74 @@ CFLAGS = $(CCOPTS) $(DEFS) LDFLAGS = -g -all:: $(OBJS) - +##DOSBUILDTOP = ..\..\.. +##DOSLIBNAME=..\libkrb5.lib +##DOS!include $(BUILDTOP)\config\windows.in - -OBJS= addr_comp.o \ - addr_order.o \ - addr_srch.o \ - bld_pr_ext.o \ - bld_princ.o \ - chk_trans.o \ - compat_recv.o \ - conv_princ.o \ - copy_addrs.o \ - copy_auth.o \ - copy_athctr.o \ - copy_cksum.o \ - copy_creds.o \ - copy_data.o \ - copy_key.o \ - copy_princ.o \ - copy_tick.o \ - cp_key_cnt.o \ - decode_kdc.o \ - decrypt_tk.o \ - encode_kdc.o \ - encrypt_tk.o \ - free_rtree.o \ - faddr_ordr.o \ - gc_frm_kdc.o \ - gc_via_tgt.o \ - gc_2tgt.o \ - gen_seqnum.o \ - gen_subkey.o \ - get_creds.o \ - get_fcreds.o \ - get_in_tkt.o \ - in_tkt_ktb.o \ - in_tkt_pwd.o \ - in_tkt_sky.o \ - init_ctx.o \ - kdc_rep_dc.o \ - krbconfig.o \ - mk_cred.o \ - mk_error.o \ - mk_priv.o \ - mk_rep.o \ - mk_req.o \ - mk_req_ext.o \ - mk_safe.o \ - parse.o \ - pr_to_salt.o \ - preauth.o \ - princ_comp.o \ - rd_cred.o \ - rd_error.o \ - rd_priv.o \ - rd_rep.o \ - rd_req.o \ - rd_req_sim.o \ - rd_req_dec.o \ - rd_safe.o \ - recvauth.o \ - sendauth.o \ - send_tgs.o \ - srv_rcache.o \ - tgtname.o \ - unparse.o \ - walk_rtree.o +OBJS= addr_comp.$(OBJEXT) \ + addr_order.$(OBJEXT) \ + addr_srch.$(OBJEXT) \ + bld_pr_ext.$(OBJEXT) \ + bld_princ.$(OBJEXT) \ + chk_trans.$(OBJEXT) \ + compat_recv.$(OBJEXT) \ + conv_princ.$(OBJEXT) \ + copy_addrs.$(OBJEXT) \ + copy_auth.$(OBJEXT) \ + copy_athctr.$(OBJEXT) \ + copy_cksum.$(OBJEXT) \ + copy_creds.$(OBJEXT) \ + copy_data.$(OBJEXT) \ + copy_key.$(OBJEXT) \ + copy_princ.$(OBJEXT) \ + copy_tick.$(OBJEXT) \ + cp_key_cnt.$(OBJEXT) \ + decode_kdc.$(OBJEXT) \ + decrypt_tk.$(OBJEXT) \ + encode_kdc.$(OBJEXT) \ + encrypt_tk.$(OBJEXT) \ + free_rtree.$(OBJEXT) \ + faddr_ordr.$(OBJEXT) \ + gc_frm_kdc.$(OBJEXT) \ + gc_via_tgt.$(OBJEXT) \ + gc_2tgt.$(OBJEXT) \ + gen_seqnum.$(OBJEXT) \ + gen_subkey.$(OBJEXT) \ + get_creds.$(OBJEXT) \ + get_fcreds.$(OBJEXT) \ + get_in_tkt.$(OBJEXT) \ + in_tkt_ktb.$(OBJEXT) \ + in_tkt_pwd.$(OBJEXT) \ + in_tkt_sky.$(OBJEXT) \ + init_ctx.$(OBJEXT) \ + kdc_rep_dc.$(OBJEXT) \ + krbconfig.$(OBJEXT) \ + mk_cred.$(OBJEXT) \ + mk_error.$(OBJEXT) \ + mk_priv.$(OBJEXT) \ + mk_rep.$(OBJEXT) \ + mk_req.$(OBJEXT) \ + mk_req_ext.$(OBJEXT) \ + mk_safe.$(OBJEXT) \ + parse.$(OBJEXT) \ + pr_to_salt.$(OBJEXT) \ + preauth.$(OBJEXT) \ + princ_comp.$(OBJEXT) \ + rd_cred.$(OBJEXT) \ + rd_error.$(OBJEXT) \ + rd_priv.$(OBJEXT) \ + rd_rep.$(OBJEXT) \ + rd_req.$(OBJEXT) \ + rd_req_sim.$(OBJEXT) \ + rd_req_dec.$(OBJEXT) \ + rd_safe.$(OBJEXT) \ + recvauth.$(OBJEXT) \ + sendauth.$(OBJEXT) \ + send_tgs.$(OBJEXT) \ + srv_rcache.$(OBJEXT) \ + tgtname.$(OBJEXT) \ + unparse.$(OBJEXT) \ + walk_rtree.$(OBJEXT) SRCS= $(srcdir)/addr_comp.c \ $(srcdir)/addr_order.c \ @@ -135,6 +135,8 @@ SRCS= $(srcdir)/addr_comp.c \ $(srcdir)/unparse.c \ $(srcdir)/walk_rtree.c +all:: $(OBJS) + COMERRLIB=$(BUILDTOP)/util/et/libcom_err.a T_WALK_RTREE_OBJS= t_walk_rtree.o walk_rtree.o tgtname.o unparse.o \ @@ -145,7 +147,11 @@ t_walk_rtree: $(T_WALK_RTREE_OBJS) TEST_PROGS= t_walk_rtree -check:: $(TEST_PROGS) +check:: check-$(WHAT) + +check-unix:: $(TEST_PROGS) + +check-windows:: clean:: - $(RM) t_walk_rtree t_walk_rtree.o + $(RM) t_walk_rtree$(EXEEXT) t_walk_rtree.$(OBJEXT) diff --git a/src/lib/krb5/krb/addr_comp.c b/src/lib/krb5/krb/addr_comp.c index 211648f29..76d8e91ba 100644 --- a/src/lib/krb5/krb/addr_comp.c +++ b/src/lib/krb5/krb/addr_comp.c @@ -31,7 +31,7 @@ /* * If the two addresses are the same, return TRUE, else return FALSE */ -krb5_boolean +krb5_boolean INTERFACE krb5_address_compare(context, addr1, addr2) krb5_context context; const krb5_address *addr1; diff --git a/src/lib/krb5/krb/addr_order.c b/src/lib/krb5/krb/addr_order.c index 6d9f34669..185f73f51 100644 --- a/src/lib/krb5/krb/addr_order.c +++ b/src/lib/krb5/krb/addr_order.c @@ -36,7 +36,7 @@ * Return an ordering on two addresses: 0 if the same, * < 0 if first is less than 2nd, > 0 if first is greater than 2nd. */ -int +int INTERFACE krb5_address_order(context, addr1, addr2) krb5_context context; register const krb5_address *addr1; diff --git a/src/lib/krb5/krb/addr_srch.c b/src/lib/krb5/krb/addr_srch.c index cc9189f01..1988d08c1 100644 --- a/src/lib/krb5/krb/addr_srch.c +++ b/src/lib/krb5/krb/addr_srch.c @@ -31,7 +31,7 @@ * if addr is listed in addrlist, or addrlist is null, return TRUE. * if not listed, return FALSE */ -krb5_boolean +krb5_boolean INTERFACE krb5_address_search(context, addr, addrlist) krb5_context context; const krb5_address *addr; diff --git a/src/lib/krb5/krb/bld_pr_ext.c b/src/lib/krb5/krb/bld_pr_ext.c index 5d11e2b19..753bbb7c7 100644 --- a/src/lib/krb5/krb/bld_pr_ext.c +++ b/src/lib/krb5/krb/bld_pr_ext.c @@ -34,7 +34,7 @@ #include #endif -krb5_error_code +krb5_error_code INTERFACE_C #if __STDC__ || defined(STDARG_PROTOTYPES) krb5_build_principal_ext(krb5_context context, krb5_principal * princ, int rlen, const char * realm, ...) #else diff --git a/src/lib/krb5/krb/bld_princ.c b/src/lib/krb5/krb/bld_princ.c index 94dbb723d..b82c43a03 100644 --- a/src/lib/krb5/krb/bld_princ.c +++ b/src/lib/krb5/krb/bld_princ.c @@ -36,7 +36,7 @@ #include -krb5_error_code +krb5_error_code INTERFACE_C krb5_build_principal_va(context, princ, rlen, realm, ap) krb5_context context; krb5_principal princ; @@ -99,7 +99,7 @@ krb5_build_principal_va(context, princ, rlen, realm, ap) return 0; } -krb5_error_code +krb5_error_code INTERFACE_C #if __STDC__ || defined(STDARG_PROTOTYPES) krb5_build_principal(krb5_context context, krb5_principal * princ, int rlen, const char * realm, ...) diff --git a/src/lib/krb5/krb/chk_trans.c b/src/lib/krb5/krb/chk_trans.c index 9b2d5b9cd..b3264318f 100644 --- a/src/lib/krb5/krb/chk_trans.c +++ b/src/lib/krb5/krb/chk_trans.c @@ -25,7 +25,8 @@ #define MAX_REALM_LN 500 -krb5_error_code krb5_check_transited_list(context, trans, realm1, realm2) +krb5_error_code INTERFACE +krb5_check_transited_list(context, trans, realm1, realm2) krb5_context context; krb5_data *trans; krb5_data *realm1; diff --git a/src/lib/krb5/krb/compat_recv.c b/src/lib/krb5/krb/compat_recv.c index e0276b3cc..9e986c002 100644 --- a/src/lib/krb5/krb/compat_recv.c +++ b/src/lib/krb5/krb/compat_recv.c @@ -35,6 +35,7 @@ #include +#ifndef _MSDOS #include #include #include @@ -314,3 +315,4 @@ mutual_fail: return(rem); } #endif +#endif diff --git a/src/lib/krb5/krb/conv_princ.c b/src/lib/krb5/krb/conv_princ.c index 2ed3ccf03..001308041 100644 --- a/src/lib/krb5/krb/conv_princ.c +++ b/src/lib/krb5/krb/conv_princ.c @@ -99,7 +99,8 @@ static char *strnchr(s, c, n) /* XXX This calls for a new error code */ #define KRB5_INVALID_PRINCIPAL KRB5_LNAME_BADFORMAT -krb5_error_code krb5_524_conv_principal(context, princ, name, inst, realm) +krb5_error_code INTERFACE +krb5_524_conv_principal(context, princ, name, inst, realm) krb5_context context; const krb5_principal princ; char *name; @@ -166,7 +167,8 @@ krb5_error_code krb5_524_conv_principal(context, princ, name, inst, realm) return 0; } -krb5_error_code krb5_425_conv_principal(context, name, instance, realm, princ) +krb5_error_code INTERFACE +krb5_425_conv_principal(context, name, instance, realm, princ) krb5_context context; const char *name; const char *instance; diff --git a/src/lib/krb5/krb/copy_addrs.c b/src/lib/krb5/krb/copy_addrs.c index 1bb0ba682..ad21082b3 100644 --- a/src/lib/krb5/krb/copy_addrs.c +++ b/src/lib/krb5/krb/copy_addrs.c @@ -52,7 +52,7 @@ krb5_address **outad; /* * Copy an address array, with fresh allocation. */ -krb5_error_code +krb5_error_code INTERFACE krb5_copy_addresses(context, inaddr, outaddr) krb5_context context; krb5_address * const * inaddr; @@ -90,7 +90,7 @@ krb5_copy_addresses(context, inaddr, outaddr) * Note that this function may change the value of *outaddr even if it * returns failure, but it will not change the contents of the list. */ -krb5_error_code +krb5_error_code INTERFACE krb5_append_addresses(context, inaddr, outaddr) krb5_context context; krb5_address * const * inaddr; diff --git a/src/lib/krb5/krb/copy_athctr.c b/src/lib/krb5/krb/copy_athctr.c index 82bb8d79f..c303af5c8 100644 --- a/src/lib/krb5/krb/copy_athctr.c +++ b/src/lib/krb5/krb/copy_athctr.c @@ -29,7 +29,7 @@ #include -krb5_error_code +krb5_error_code INTERFACE krb5_copy_authenticator(context, authfrom, authto) krb5_context context; const krb5_authenticator *authfrom; diff --git a/src/lib/krb5/krb/copy_auth.c b/src/lib/krb5/krb/copy_auth.c index 830af3a8a..62b0b610e 100644 --- a/src/lib/krb5/krb/copy_auth.c +++ b/src/lib/krb5/krb/copy_auth.c @@ -52,7 +52,7 @@ krb5_authdata **outad; /* * Copy an authdata array, with fresh allocation. */ -krb5_error_code +krb5_error_code INTERFACE krb5_copy_authdata(context, inauthdat, outauthdat) krb5_context context; krb5_authdata * const * inauthdat; diff --git a/src/lib/krb5/krb/copy_cksum.c b/src/lib/krb5/krb/copy_cksum.c index cf04f4840..0e1a25082 100644 --- a/src/lib/krb5/krb/copy_cksum.c +++ b/src/lib/krb5/krb/copy_cksum.c @@ -29,7 +29,7 @@ #include -krb5_error_code +krb5_error_code INTERFACE krb5_copy_checksum(context, ckfrom, ckto) krb5_context context; const krb5_checksum *ckfrom; diff --git a/src/lib/krb5/krb/copy_creds.c b/src/lib/krb5/krb/copy_creds.c index 5c14be075..7ac47cc98 100644 --- a/src/lib/krb5/krb/copy_creds.c +++ b/src/lib/krb5/krb/copy_creds.c @@ -33,7 +33,7 @@ * Copy credentials, allocating fresh storage where needed. */ -krb5_error_code +krb5_error_code INTERFACE krb5_copy_creds(context, incred, outcred) krb5_context context; const krb5_creds *incred; diff --git a/src/lib/krb5/krb/copy_data.c b/src/lib/krb5/krb/copy_data.c index 669ed3e8a..97010673d 100644 --- a/src/lib/krb5/krb/copy_data.c +++ b/src/lib/krb5/krb/copy_data.c @@ -31,7 +31,7 @@ /* * Copy a data structure, with fresh allocation. */ -krb5_error_code +krb5_error_code INTERFACE krb5_copy_data(context, indata, outdata) krb5_context context; const krb5_data *indata; diff --git a/src/lib/krb5/krb/copy_key.c b/src/lib/krb5/krb/copy_key.c index 305d80d40..f714d86d8 100644 --- a/src/lib/krb5/krb/copy_key.c +++ b/src/lib/krb5/krb/copy_key.c @@ -31,7 +31,7 @@ /* * Copy a keyblock, including alloc'ed storage. */ -krb5_error_code +krb5_error_code INTERFACE krb5_copy_keyblock(context, from, to) krb5_context context; const krb5_keyblock *from; diff --git a/src/lib/krb5/krb/copy_princ.c b/src/lib/krb5/krb/copy_princ.c index 4ccfa2568..11dee84f4 100644 --- a/src/lib/krb5/krb/copy_princ.c +++ b/src/lib/krb5/krb/copy_princ.c @@ -32,7 +32,7 @@ /* * Copy a principal structure, with fresh allocation. */ -krb5_error_code +krb5_error_code INTERFACE krb5_copy_principal(context, inprinc, outprinc) krb5_context context; krb5_const_principal inprinc; diff --git a/src/lib/krb5/krb/copy_tick.c b/src/lib/krb5/krb/copy_tick.c index c4d512b84..7ee83f08a 100644 --- a/src/lib/krb5/krb/copy_tick.c +++ b/src/lib/krb5/krb/copy_tick.c @@ -94,7 +94,7 @@ krb5_copy_enc_tkt_part(context, partfrom, partto) return 0; } -krb5_error_code +krb5_error_code INTERFACE krb5_copy_ticket(context, from, pto) krb5_context context; const krb5_ticket *from; diff --git a/src/lib/krb5/krb/cp_key_cnt.c b/src/lib/krb5/krb/cp_key_cnt.c index 6b4db985d..541562bd8 100644 --- a/src/lib/krb5/krb/cp_key_cnt.c +++ b/src/lib/krb5/krb/cp_key_cnt.c @@ -31,7 +31,7 @@ /* * Copy a keyblock, including alloc'ed storage. */ -krb5_error_code +krb5_error_code INTERFACE krb5_copy_keyblock_contents(context, from, to) krb5_context context; const krb5_keyblock *from; diff --git a/src/lib/krb5/krb/decode_kdc.c b/src/lib/krb5/krb/decode_kdc.c index dc24be99a..a611ea378 100644 --- a/src/lib/krb5/krb/decode_kdc.c +++ b/src/lib/krb5/krb/decode_kdc.c @@ -44,7 +44,7 @@ returns errors from encryption routines, system errors */ -krb5_error_code +krb5_error_code INTERFACE krb5_decode_kdc_rep(context, enc_rep, key, etype, dec_rep) krb5_context context; krb5_data * enc_rep; diff --git a/src/lib/krb5/krb/decrypt_tk.c b/src/lib/krb5/krb/decrypt_tk.c index cd9332806..9a31a0b00 100644 --- a/src/lib/krb5/krb/decrypt_tk.c +++ b/src/lib/krb5/krb/decrypt_tk.c @@ -40,7 +40,7 @@ */ -krb5_error_code +krb5_error_code INTERFACE krb5_decrypt_tkt_part(context, srv_key, ticket) krb5_context context; const krb5_keyblock *srv_key; diff --git a/src/lib/krb5/krb/encode_kdc.c b/src/lib/krb5/krb/encode_kdc.c index 0918c2c7c..6550cb4ca 100644 --- a/src/lib/krb5/krb/encode_kdc.c +++ b/src/lib/krb5/krb/encode_kdc.c @@ -43,7 +43,7 @@ */ /* due to argument promotion rules, we need to use the DECLARG/OLDDECLARG stuff... */ -krb5_error_code +krb5_error_code INTERFACE krb5_encode_kdc_rep(context, type, encpart, eblock, client_key, dec_rep, enc_rep) krb5_context context; const krb5_msgtype type; diff --git a/src/lib/krb5/krb/encrypt_tk.c b/src/lib/krb5/krb/encrypt_tk.c index 80095b4b4..a363cac48 100644 --- a/src/lib/krb5/krb/encrypt_tk.c +++ b/src/lib/krb5/krb/encrypt_tk.c @@ -43,7 +43,7 @@ enc_part->ciphertext.data allocated & filled in with encrypted stuff */ -krb5_error_code +krb5_error_code INTERFACE krb5_encrypt_tkt_part(context, eblock, srv_key, dec_ticket) krb5_context context; krb5_encrypt_block *eblock; diff --git a/src/lib/krb5/krb/faddr_ordr.c b/src/lib/krb5/krb/faddr_ordr.c index e6870d9bb..f0f109381 100644 --- a/src/lib/krb5/krb/faddr_ordr.c +++ b/src/lib/krb5/krb/faddr_ordr.c @@ -36,7 +36,7 @@ * Return an ordering on the two full addresses: 0 if the same, * < 0 if first is less than 2nd, > 0 if first is greater than 2nd. */ -int +int INTERFACE krb5_fulladdr_order(context, addr1, addr2) krb5_context context; register const krb5_fulladdr *addr1; diff --git a/src/lib/krb5/krb/free_rtree.c b/src/lib/krb5/krb/free_rtree.c index fca10b034..7206bc314 100644 --- a/src/lib/krb5/krb/free_rtree.c +++ b/src/lib/krb5/krb/free_rtree.c @@ -28,7 +28,7 @@ #include #include -void +void INTERFACE krb5_free_realm_tree(context, realms) krb5_context context; krb5_principal *realms; diff --git a/src/lib/krb5/krb/gc_2tgt.c b/src/lib/krb5/krb/gc_2tgt.c index 7503ee76f..88f493a9f 100644 --- a/src/lib/krb5/krb/gc_2tgt.c +++ b/src/lib/krb5/krb/gc_2tgt.c @@ -31,7 +31,7 @@ #include #include "int-proto.h" -krb5_error_code +krb5_error_code INTERFACE krb5_get_cred_via_2tgt (context, tgt, kdcoptions, sumtype, in_cred, out_cred) krb5_context context; krb5_creds *tgt; diff --git a/src/lib/krb5/krb/gc_frm_kdc.c b/src/lib/krb5/krb/gc_frm_kdc.c index 865d07395..72a457843 100644 --- a/src/lib/krb5/krb/gc_frm_kdc.c +++ b/src/lib/krb5/krb/gc_frm_kdc.c @@ -65,7 +65,8 @@ extern krb5_cksumtype krb5_kdc_req_sumtype; #define TGT_ETYPE \ krb5_keytype_array[tgt.keyblock.keytype]->system->proto_enctype; -krb5_error_code krb5_get_cred_from_kdc(context, ccache, in_cred, out_cred, tgts) +krb5_error_code INTERFACE +krb5_get_cred_from_kdc(context, ccache, in_cred, out_cred, tgts) krb5_context context; krb5_ccache ccache; krb5_creds *in_cred; diff --git a/src/lib/krb5/krb/gc_via_tgt.c b/src/lib/krb5/krb/gc_via_tgt.c index 620a50db2..11d4dfa54 100644 --- a/src/lib/krb5/krb/gc_via_tgt.c +++ b/src/lib/krb5/krb/gc_via_tgt.c @@ -33,7 +33,7 @@ #include #include "int-proto.h" -krb5_error_code +krb5_error_code INTERFACE krb5_get_cred_via_tgt (context, tgt, kdcoptions, sumtype, in_cred, out_cred) krb5_context context; krb5_creds * tgt; diff --git a/src/lib/krb5/krb/gen_seqnum.c b/src/lib/krb5/krb/gen_seqnum.c index f5ead423a..c8d702bc5 100644 --- a/src/lib/krb5/krb/gen_seqnum.c +++ b/src/lib/krb5/krb/gen_seqnum.c @@ -35,7 +35,7 @@ #define MIN(a,b) ((a) < (b) ? (a) : (b)) #endif -krb5_error_code +krb5_error_code INTERFACE krb5_generate_seq_number(context, key, seqno) krb5_context context; const krb5_keyblock *key; diff --git a/src/lib/krb5/krb/gen_subkey.c b/src/lib/krb5/krb/gen_subkey.c index 68425b2c9..763c909a5 100644 --- a/src/lib/krb5/krb/gen_subkey.c +++ b/src/lib/krb5/krb/gen_subkey.c @@ -28,7 +28,7 @@ #include #include -krb5_error_code +krb5_error_code INTERFACE krb5_generate_subkey(context, key, subkey) krb5_context context; const krb5_keyblock *key; diff --git a/src/lib/krb5/krb/get_creds.c b/src/lib/krb5/krb/get_creds.c index 14f44b233..a6c08fe53 100644 --- a/src/lib/krb5/krb/get_creds.c +++ b/src/lib/krb5/krb/get_creds.c @@ -43,7 +43,7 @@ #include #include -krb5_error_code +krb5_error_code INTERFACE krb5_get_credentials(context, options, ccache, in_creds, out_creds) krb5_context context; const krb5_flags options; diff --git a/src/lib/krb5/krb/get_fcreds.c b/src/lib/krb5/krb/get_fcreds.c index b5fea089d..3a88e77c9 100644 --- a/src/lib/krb5/krb/get_fcreds.c +++ b/src/lib/krb5/krb/get_fcreds.c @@ -31,6 +31,7 @@ /* libkrb5.a to allow widespread use */ #include +#ifndef _MSDOS #include #include @@ -44,7 +45,7 @@ #define flags2options(flags) (flags & KDC_TKT_COMMON_MASK) /* Get a TGT for use at the remote host */ -krb5_error_code +krb5_error_code INTERFACE krb5_get_for_creds(context, sumtype, rhost, client, enc_key, forwardable, outbuf) krb5_context context; @@ -226,4 +227,4 @@ errout: krb5_free_kdc_rep(context, dec_rep); return retval; } - +#endif diff --git a/src/lib/krb5/krb/get_in_tkt.c b/src/lib/krb5/krb/get_in_tkt.c index 0e72579da..6b4762253 100644 --- a/src/lib/krb5/krb/get_in_tkt.c +++ b/src/lib/krb5/krb/get_in_tkt.c @@ -60,21 +60,21 @@ extern krb5_deltat krb5_clockskew; -#define in_clock_skew(date) (abs((date)-request.nonce) < krb5_clockskew) +#define in_clock_skew(date) (labs((date)-request.nonce) < krb5_clockskew) /* some typedef's for the function args to make things look a bit cleaner */ -typedef krb5_error_code (*git_key_proc) PROTOTYPE((krb5_context, +typedef krb5_error_code (INTERFACE *git_key_proc) PROTOTYPE((krb5_context, const krb5_keytype, krb5_data *, krb5_const_pointer, krb5_keyblock **)); -typedef krb5_error_code (*git_decrypt_proc) PROTOTYPE((krb5_context, +typedef krb5_error_code (INTERFACE *git_decrypt_proc) PROTOTYPE((krb5_context, const krb5_keyblock *, krb5_const_pointer, krb5_kdc_rep * )); -krb5_error_code +krb5_error_code INTERFACE krb5_get_in_tkt(context, options, addrs, etypes, ptypes, key_proc, keyseed, decrypt_proc, decryptarg, creds, ccache, ret_as_reply) krb5_context context; diff --git a/src/lib/krb5/krb/in_tkt_ktb.c b/src/lib/krb5/krb/in_tkt_ktb.c index 47fd8a9d6..20df47c19 100644 --- a/src/lib/krb5/krb/in_tkt_ktb.c +++ b/src/lib/krb5/krb/in_tkt_ktb.c @@ -38,7 +38,15 @@ struct keytab_keyproc_arg { * "keyseed" is actually a krb5_keytab, or NULL if we should fetch * from system area. */ -static keytab_keyproc(context, type, salt, keyseed, key) +krb5_error_code INTERFACE keytab_keyproc + PROTOTYPE((krb5_context, + const krb5_keytype, + krb5_data *, + krb5_const_pointer, + krb5_keyblock **)); + +krb5_error_code INTERFACE +keytab_keyproc(context, type, salt, keyseed, key) krb5_context context; const krb5_keytype type; krb5_data * salt; @@ -100,7 +108,7 @@ static keytab_keyproc(context, type, salt, keyseed, key) returns system errors, encryption errors */ -krb5_error_code +krb5_error_code INTERFACE krb5_get_in_tkt_with_keytab(context, options, addrs, etypes, pre_auth_types, keytab, ccache, creds, ret_as_reply) krb5_context context; diff --git a/src/lib/krb5/krb/in_tkt_pwd.c b/src/lib/krb5/krb/in_tkt_pwd.c index 1fb3b41ff..02ea384d9 100644 --- a/src/lib/krb5/krb/in_tkt_pwd.c +++ b/src/lib/krb5/krb/in_tkt_pwd.c @@ -34,8 +34,14 @@ extern char *krb5_default_pwd_prompt1; /* * key-producing procedure for use by krb5_get_in_tkt_with_password. */ - -static krb5_error_code +krb5_error_code INTERFACE pwd_keyproc + PROTOTYPE((krb5_context, + const krb5_keytype, + krb5_data *, + krb5_const_pointer, + krb5_keyblock **)); + +krb5_error_code INTERFACE pwd_keyproc(context, type, salt, keyseed, key) krb5_context context; const krb5_keytype type; @@ -93,7 +99,7 @@ pwd_keyproc(context, type, salt, keyseed, key) returns system errors, encryption errors */ -krb5_error_code +krb5_error_code INTERFACE krb5_get_in_tkt_with_password(context, options, addrs, etypes, pre_auth_types, password, ccache, creds, ret_as_reply) krb5_context context; diff --git a/src/lib/krb5/krb/in_tkt_sky.c b/src/lib/krb5/krb/in_tkt_sky.c index a0ccb151d..54c4a2b90 100644 --- a/src/lib/krb5/krb/in_tkt_sky.c +++ b/src/lib/krb5/krb/in_tkt_sky.c @@ -40,6 +40,14 @@ struct skey_keyproc_arg { * "keyseed" is actually a krb5_keyblock *, or NULL if we should fetch * from system area. */ +krb5_error_code INTERFACE skey_keyproc + PROTOTYPE((krb5_context, + const krb5_keytype, + krb5_data *, + krb5_const_pointer, + krb5_keyblock **)); + +krb5_error_code INTERFACE skey_keyproc(context, type, salt, keyseed, key) krb5_context context; const krb5_keytype type; @@ -92,7 +100,7 @@ skey_keyproc(context, type, salt, keyseed, key) returns system errors, encryption errors */ -krb5_error_code +krb5_error_code INTERFACE krb5_get_in_tkt_with_skey(context, options, addrs, etypes, pre_auth_types, key, ccache, creds, ret_as_reply) krb5_context context; diff --git a/src/lib/krb5/krb/init_ctx.c b/src/lib/krb5/krb/init_ctx.c index e3debf0d3..50c6dacd6 100644 --- a/src/lib/krb5/krb/init_ctx.c +++ b/src/lib/krb5/krb/init_ctx.c @@ -27,7 +27,7 @@ #include #include -krb5_error_code +krb5_error_code INTERFACE krb5_init_context(context) krb5_context *context; { @@ -57,7 +57,7 @@ cleanup: return retval; } -void +void INTERFACE krb5_free_context(ctx) krb5_context ctx; { @@ -73,7 +73,7 @@ krb5_free_context(ctx) /* * Set the desired default etypes, making sure they are valid. */ -krb5_error_code +krb5_error_code INTERFACE krb5_set_default_in_tkt_etypes(context, etypes) krb5_context context; const krb5_enctype *etypes; @@ -112,7 +112,7 @@ krb5_set_default_in_tkt_etypes(context, etypes) return 0; } -krb5_error_code +krb5_error_code INTERFACE krb5_get_default_in_tkt_etypes(context, etypes) krb5_context context; krb5_enctype **etypes; @@ -124,7 +124,7 @@ krb5_get_default_in_tkt_etypes(context, etypes) (context->etype_count + 1))) { memcpy(old_etypes, context->etypes, sizeof(krb5_enctype) * context->etype_count); - old_etypes[context->etype_count] = NULL; + old_etypes[context->etype_count] = 0; } else { return ENOMEM; } diff --git a/src/lib/krb5/krb/int-proto.h b/src/lib/krb5/krb/int-proto.h index 0a08e39cd..e8dafaf00 100644 --- a/src/lib/krb5/krb/int-proto.h +++ b/src/lib/krb5/krb/int-proto.h @@ -28,19 +28,19 @@ #ifndef KRB5_INT_FUNC_PROTO__ #define KRB5_INT_FUNC_PROTO__ -krb5_error_code krb5_tgtname +krb5_error_code INTERFACE krb5_tgtname PROTOTYPE((krb5_context context, const krb5_data *, const krb5_data *, krb5_principal *)); -krb5_error_code krb5_get_cred_via_tgt +krb5_error_code INTERFACE krb5_get_cred_via_tgt PROTOTYPE((krb5_context context, krb5_creds *, const krb5_flags, const krb5_cksumtype, krb5_creds *, krb5_creds **)); -krb5_error_code krb5_get_cred_via_2tgt +krb5_error_code INTERFACE krb5_get_cred_via_2tgt PROTOTYPE((krb5_context context, krb5_creds *, const krb5_flags, diff --git a/src/lib/krb5/krb/kdc_rep_dc.c b/src/lib/krb5/krb/kdc_rep_dc.c index 569e08821..f8cdc6877 100644 --- a/src/lib/krb5/krb/kdc_rep_dc.c +++ b/src/lib/krb5/krb/kdc_rep_dc.c @@ -36,7 +36,7 @@ */ /*ARGSUSED*/ -krb5_error_code +krb5_error_code INTERFACE krb5_kdc_rep_decrypt_proc(context, key, decryptarg, dec_rep) krb5_context context; const krb5_keyblock * key; diff --git a/src/lib/krb5/krb/mk_cred.c b/src/lib/krb5/krb/mk_cred.c index 211437f0b..668c91f8d 100644 --- a/src/lib/krb5/krb/mk_cred.c +++ b/src/lib/krb5/krb/mk_cred.c @@ -34,7 +34,7 @@ #include /* Create asn.1 encoded KRB-CRED message from the kdc reply. */ -krb5_error_code +krb5_error_code INTERFACE krb5_mk_cred(context, dec_rep, etype, key, sender_addr, recv_addr, outbuf) krb5_context context; krb5_kdc_rep *dec_rep; diff --git a/src/lib/krb5/krb/mk_error.c b/src/lib/krb5/krb/mk_error.c index 5a92a16ec..0d924aaa9 100644 --- a/src/lib/krb5/krb/mk_error.c +++ b/src/lib/krb5/krb/mk_error.c @@ -38,7 +38,7 @@ returns system errors */ -krb5_error_code +krb5_error_code INTERFACE krb5_mk_error(context, dec_err, enc_err) krb5_context context; const krb5_error *dec_err; diff --git a/src/lib/krb5/krb/mk_priv.c b/src/lib/krb5/krb/mk_priv.c index df762b27a..39832bb2c 100644 --- a/src/lib/krb5/krb/mk_priv.c +++ b/src/lib/krb5/krb/mk_priv.c @@ -47,7 +47,7 @@ returns system errors */ -krb5_error_code +krb5_error_code INTERFACE krb5_mk_priv(context, userdata, etype, key, sender_addr, recv_addr, seq_number, priv_flags, rcache, i_vector, outbuf) krb5_context context; diff --git a/src/lib/krb5/krb/mk_rep.c b/src/lib/krb5/krb/mk_rep.c index 504d9ca49..d76e042a4 100644 --- a/src/lib/krb5/krb/mk_rep.c +++ b/src/lib/krb5/krb/mk_rep.c @@ -45,7 +45,7 @@ returns system errors */ -krb5_error_code +krb5_error_code INTERFACE krb5_mk_rep(context, repl, kblock, outbuf) krb5_context context; const krb5_ap_rep_enc_part *repl; diff --git a/src/lib/krb5/krb/mk_req.c b/src/lib/krb5/krb/mk_req.c index 178b2dd29..2bb89bc69 100644 --- a/src/lib/krb5/krb/mk_req.c +++ b/src/lib/krb5/krb/mk_req.c @@ -50,7 +50,7 @@ extern krb5_flags krb5_kdc_default_options; -krb5_error_code +krb5_error_code INTERFACE krb5_mk_req(context, server, ap_req_options, checksum, ccache, outbuf) krb5_context context; krb5_const_principal server; diff --git a/src/lib/krb5/krb/mk_req_ext.c b/src/lib/krb5/krb/mk_req_ext.c index 9b5c060ec..1f8c98eb6 100644 --- a/src/lib/krb5/krb/mk_req_ext.c +++ b/src/lib/krb5/krb/mk_req_ext.c @@ -72,7 +72,7 @@ krb5_generate_authenticator PROTOTYPE((krb5_context, const krb5_checksum *, krb5_keyblock *, krb5_int32, krb5_authdata ** )); -krb5_error_code +krb5_error_code INTERFACE krb5_mk_req_extended(context, ap_req_options, checksum, sequence, newkey, in_creds, authentp, outbuf) krb5_context context; diff --git a/src/lib/krb5/krb/mk_safe.c b/src/lib/krb5/krb/mk_safe.c index e50d92477..b5b691b98 100644 --- a/src/lib/krb5/krb/mk_safe.c +++ b/src/lib/krb5/krb/mk_safe.c @@ -45,7 +45,7 @@ returns system errors */ -krb5_error_code +krb5_error_code INTERFACE krb5_mk_safe(context, userdata, sumtype, key, sender_addr, recv_addr, seq_number, safe_flags, rcache, outbuf) krb5_context context; diff --git a/src/lib/krb5/krb/parse.c b/src/lib/krb5/krb/parse.c index fe051ae68..60aea42e5 100644 --- a/src/lib/krb5/krb/parse.c +++ b/src/lib/krb5/krb/parse.c @@ -64,7 +64,7 @@ * May the fleas of a thousand camels infest the ISO, they who think * that arbitrarily large multi-component names are a Good Thing..... */ -krb5_error_code +krb5_error_code INTERFACE krb5_parse_name(context, name, nprincipal) krb5_context context; const char *name; @@ -190,8 +190,10 @@ krb5_parse_name(context, name, nprincipal) else krb5_princ_component(context, principal, i)->length = size; if (i + 1 != components) { + #ifndef _WINDOWS fprintf(stderr, "Programming error in krb5_parse_name!"); + #endif exit(1); } } else { diff --git a/src/lib/krb5/krb/pr_to_salt.c b/src/lib/krb5/krb/pr_to_salt.c index f920621f0..2f7beb8da 100644 --- a/src/lib/krb5/krb/pr_to_salt.c +++ b/src/lib/krb5/krb/pr_to_salt.c @@ -32,7 +32,7 @@ /* * Convert a krb5_principal into the default salt for that principal. */ -krb5_error_code +krb5_error_code INTERFACE krb5_principal2salt_internal(context, pr, ret, use_realm) krb5_context context; register krb5_const_principal pr; @@ -74,7 +74,7 @@ krb5_principal2salt_internal(context, pr, ret, use_realm) return 0; } -krb5_error_code +krb5_error_code INTERFACE krb5_principal2salt(context, pr, ret) krb5_context context; register krb5_const_principal pr; @@ -83,7 +83,7 @@ krb5_principal2salt(context, pr, ret) return krb5_principal2salt_internal(context, pr, ret, 1); } -krb5_error_code +krb5_error_code INTERFACE krb5_principal2salt_norealm(context, pr, ret) krb5_context context; register krb5_const_principal pr; diff --git a/src/lib/krb5/krb/preauth.c b/src/lib/krb5/krb/preauth.c index e03d24ced..e4992a4ba 100644 --- a/src/lib/krb5/krb/preauth.c +++ b/src/lib/krb5/krb/preauth.c @@ -76,7 +76,7 @@ static krb5_error_code find_preauthenticator * * Note: This is a first crack at what any preauthentication will need... */ -krb5_error_code +krb5_error_code INTERFACE krb5_obtain_padata(context, type, client, src_addr, encrypt_key, ret_data) krb5_context context; int type; /*IN: Preauth type */ @@ -182,7 +182,7 @@ error_out: * Note: This is a first crack at what any preauthentication will need... */ -krb5_error_code +krb5_error_code INTERFACE krb5_verify_padata(context, data,client,src_addr, decrypt_key, req_id, flags) krb5_context context; krb5_pa_data *data; /*IN: padata */ @@ -307,7 +307,7 @@ find_preauthenticator(type, preauth) */ int seeded = 0 ; /* Used by srand below */ -krb5_error_code +krb5_error_code INTERFACE get_unixtime_padata(context, client, src_addr, pa_data) krb5_context context; krb5_principal client; @@ -344,7 +344,7 @@ get_unixtime_padata(context, client, src_addr, pa_data) return(0); } -krb5_error_code +krb5_error_code INTERFACE verify_unixtime_padata(context, client, src_addr, data) krb5_context context; krb5_principal client; @@ -355,7 +355,7 @@ verify_unixtime_padata(context, client, src_addr, data) krb5_error_code retval; krb5_timestamp currenttime, patime; extern krb5_deltat krb5_clockskew; -#define in_clock_skew(date) (abs((date)-currenttime) < krb5_clockskew) +#define in_clock_skew(date) (labs((date)-currenttime) < krb5_clockskew) tmp = (unsigned char *) data->data; if (tmp[8] != 0) @@ -379,7 +379,7 @@ verify_unixtime_padata(context, client, src_addr, data) #include "sdcli.h" #include "sdconf.c" -krb5_error_code +krb5_error_code INTERFACE verify_securid_padata(client, src_addr, data) krb5_principal client; krb5_address **src_addr; @@ -427,7 +427,7 @@ verify_securid_padata(client, src_addr, data) } } #else -krb5_error_code +krb5_error_code INTERFACE verify_securid_padata(context, client, src_addr, data) krb5_context context; krb5_principal client; @@ -451,7 +451,7 @@ static char *krb5_SecureId_prompt = "\nEnter Your SecurId Access Code Prepended */ static char *krb5_SecureId_prompt = "\nEnter Your SecurId Access Code Prepended with Your PIN\n (or a \'#\'if Your PIN is entered on the card keypad): "; -krb5_error_code +krb5_error_code INTERFACE get_securid_padata(context, client,src_addr,pa_data) krb5_context context; krb5_principal client; diff --git a/src/lib/krb5/krb/princ_comp.c b/src/lib/krb5/krb/princ_comp.c index 7697707f3..7000ed8f1 100644 --- a/src/lib/krb5/krb/princ_comp.c +++ b/src/lib/krb5/krb/princ_comp.c @@ -29,7 +29,7 @@ #include #include -krb5_boolean +krb5_boolean INTERFACE krb5_realm_compare(context, princ1, princ2) krb5_context context; krb5_const_principal princ1; @@ -45,7 +45,7 @@ krb5_realm_compare(context, princ1, princ2) return TRUE; } -krb5_boolean +krb5_boolean INTERFACE krb5_principal_compare(context, princ1, princ2) krb5_context context; krb5_const_principal princ1; diff --git a/src/lib/krb5/krb/rd_cred.c b/src/lib/krb5/krb/rd_cred.c index dd7b3a629..1316be809 100644 --- a/src/lib/krb5/krb/rd_cred.c +++ b/src/lib/krb5/krb/rd_cred.c @@ -33,10 +33,10 @@ #include extern krb5_deltat krb5_clockskew; -#define in_clock_skew(date) (abs((date)-currenttime) < krb5_clockskew) +#define in_clock_skew(date) (labs((date)-currenttime) < krb5_clockskew) /* Decode the KRB-CRED message, and return creds */ -krb5_error_code +krb5_error_code INTERFACE krb5_rd_cred(context, inbuf, key, creds, sender_addr, recv_addr) krb5_context context; const krb5_data *inbuf; diff --git a/src/lib/krb5/krb/rd_error.c b/src/lib/krb5/krb/rd_error.c index c30310d94..29a372370 100644 --- a/src/lib/krb5/krb/rd_error.c +++ b/src/lib/krb5/krb/rd_error.c @@ -41,7 +41,7 @@ * returns system errors */ -krb5_error_code +krb5_error_code INTERFACE krb5_rd_error(context, enc_errbuf, dec_error) krb5_context context; const krb5_data *enc_errbuf; diff --git a/src/lib/krb5/krb/rd_priv.c b/src/lib/krb5/krb/rd_priv.c index 08cda457e..199d46d9e 100644 --- a/src/lib/krb5/krb/rd_priv.c +++ b/src/lib/krb5/krb/rd_priv.c @@ -32,7 +32,7 @@ #include extern krb5_deltat krb5_clockskew; -#define in_clock_skew(date) (abs((date)-currenttime) < krb5_clockskew) +#define in_clock_skew(date) (labs((date)-currenttime) < krb5_clockskew) /* @@ -55,7 +55,7 @@ Returns system errors, integrity errors. */ -krb5_error_code +krb5_error_code INTERFACE krb5_rd_priv(context, inbuf, key, sender_addr, recv_addr, seq_number, priv_flags, i_vector, rcache, outbuf) krb5_context context; diff --git a/src/lib/krb5/krb/rd_rep.c b/src/lib/krb5/krb/rd_rep.c index 13a49c740..779fbad94 100644 --- a/src/lib/krb5/krb/rd_rep.c +++ b/src/lib/krb5/krb/rd_rep.c @@ -41,7 +41,7 @@ * returns system errors, encryption errors, replay errors */ -krb5_error_code +krb5_error_code INTERFACE krb5_rd_rep(context, inbuf, kblock, repl) krb5_context context; const krb5_data *inbuf; diff --git a/src/lib/krb5/krb/rd_req.c b/src/lib/krb5/krb/rd_req.c index 467f0e088..97e5a3839 100644 --- a/src/lib/krb5/krb/rd_req.c +++ b/src/lib/krb5/krb/rd_req.c @@ -54,7 +54,7 @@ * returns system errors, encryption errors, replay errors */ -krb5_error_code +krb5_error_code INTERFACE krb5_rd_req(context, inbuf, server, sender_addr, fetchfrom, keyproc, keyprocarg, rcache, authdat) krb5_context context; diff --git a/src/lib/krb5/krb/rd_req_dec.c b/src/lib/krb5/krb/rd_req_dec.c index 21aee0956..19631268c 100644 --- a/src/lib/krb5/krb/rd_req_dec.c +++ b/src/lib/krb5/krb/rd_req_dec.c @@ -66,9 +66,9 @@ static krb5_error_code decrypt_authenticator PROTOTYPE((krb5_context, const krb5_ap_req *, krb5_authenticator **)); extern krb5_deltat krb5_clockskew; -#define in_clock_skew(date) (abs((date)-currenttime) < krb5_clockskew) +#define in_clock_skew(date) (labs((date)-currenttime) < krb5_clockskew) -krb5_error_code +krb5_error_code INTERFACE krb5_rd_req_decoded(context, req, server, sender_addr, fetchfrom, keyproc, keyprocarg, rcache, authdat) krb5_context context; diff --git a/src/lib/krb5/krb/rd_req_sim.c b/src/lib/krb5/krb/rd_req_sim.c index 24a2515c7..f2db248f9 100644 --- a/src/lib/krb5/krb/rd_req_sim.c +++ b/src/lib/krb5/krb/rd_req_sim.c @@ -48,7 +48,7 @@ * returns system errors, encryption errors, replay errors */ -krb5_error_code +krb5_error_code INTERFACE krb5_rd_req_simple(context, inbuf, server, sender_addr, authdat) krb5_context context; const krb5_data *inbuf; diff --git a/src/lib/krb5/krb/rd_safe.c b/src/lib/krb5/krb/rd_safe.c index 1844a6735..2bdcdf4d1 100644 --- a/src/lib/krb5/krb/rd_safe.c +++ b/src/lib/krb5/krb/rd_safe.c @@ -31,7 +31,7 @@ #include extern krb5_deltat krb5_clockskew; -#define in_clock_skew(date) (abs((date)-currenttime) < krb5_clockskew) +#define in_clock_skew(date) (labs((date)-currenttime) < krb5_clockskew) /* parses a KRB_SAFE message from inbuf, placing the integrity-protected user @@ -46,7 +46,7 @@ extern krb5_deltat krb5_clockskew; returns system errors, integrity errors */ -krb5_error_code +krb5_error_code INTERFACE krb5_rd_safe(context, inbuf, key, sender_addr, recv_addr, seq_number, safe_flags, rcache, outbuf) krb5_context context; diff --git a/src/lib/krb5/krb/recvauth.c b/src/lib/krb5/krb/recvauth.c index 3f682d36c..2cd87c9ca 100644 --- a/src/lib/krb5/krb/recvauth.c +++ b/src/lib/krb5/krb/recvauth.c @@ -26,6 +26,7 @@ #include +#ifndef _MSDOS #include #include #include @@ -42,7 +43,7 @@ extern krb5_flags krb5_kdc_default_options; static char *sendauth_version = "KRB5_SENDAUTH_V1.0"; -krb5_error_code +krb5_error_code INTERFACE krb5_recvauth(context, /* IN */ fd, appl_version, server, sender_addr, fetch_from, @@ -322,4 +323,4 @@ krb5_recvauth(context, return 0; } - +#endif diff --git a/src/lib/krb5/krb/send_tgs.c b/src/lib/krb5/krb/send_tgs.c index a5e118d38..8b2d8d47a 100644 --- a/src/lib/krb5/krb/send_tgs.c +++ b/src/lib/krb5/krb/send_tgs.c @@ -48,7 +48,7 @@ returns system errors */ -krb5_error_code +krb5_error_code INTERFACE krb5_send_tgs(context, kdcoptions, timestruct, etypes, sumtype, sname, addrs, authorization_data, padata, second_ticket, in_cred, rep) krb5_context context; @@ -58,7 +58,7 @@ krb5_send_tgs(context, kdcoptions, timestruct, etypes, sumtype, sname, addrs, const krb5_cksumtype sumtype; krb5_const_principal sname; krb5_address * const * addrs; - krb5_authdata * const * authorization_data; + const krb5_authdata ** authorization_data; krb5_pa_data * const * padata; const krb5_data * second_ticket; krb5_creds * in_cred; diff --git a/src/lib/krb5/krb/sendauth.c b/src/lib/krb5/krb/sendauth.c index f5a139424..2f67f30d2 100644 --- a/src/lib/krb5/krb/sendauth.c +++ b/src/lib/krb5/krb/sendauth.c @@ -36,7 +36,9 @@ #include #include -#include +#ifdef _MSDOS +#define ECONNABORTED 53 +#endif #define WORKING_RCACHE @@ -44,7 +46,7 @@ extern krb5_flags krb5_kdc_default_options; static char *sendauth_version = "KRB5_SENDAUTH_V1.0"; -krb5_error_code +krb5_error_code INTERFACE krb5_sendauth(context, /* IN */ fd, appl_version, client, server, ap_req_options, checksump, diff --git a/src/lib/krb5/krb/srv_rcache.c b/src/lib/krb5/krb/srv_rcache.c index 63f547865..39bb229ae 100644 --- a/src/lib/krb5/krb/srv_rcache.c +++ b/src/lib/krb5/krb/srv_rcache.c @@ -30,7 +30,7 @@ #include #include -krb5_error_code +krb5_error_code INTERFACE krb5_get_server_rcache(context, piece, rcptr) krb5_context context; const krb5_data *piece; diff --git a/src/lib/krb5/krb/tgtname.c b/src/lib/krb5/krb/tgtname.c index 7b342a1b8..e6cf43c88 100644 --- a/src/lib/krb5/krb/tgtname.c +++ b/src/lib/krb5/krb/tgtname.c @@ -30,7 +30,7 @@ /* This is an internal-only function, used by krb5_get_cred_from_kdc() */ -krb5_error_code +krb5_error_code INTERFACE krb5_tgtname(context, server, client, tgtprinc) krb5_context context; const krb5_data *server, *client; diff --git a/src/lib/krb5/krb/unparse.c b/src/lib/krb5/krb/unparse.c index 7c29f84ba..f81745035 100644 --- a/src/lib/krb5/krb/unparse.c +++ b/src/lib/krb5/krb/unparse.c @@ -55,7 +55,7 @@ #define REALM_SEP '@' #define COMPONENT_SEP '/' -krb5_error_code +krb5_error_code INTERFACE krb5_unparse_name_ext(context, principal, name, size) krb5_context context; krb5_const_principal principal; @@ -174,7 +174,7 @@ krb5_unparse_name_ext(context, principal, name, size) return 0; } -krb5_error_code +krb5_error_code INTERFACE krb5_unparse_name(context, principal, name) krb5_context context; krb5_const_principal principal; diff --git a/src/lib/krb5/krb/walk_rtree.c b/src/lib/krb5/krb/walk_rtree.c index c3170d200..38fa35525 100644 --- a/src/lib/krb5/krb/walk_rtree.c +++ b/src/lib/krb5/krb/walk_rtree.c @@ -36,11 +36,12 @@ #define max(x,y) ((x) > (y) ? (x) : (y)) #endif -krb5_error_code +krb5_error_code INTERFACE krb5_walk_realm_tree(context, client, server, tree, realm_branch_char) krb5_context context; const krb5_data *client, *server; krb5_principal **tree; + int realm_branch_char; { krb5_error_code retval; krb5_principal *rettree; -- 2.26.2