[766] in Kerberos-V5-bugs

home help back first fref pref prev next nref lref last post

Patches to get latest version compiled and starting to run on Alpha

daemon@ATHENA.MIT.EDU (epeisach@MIT.EDU)
Thu Sep 22 08:39:38 1994

From: epeisach@MIT.EDU
Date: Thu, 22 Sep 1994 08:39:24 -0400
To: krb5-bugs@MIT.EDU
Cc: tytso@MIT.EDU



The following is my patch to get krb5 running on the Alpha. It is not
complete in that I have not done extensive testing, but kinit, klist,
kdestory work. I am now working on telnet, rlogin, etc....

The changes are relative to the current source tree
(/mit/krb5/.cvsroot...)

Ok - the differences:

	src/appl/telnet/telnet/commands.c:
		When you type 'auth' return - give a real message
		auth enable ? still core dumps - will fix later
	src/appl/telnet/telnetd/configure.in
		For logout and logwtmp the util library is required.
	src/appl/telnet/telnetd/sys_term.c
		Don't declare time() - conflicts with header file.
			Perhaps should be removed for all..

	src/include/krb5/acconfig.h
		Add BITS64
		The extra newline is because autoconf is screwing up
			on my machine if it is not present. Not clear
			why yet - but this fixes the problem.

	src/include/krb5/configure.in
		Determine the difference between BITS64 and BITS32
			There has got to be a cleaner way, but this
			works...

	src/include/krb5/wordsize.h
		BITS64 definition for the alpha... long is 64 bits, int
			is 32. This definition will probably break on a
			cray and better 'casting' or detection may be
			necessary. 

	src/lib/crypto/des/Makefile.in
		a) Get rid of conflicting definitions in the DES
			library. (ar reported multiple occurances). 
			The Fergusson code worked with no changes and I
			kept it. (reported to krb5-bugs before).
		b) Changes to allow you to compile verify

	src/lib/crypto/des/verify.c	
		Patch based on one found in /mit/krb5/brezak.patches
		Don't assume that sizeof long is critical - it's the
			krb5_int32
		Destest needs to be modified as well some time....


More patches will come to you in the future as I make other fixes....

	Ezra

RCS file: /mit/krb5/.cvsroot/src/appl/telnet/telnet/commands.c,v
retrieving revision 5.14
diff -c -r5.14 commands.c
*** 5.14	1994/08/18 21:07:37
--- src/appl/telnet/telnet/commands.c	1994/09/22 03:52:34
***************
*** 1959,1964 ****
--- 1959,1970 ----
  {
      struct authlist *c;
  
+     if (argc < 2) {
+       fprintf(stderr,
+           "Need an argument to 'auth' command.  'auth ?' for help.\n");
+       return 0;
+     }
+ 
      c = (struct authlist *)
  		genget(argv[1], (char **) AuthList, sizeof(struct authlist));
      if (c == 0) {
***************
*** 2058,2063 ****
--- 2064,2075 ----
      char *argv[];
  {
      struct encryptlist *c;
+ 
+     if (argc < 2) {
+ 	fprintf(stderr,
+ 	    "Need an argument to 'encrypt' command.  'encrypt ?' for help.\n");
+ 	return 0;
+     }
  
      c = (struct encryptlist *)
  		genget(argv[1], (char **) EncryptList, sizeof(struct encryptlist));
===================================================================
RCS file: /mit/krb5/.cvsroot/src/appl/telnet/telnetd/configure.in,v
retrieving revision 5.8
diff -c -r5.8 configure.in
*** 5.8	1994/08/16 22:05:59
--- src/appl/telnet/telnetd/configure.in	1994/09/21 18:46:00
***************
*** 14,19 ****
--- 14,20 ----
  AC_HAVE_LIBRARY(dbm)
  AC_HAVE_LIBRARY(termcap,AC_DEFINE(TERMCAP)
  LIBS="$LIBS -ltermcap")
+ AC_HAVE_LIBRARY(util)
  AC_HEADER_CHECK(termios.h,AC_DEFINE(USE_TERMIO) ac_termio=1)
  if test -z "$ac_termio"; then
  AC_HEADER_CHECK(termio.h,AC_DEFINE(SYSV_TERMIO),ac_sysv_termio=1)
===================================================================
RCS file: /mit/krb5/.cvsroot/src/appl/telnet/telnetd/sys_term.c,v
retrieving revision 5.10
diff -c -r5.10 sys_term.c
*** 5.10	1994/08/18 21:08:11
--- src/appl/telnet/telnetd/sys_term.c	1994/09/21 18:46:32
***************
*** 1352,1358 ****
--- 1352,1360 ----
  	char *autoname;
  {
  	register int i;
+ #ifndef __alpha
  	long time();
+ #endif
  #ifdef	NEWINIT
  	extern char *ptyip;
  	struct init_request request;
===================================================================
RCS file: /mit/krb5/.cvsroot/src/include/krb5/acconfig.h,v
retrieving revision 1.4
diff -c -r1.4 acconfig.h
*** 1.4	1994/08/17 02:25:58
--- src/include/krb5/acconfig.h	1994/09/20 15:33:11
***************
*** 3,8 ****
--- 3,9 ----
  #undef ANSI_STDIO
  #undef HAS_SETVBUF
  #undef BITS32
+ #undef BITS64
  #undef HAS_ANSI_CONST
  #undef HAS_ANSI_VOLATILE
  #undef HAS_STDLIB_H
***************
*** 20,25 ****
--- 21,27 ----
  #ifndef STDARG_PROTOTYPES
  #undef STDARG_PROTOTYPES
  #endif /* STDARG_PROTOTYPES -- avoid collision with com_err.h */
+ 
  #undef USE_DIRENT_H
  #undef USE_STRING_H
  #undef WAIT_USES_INT
===================================================================
RCS file: /mit/krb5/.cvsroot/src/include/krb5/configure.in,v
retrieving revision 1.9
diff -c -r1.9 configure.in
*** 1.9	1994/08/17 02:26:00
--- src/include/krb5/configure.in	1994/09/20 15:35:36
***************
*** 74,80 ****
  AC_COMPILE_CHECK([volatile],[volatile int x();], ,AC_DEFINE(HAS_ANSI_VOLATILE))
  
  dnl BITS16, BITS32, BITS64
! AC_DEFINE(BITS32)
  
  dnl then from osconf.h, we have
  AC_TIME_WITH_SYS_TIME
--- 74,96 ----
  AC_COMPILE_CHECK([volatile],[volatile int x();], ,AC_DEFINE(HAS_ANSI_VOLATILE))
  
  dnl BITS16, BITS32, BITS64
! AC_CHECKING(size of long for BITS defintion)
! AC_TEST_PROGRAM([#include <stdio.h>
! main()
! {
!   FILE *f=fopen("conftestval", "w");
!   if (!f) exit(1);
!   fprintf(f, "%d\n", sizeof(long));
!   exit(0);
! }], ac_size=`cat conftestval`, AC_ERROR(can not determine size of long))
! case "$ac_size" in 
! 	8) AC_DEFINE(BITS64) ;;
! 	*) AC_DEFINE(BITS32) ;;
! esac
! 
! 
! dnl AC_SIZEOF_TYPE(long)
! dnl AC_DEFINE(BITS32)
  
  dnl then from osconf.h, we have
  AC_TIME_WITH_SYS_TIME
===================================================================
RCS file: /mit/krb5/.cvsroot/src/include/krb5/wordsize.h,v
retrieving revision 5.16
diff -c -r5.16 src/include/krb5/wordsize.h
*** 5.16	1994/08/18 21:19:45
--- src/include/krb5/wordsize.h
***************
*** 49,59 ****
  typedef	unsigned int	krb5_ui_4;
  #endif
  
- #ifdef NOT_RIGHT_YET
  /*
   * Incorporated from the Sandia changes; but this can't be right; if
   * we're on a 64 bit machine, an int shouldn't be 32 bits!?!
   * [tytso:19920616.2224EDT]
   */
  #ifdef BITS64
  #define __OK
--- 51,61 ----
  typedef	unsigned int	krb5_ui_4;
  #endif
  
  /*
   * Incorporated from the Sandia changes; but this can't be right; if
   * we're on a 64 bit machine, an int shouldn't be 32 bits!?!
   * [tytso:19920616.2224EDT]
+  * For an alpha - ints are 32bit and longs are 64 -- better casting needed
   */
  #ifdef BITS64
  #define __OK
***************
*** 64,70 ****
  typedef	unsigned short	krb5_ui_2;
  typedef	unsigned int	krb5_ui_4;
  #endif
- #endif	/* NOT RIGHT YET */
  
  #ifndef __OK
   ?==error:  must define word size!
--- 66,71 ----
===================================================================
RCS file: /mit/krb5/.cvsroot/src/lib/crypto/des/Makefile.in,v
retrieving revision 1.7
diff -c -r1.7 Makefile.in
*** 1.7	1994/07/02 00:50:37
--- src/lib/crypto/des/Makefile.in	1994/09/20 15:17:55
***************
*** 1,5 ****
--- 1,6 ----
  CFLAGS = $(CCOPTS) $(DEFS)
  LDFLAGS = -g
+ COMERRLIB=$(BUILDTOP)/util/et/libcom_err.a
  
  all:: $(OBJS)
  
***************
*** 9,18 ****
  
  OTHEROBJS=f_cbc.o f_cksum.o f_pcbc.o f_sched.o f_ecb.o f_parity.o f_tables.o
  
! OBJS=	cksum.o		\
  	cbc_cksum.o	\
  	cs_entry.o	\
- 	enc_dec.o	\
  	krb_glue.o	\
  	finish_key.o	\
  	fin_rndkey.o	\
--- 10,18 ----
  
  OTHEROBJS=f_cbc.o f_cksum.o f_pcbc.o f_sched.o f_ecb.o f_parity.o f_tables.o
  
! OBJS=	\
  	cbc_cksum.o	\
  	cs_entry.o	\
  	krb_glue.o	\
  	finish_key.o	\
  	fin_rndkey.o	\
***************
*** 49,69 ****
  clean::
  	$(RM) fp.c ip.c key_perm.h odd.h p.c p_table.h s_table.h
  
! EXT_LIB = $(TOP)/lib/krb5/error_tables/krb5_err.o \
!                   $(TOP)/lib/krb5/error_tables/isode_err.o \
!                   $(TOP)/lib/crypto/cryptoconf.o \
!                   $(TOP)/lib/crypto/crc-32/libcrc32.a \
!                   libdes.a $(OSLIB) $(COMERRLIB)
  
! verify: verify.o libdes.o
! 	$(RM) verify.o
  	$(CC) -o $@ verify.o $(LDFLAGS) $(EXT_LIB)
  
  clean::
  	$(RM) verify
  
! destest: destest.o libdes.o
! 	$(RM) destest.o
  	$(CC) -o $@ destest.o $(LDFLAGS) $(EXT_LIB)
  
  clean::
--- 49,65 ----
  clean::
  	$(RM) fp.c ip.c key_perm.h odd.h p.c p_table.h s_table.h
  
! EXT_LIB = $(BUILDTOP)/lib/krb5/error_tables/krb5_err.o \
!                   $(BUILDTOP)/lib/libcrypto.a \
!                   $(OSLIB) $(COMERRLIB)
  
! verify: verify.o 
  	$(CC) -o $@ verify.o $(LDFLAGS) $(EXT_LIB)
  
  clean::
  	$(RM) verify
  
! destest: destest.o 
  	$(CC) -o $@ destest.o $(LDFLAGS) $(EXT_LIB)
  
  clean::
===================================================================
RCS file: /mit/krb5/.cvsroot/src/lib/crypto/des/verify.c,v
retrieving revision 5.11
diff -c -r5.11 verify.c
*** 5.11	1994/08/18 21:55:24
--- src/lib/crypto/des/verify.c	1994/09/22 12:10:02
***************
*** 37,43 ****
  #include <com_err.h>
  
  extern int errno;
! extern krb5_cryptosystem_entry mit_des_cryptosystem_entry;
  
  char *progname;
  int nflag = 2;
--- 37,43 ----
  #include <com_err.h>
  
  extern int errno;
! extern krb5_cs_table_entry krb5_des_cst_entry;
  
  char *progname;
  int nflag = 2;
***************
*** 106,113 ****
      progname=argv[0];		/* salt away invoking program */
  
      /* Assume a long is four bytes */
!     if (sizeof(long) != 4) {
! 	printf("\nERROR,  size of long is %d",sizeof(long));
  	exit(-1);
      }
  
--- 106,113 ----
      progname=argv[0];		/* salt away invoking program */
  
      /* Assume a long is four bytes */
!     if (sizeof(krb5_int32) != 4) {
! 	printf("\nERROR,  size of krb5_int32 is %d",sizeof(krb5_int32));
  	exit(-1);
      }
  
***************
*** 143,149 ****
      /* do some initialisation */
      initialize_krb5_error_table(); 
  
!     eblock.crypto_entry = &mit_des_cryptosystem_entry;
      keyblock.keytype = KEYTYPE_DES;
      keyblock.length = sizeof (mit_des_cblock);
  
--- 143,149 ----
      /* do some initialisation */
      initialize_krb5_error_table(); 
  
!     eblock.crypto_entry = krb5_des_cst_entry.system;
      keyblock.keytype = KEYTYPE_DES;
      keyblock.length = sizeof (mit_des_cblock);
  
  

home help back first fref pref prev next nref lref last post