[2360] in Kerberos

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

Re: safe message problem: HP to 486

daemon@ATHENA.MIT.EDU (Shawn Mamros)
Mon Nov 9 12:16:36 1992

Date: 9 Nov 92 15:38:39 GMT
From: mamros@athena.lkg.dec.com (Shawn Mamros)
Reply-To: mamros@athena.lkg.dec.com (Shawn Mamros)
To: kerberos@shelby.Stanford.EDU


I noticed the same problem with safe messages between machines with different
byte-ordering a couple months ago (in my case, between a DECstation (little-
endian) and a Sun SPARCstation (big-endian).  I changed the checksum
byte-swapping code in src/lib/krb/rd_safe.c to swap one longword (four bytes)
at a time, and that seemed to fix it.

I also sent my fix to kerberos-bugs@athena.mit.edu, but haven't received
any acknowledgement one way or another.  I have no doubt that this has already
been noticed long before I did, and odds are good there was probably even
a patch posted to this mailing list a long time ago, but I've never seen
any place where "official" fixes to patchlevel 9 have been kept...  For
what it's worth, here's my patchlevel 9-based fix:

*** rd_safe.c   Mon Sep 14 10:25:32 1992
--- rd_safe.c.orig      Mon Jan 23 15:16:38 1989
***************
*** 165,179 ****
       */
  
      bcopy((char *)p,(char *)big_cksum,sizeof(big_cksum));
!     if (swap_bytes) {
!       u_long *swapptr;
!       int i;
! 
!       for (i = 0; i < 4; i++) {
!           swapptr = (u_long *)(big_cksum) + i;
!           swap_u_long(*swapptr);
!       }
!     }
  
  #ifdef NOENCRYPTION
      bzero(calc_cksum, sizeof(calc_cksum));
--- 165,171 ----
       */
  
      bcopy((char *)p,(char *)big_cksum,sizeof(big_cksum));
!     if (swap_bytes) swap_u_16(big_cksum);
  
  #ifdef NOENCRYPTION
      bzero(calc_cksum, sizeof(calc_cksum));


Private messages don't seem to suffer from the same problem... actually, if
you look at rd_priv.c from patchlevel 9, you'll see that the checksum-checking
clause has been #ifdef'd out... sigh.

-Shawn Mamros
E-mail to: mamros@athena.lkg.dec.com

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