From: Mark Eichin Date: Thu, 27 Apr 1995 15:59:41 +0000 (+0000) Subject: * krb.h: make INTERFACE, FAR go away for now. X-Git-Tag: krb5-1.0-beta5~212 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=0f9771a562ee91049e66bed9fa66007464dc1aef;p=krb5.git * krb.h: make INTERFACE, FAR go away for now. Drag in the unix time conversion functions for unix only. Locally define PROTOTYPE(). Drag in unix versions of SOCKET macros. Recognize DEFINE_SOCKADDR and NEED_TIME_H the way cc-unix.h does. Declare krb_ignore_ip_address. Define DEB() to support non-printf debugging. Declare errno. Define key_proc_type and decrypt_tkt_type. * prot.h: add KERB_ERR_PREAUTH_SHORT and _MISMATCH from Cygnus extensions. * krbports.h: new file, has default ports for V4 services for hard-coded fallback. * lsb_addr_cmp.h: from V4, handles the mutant comparison functions needed for the V4 "direction" comparison. (Rename of lsb_addr_comp.h due to filename length.) git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@5540 dc483132-0cff-0310-8789-dd5450dbe970 --- diff --git a/src/include/kerberosIV/.Sanitize b/src/include/kerberosIV/.Sanitize index c952b85e5..5a52ceca7 100644 --- a/src/include/kerberosIV/.Sanitize +++ b/src/include/kerberosIV/.Sanitize @@ -51,9 +51,11 @@ klog.h kparse.h krb.h krb4-proto.h +krbports.h krb_conf.h krb_db.h krb_err.h +lsb_addr_cmp.h lsb_addr_comp.h mit-copyright.h osconf.h diff --git a/src/include/kerberosIV/ChangeLog b/src/include/kerberosIV/ChangeLog index 1e3f0e7bd..1b6d02aa8 100644 --- a/src/include/kerberosIV/ChangeLog +++ b/src/include/kerberosIV/ChangeLog @@ -1,3 +1,22 @@ +Thu Apr 27 10:55:00 1995 Mark Eichin + + * krb.h: make INTERFACE, FAR go away for now. + Drag in the unix time conversion functions for unix only. + Locally define PROTOTYPE(). + Drag in unix versions of SOCKET macros. + Recognize DEFINE_SOCKADDR and NEED_TIME_H the way cc-unix.h does. + Declare krb_ignore_ip_address. + Define DEB() to support non-printf debugging. + Declare errno. + Define key_proc_type and decrypt_tkt_type. + * prot.h: add KERB_ERR_PREAUTH_SHORT and _MISMATCH from Cygnus + extensions. + * krbports.h: new file, has default ports for V4 services for + hard-coded fallback. + * lsb_addr_cmp.h: from V4, handles the mutant comparison + functions needed for the V4 "direction" comparison. (Rename + of lsb_addr_comp.h due to filename length.) + Tue Mar 14 16:53:37 1995 * Makefile.in: Delete definitions defined in pre/config.in. diff --git a/src/include/kerberosIV/krb.h b/src/include/kerberosIV/krb.h index 4da58a1a1..f21053d3f 100644 --- a/src/include/kerberosIV/krb.h +++ b/src/include/kerberosIV/krb.h @@ -393,4 +393,85 @@ char *tkt_string(); #define KOPT_DO_OLDSTYLE 0x00000008 /* use the old-style protocol */ #endif /* ATHENA_COMPAT */ +/* until we do V4 compat under DOS, just turn this off */ +#define INTERFACE +#define FAR +/* and likewise, just drag in the unix time interface */ +#define TIME_GMT_UNIXSEC unix_time_gmt_unixsec((unsigned KRB4_32 *)0) +#define TIME_GMT_UNIXSEC_US(us) unix_time_gmt_unixsec((us)) +#define CONVERT_TIME_EPOCH ((long)0) /* Unix epoch is Krb epoch */ + +#if defined(__STDC__) || defined(KRB5_PROVIDE_PROTOTYPES) || defined(_WINDOWS) +#define PROTOTYPE(x) x +#else +#define PROTOTYPE(x) () +#endif /* STDC or PROTOTYPES */ + +/* Define u_char, u_short, u_int, and u_long. */ +#include + +/* If this source file requires it, define struct sockaddr_in + (and possibly other things related to network I/O). FIXME. */ +#ifdef DEFINE_SOCKADDR +#include /* For struct sockaddr_in and in_addr */ +#include /* For inet_ntoa */ +#include /* For struct hostent, gethostbyname, etc */ +#include /* For MAXHOSTNAMELEN */ +#include /* For SOCK_*, AF_*, etc */ +#include /* For struct timeval */ +#ifdef NEED_TIME_H +#include /* For localtime, etc */ +#endif +#endif +/* + * Compatability with WinSock calls on MS-Windows... + */ +#define SOCKET unsigned int +#define INVALID_SOCKET ((SOCKET)~0) +#define closesocket close +#define ioctlsocket ioctl +#define SOCKET_ERROR (-1) + +/* Some of our own infrastructure where the WinSock stuff was too hairy + to dump into a clean Unix program... */ + +#define SOCKET_INITIALIZE() (0) /* No error (or anything else) */ +#define SOCKET_CLEANUP() /* nothing */ +#define SOCKET_ERRNO errno +#define SOCKET_SET_ERRNO(x) (errno = (x)) +#define SOCKET_NFDS(f) ((f)+1) /* select() arg for a single fd */ +#define SOCKET_READ read +#define SOCKET_WRITE write +#define SOCKET_EINTR EINTR + +/* ask to disable IP address checking in the library */ +extern int krb_ignore_ip_address; + +/* Debugging printfs shouldn't even be compiled on many systems that don't + support printf! Use it like DEB (("Oops - %s\n", string)); */ + +#ifdef DEBUG +#define DEB(x) if (krb_debug) printf x +extern int krb_debug; +#else +#define DEB(x) /* nothing */ +#endif + + +/* + * Some Unixes don't declare errno in ... + * Move this out to individual c-*.h files if it becomes troublesome. + */ +#ifndef errno +extern int errno; +#endif + +/* Define a couple of function types including parameters. These + are needed on MS-Windows to convert arguments of the function pointers + to the proper types during calls. */ +typedef int (*key_proc_type) PROTOTYPE ((char *, char *, char *, + char *, C_Block)); +typedef int (*decrypt_tkt_type) PROTOTYPE ((char *, char *, char *, char *, + key_proc_type, KTEXT *)); + #endif /* KRB_DEFS */ diff --git a/src/include/kerberosIV/krbports.h b/src/include/kerberosIV/krbports.h new file mode 100644 index 000000000..5b4dc5641 --- /dev/null +++ b/src/include/kerberosIV/krbports.h @@ -0,0 +1,27 @@ +/* krbports.h -- fallback port numbers in case /etc/services isn't changed */ +/* used by: appl/bsd/rcp.c, rlogin.c, rsh.c, knetd.c + kadmin/kadm_ser_wrap.c, lib/kadm/kadm_cli_wrap.c + lib/krb/send_to_kdc.c + movemail/movemail.c, pfrom/popmail.c + server/kerberos.c, slave/kprop.c, kpropd.c +*/ + +#define KRB_SHELL_PORT 544 +#define UCB_SHELL_PORT 514 + +#define KLOGIN_PORT 543 +#define EKLOGIN_PORT 2105 +#define UCB_LOGIN_PORT 513 + +#define KADM_PORT 751 +#define KERBEROS_PORT 750 +#define KERBEROS_SEC_PORT 88 +#define KRB_PROP_PORT 754 + +#define KPOP_PORT 1109 +#define POP3_PORT 110 + +#define KNETD_PORT 2053 + +/* already in rkinit_private.h */ +#define RKINIT_PORT 2108 diff --git a/src/include/kerberosIV/lsb_addr_cmp.h b/src/include/kerberosIV/lsb_addr_cmp.h new file mode 100644 index 000000000..4f867a94f --- /dev/null +++ b/src/include/kerberosIV/lsb_addr_cmp.h @@ -0,0 +1,44 @@ +/* + * include/kerberosIV/lsb_addr_cmp.h + * + * Copyright 1988, 1995 by the Massachusetts Institute of Technology. + * + * For copying and distribution information, please see the file + * . + * + * Comparison macros to emulate LSBFIRST comparison results of network + * byte-order quantities + */ + +#include "mit-copyright.h" +#ifndef LSB_ADDR_COMP_DEFS +#define LSB_ADDR_COMP_DEFS + +#include "osconf.h" + +/* note that if we don't explicitly know if we're LSBFIRST, the + alternate code is byte order independent and will give the + right answer. */ +#ifdef LSBFIRST +#define lsb_net_ulong_less(x,y) ((x < y) ? -1 : ((x > y) ? 1 : 0)) +#define lsb_net_ushort_less(x,y) ((x < y) ? -1 : ((x > y) ? 1 : 0)) +#else +/* MSBFIRST */ +#define u_char_comp(x,y) \ + (((x)>(y))?(1):(((x)==(y))?(0):(-1))) +/* This is gross, but... */ +#define lsb_net_ulong_less(x, y) long_less_than((u_char *)&x, (u_char *)&y) +#define lsb_net_ushort_less(x, y) short_less_than((u_char *)&x, (u_char *)&y) + +#define long_less_than(x,y) \ + (u_char_comp((x)[3],(y)[3])?u_char_comp((x)[3],(y)[3]): \ + (u_char_comp((x)[2],(y)[2])?u_char_comp((x)[2],(y)[2]): \ + (u_char_comp((x)[1],(y)[1])?u_char_comp((x)[1],(y)[1]): \ + (u_char_comp((x)[0],(y)[0]))))) +#define short_less_than(x,y) \ + (u_char_comp((x)[1],(y)[1])?u_char_comp((x)[1],(y)[1]): \ + (u_char_comp((x)[0],(y)[0]))) + +#endif /* LSBFIRST */ + +#endif /* LSB_ADDR_COMP_DEFS */ diff --git a/src/include/kerberosIV/prot.h b/src/include/kerberosIV/prot.h index e6b92df54..d051be3fb 100644 --- a/src/include/kerberosIV/prot.h +++ b/src/include/kerberosIV/prot.h @@ -101,5 +101,8 @@ KTEXT pkt_cipher(); #define KERB_ERR_PRINCIPAL_UNKNOWN 8 #define KERB_ERR_PRINCIPAL_NOT_UNIQUE 9 #define KERB_ERR_NULL_KEY 10 +/* Cygnus extensions for Preauthentication */ +#define KERB_ERR_PREAUTH_SHORT 11 +#define KERB_ERR_PREAUTH_MISMATCH 12 #endif /* PROT_DEFS */