From 77496479cac1a3158c59fd6fd53e0b5cce02cde7 Mon Sep 17 00:00:00 2001 From: Alexandra Ellwood Date: Thu, 6 Mar 2003 19:52:44 +0000 Subject: [PATCH] * des.h, krb.h: Removed deprecated KfM functions. They will be exported but not in the headers to discourage new callers. Removed enumsalwaysint because there are no typed enums in this header. * des.h: Made afs_string_to_key public on all platforms. (OpenAFS folk think this is okay.) * krb.h, prot.h: Made KRB_TICKET_GRANTING_TICKET public and removed non-public TICKET_GRANTING_TICKET because this macro is used in lots of places by KfM, including some clients. Made krb__get_srvtabname non-private because it is used by KEYFILE. * kadm.h: moved definition of MAXHOSTNAMELEN below the inclusion of other headers so that if it gets defined by those other headers or headers they include, we don't get a redefinition error (this happens on Mac OS X) git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@15245 dc483132-0cff-0310-8789-dd5450dbe970 --- src/include/kerberosIV/ChangeLog | 18 +++++++++++ src/include/kerberosIV/des.h | 41 +------------------------ src/include/kerberosIV/kadm.h | 10 +++---- src/include/kerberosIV/krb.h | 51 +++++++------------------------- src/include/kerberosIV/prot.h | 1 - 5 files changed, 35 insertions(+), 86 deletions(-) diff --git a/src/include/kerberosIV/ChangeLog b/src/include/kerberosIV/ChangeLog index 70690e960..baa927a2b 100644 --- a/src/include/kerberosIV/ChangeLog +++ b/src/include/kerberosIV/ChangeLog @@ -1,3 +1,21 @@ +2003-03-06 Alexandra Ellwood + * des.h, krb.h: Removed deprecated KfM functions. They will be + exported but not in the headers to discourage new callers. Removed + enumsalwaysint because there are no typed enums in this header. + + * des.h: Made afs_string_to_key public on all platforms. (OpenAFS + folk think this is okay.) + + * krb.h, prot.h: Made KRB_TICKET_GRANTING_TICKET public and + removed non-public TICKET_GRANTING_TICKET because this macro is + used in lots of places by KfM, including some clients. Made + krb__get_srvtabname non-private because it is used by KEYFILE. + + * kadm.h: moved definition of MAXHOSTNAMELEN below the inclusion + of other headers so that if it gets defined by those other + headers or headers they include, we don't get a redefinition + error (this happens on Mac OS X). + 2003-02-12 Ken Raeburn * Makefile.in (krb_err.h, kadm_err.h): Rebuild by going to diff --git a/src/include/kerberosIV/des.h b/src/include/kerberosIV/des.h index 37e934398..8655e1d8f 100644 --- a/src/include/kerberosIV/des.h +++ b/src/include/kerberosIV/des.h @@ -53,7 +53,6 @@ KRBINT_BEGIN_DECLS #if TARGET_OS_MAC # if defined(__MWERKS__) # pragma import on -# pragma enumsalwaysint on # endif # pragma options align=mac68k #endif @@ -180,6 +179,7 @@ unsigned long KRB5_CALLCONV des_cbc_cksum(const des_cblock *, des_cblock *, unsigned long, const des_key_schedule, const des_cblock *); int KRB5_CALLCONV des_string_to_key (const char *, C_Block); +void afs_string_to_key(char *, char *, des_cblock); /* XXX ABI change: used to return krb5_error_code */ int KRB5_CALLCONV des_read_password(des_cblock *, char *, int); @@ -196,47 +196,8 @@ int des_random_key(des_cblock *); int des_is_weak_key(des_cblock); void des_cblock_print_file(des_cblock *, FILE *fp); -#if TARGET_OS_MAC - -/* - * Stuff ported from KfM follows... - */ - -void afs_string_to_key(char *, char *, des_cblock); - -/* - * AFS string2key support; they should be considered internal, but KfM - * exposes them. - */ -char *des_crypt(const char *, const char *); -char *des_fcrypt(const char *, const char *, char *); -int des_set_key(des_cblock *, des_key_schedule); - -/* - * internal used by des_read_password, but kfm exposes it - */ -int KRB5_CALLCONV des_read_pw_string(char *, int, char *, int); - -void des_3cbc_encrypt(des_cblock *, des_cblock *, long, des_key_schedule, des_key_schedule, des_key_schedule, des_cblock *, int); -void des_3ecb_encrypt(des_cblock *, des_cblock *, des_key_schedule, des_key_schedule, des_key_schedule, int); - -/* - * Should be internal to crypto/des/f_sched.c, but KfM exposes it. - */ -int make_key_sched(des_cblock *, des_key_schedule); - -/* - * XXX need to implement the following three: - */ -void des_generate_random_block(des_cblock); -void des_set_random_generator_seed(des_cblock); -void des_set_sequence_number(des_cblock); - -#endif /* TARGET_OS_MAC */ - #if TARGET_OS_MAC # if defined(__MWERKS__) -# pragma enumsalwaysint reset # pragma import reset # endif # pragma options align=reset diff --git a/src/include/kerberosIV/kadm.h b/src/include/kerberosIV/kadm.h index a1407dae7..21bc60e5a 100644 --- a/src/include/kerberosIV/kadm.h +++ b/src/include/kerberosIV/kadm.h @@ -37,16 +37,16 @@ * Doug Church, December 28, 1989, MIT Project Athena */ -/* for those broken Unixes without this defined... should be in sys/param.h */ -#ifndef MAXHOSTNAMELEN -#define MAXHOSTNAMELEN 64 -#endif - #include #include "port-sockets.h" #include #include +/* for those broken Unixes without this defined... should be in sys/param.h */ +#ifndef MAXHOSTNAMELEN +#define MAXHOSTNAMELEN 64 +#endif + /* The global structures for the client and server */ typedef struct { struct sockaddr_in admin_addr; diff --git a/src/include/kerberosIV/krb.h b/src/include/kerberosIV/krb.h index 38b35e57b..26ac08647 100644 --- a/src/include/kerberosIV/krb.h +++ b/src/include/kerberosIV/krb.h @@ -30,18 +30,15 @@ #ifndef KRB_DEFS #define KRB_DEFS -#if defined(macintosh) || (defined(__MACH__) && defined(__APPLE__)) -# include -# if TARGET_RT_MAC_CFM -# error "Use KfM 4.0 SDK headers for CFM compilation." -# endif -#endif - /* * For MacOS, don't expose prototypes of various private functions. * Unfortuantely, they've leaked out everywhere else. */ #if defined(macintosh) || (defined(__MACH__) && defined(__APPLE__)) +# include +# if TARGET_RT_MAC_CFM +# error "Use KfM 4.0 SDK headers for CFM compilation." +# endif # ifndef KRB_PRIVATE # define KRB_PRIVATE 0 # endif @@ -141,6 +138,8 @@ extern const char * const krb_err_txt[MAX_KRB_ERRORS]; #define DEFAULT_TKT_LIFE 120 /* default lifetime for krb_mk_req */ #endif +#define KRB_TICKET_GRANTING_TICKET "krbtgt" + /* Definition of text structure used to pass text around */ #define MAX_KTXT_LEN 1250 @@ -737,8 +736,13 @@ extern int krb_create_ticket(KTEXT tkt, unsigned int flags, char *pname, char *session, int life, long time_sec, char *sname, char *sinstance, C_Block key); +#endif /* KRB_PRIVATE */ + +/* This function is used by KEYFILE above. Do not call it directly */ extern char * krb__get_srvtabname(const char *); +#if KRB_PRIVATE + extern int krb_kntoln(AUTH_DAT *, char *); #ifdef KRB5_GENERAL__ @@ -754,38 +758,6 @@ extern int krb_set_key_krb5(krb5_context ctx, krb5_keyblock *key); #endif /* KRB_PRIVATE */ -/* FSp-glue.c */ -#if TARGET_OS_MAC && defined(__FILES__) -int KRB5_CALLCONV FSp_krb_get_svc_in_tkt(char *, char *, char *, char *, - char *, int, const FSSpec *); -int KRB5_CALLCONV FSp_put_svc_key(const FSSpec *, char *, char *, char *, - int, char *); -int KRB5_CALLCONV FSp_read_service_key(char *, char *, char *, - int, const FSSpec*, char *); -#endif - -#if TARGET_OS_MAC -/* - * KfM krb.hin had the following, probably inherited from CNS: - * - * The following functions are not part of the standard Kerberos v4 - * API. They were created for Mac implementation, and used by admin - * tools such as CNS-Config. - */ -extern int KRB5_CALLCONV -krb_get_num_cred(void); - -extern int KRB5_CALLCONV -krb_get_nth_cred(char *, char *, char *, int); - -extern int KRB5_CALLCONV -krb_delete_cred(char *, char *,char *); - -extern int KRB5_CALLCONV -dest_all_tkts(void); - -#endif /* TARGET_OS_MAC */ - /* * krb_change_password -- merged from KfM */ @@ -808,7 +780,6 @@ long win_time_get_epoch(void); #if TARGET_OS_MAC # if defined(__MWERKS__) -# pragma enumsalwaysint reset # pragma import reset # endif # pragma options align=reset diff --git a/src/include/kerberosIV/prot.h b/src/include/kerberosIV/prot.h index 3c1b530e0..c927ac042 100644 --- a/src/include/kerberosIV/prot.h +++ b/src/include/kerberosIV/prot.h @@ -35,7 +35,6 @@ #define KRB_PROT_VERSION 4 #define MAX_PKT_LEN 1000 #define MAX_TXT_LEN 1000 -#define TICKET_GRANTING_TICKET "krbtgt" /* Macro's to obtain various fields from a packet */ -- 2.26.2