[7483] in Kerberos

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

Re: des_string_to_key() anomoly?

daemon@ATHENA.MIT.EDU (Larry J. Hughes Jr.)
Fri Jun 14 11:11:18 1996

To: kerberos@MIT.EDU
Date: 13 Jun 1996 14:48:42 GMT
From: hughes@bodhi.it.iupui.edu (Larry J. Hughes Jr.)

In article <4pnp4g$3gb@usenet.ucs.indiana.edu>,
Larry J. Hughes Jr. <hughes@bodhi.it.iupui.edu> wrote:
>I've noticed that the des_string_to_key() function produces different 
>results on these two groups of systems.  That is to say, the two LSBFIRST 
>systems produce the same hash for the same password, and the two MSBFIRST 
>systems produce the same hash for the same password, but the password
>hashes don't match between the LSBFIRST and MSBFIRST architectures.

Here is a test program which demonstrates this behavior:

------------------------------------------
#include <stdio.h>
#include <des.h>

typedef unsigned int UINT4;

main()
{
  static des_cblock key;
  char password[80];

  gets(password);
  des_string_to_key(password, key);
  fprintf(stderr, "%x %x\n",
           *((UINT4 *) key)   & 0xffffffff,
           *((UINT4 *) key+1) & 0xffffffff);
}
------------------------------------------

I should also point out that it is the MSBFIRST systems which
are generating the wrong hash value.  The LSBFIRST systems
generate the right one, i.e. one that matches the one stored 
in the KDC database (after decryption with the master key).

Seems that I am doing something wrong above, otherwise I wouldn't
even be able to kinit on the MSBFIRST systems (but of course I can).

---
Larry J. Hughes, Jr.    hughes@indiana.edu
Indiana University      http://copper.ucs.indiana.edu/~hughes/

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