[Bug 367] patches for Cray port

Ben Lindstrom mouring at etoh.eviladmin.org
Tue May 13 11:51:47 EST 2003


On Tue, 13 May 2003, Damien Miller wrote:

> Wendy Palm wrote:
> > actually, that's not true.  i've found i mis-tested and the deattack.c patch
> > is still needed for protocol 2-
>
> That patch looks over-complicated. Does this one work?
>
> Index: deattack.c
> ===================================================================
> RCS file: /var/cvs/openssh/deattack.c,v
> retrieving revision 1.15
> diff -u -r1.15 deattack.c
> --- deattack.c  5 Mar 2002 01:53:05 -0000       1.15
> +++ deattack.c  13 May 2003 00:49:03 -0000
> @@ -33,7 +33,7 @@
>
>  /* Hashing constants */
>  #define HASH_MINSIZE   (8 * 1024)
> -#define HASH_ENTRYSIZE (2)
> +#define HASH_ENTRYSIZE (sizeof(u_int16_t))
>  #define HASH_FACTOR(x) ((x)*3/2)
>  #define HASH_UNUSEDCHAR        (0xff)
>  #define HASH_UNUSED    (0xffff)
>
>

Solves half the problem..

Quote from my archives from Wendy:

i just gave it a try.  replacing the 2 sections mentioned above with the
# define HASH_ENTRYSIZE sizeof(u_int16_t)
seems to work fine.  however, the memset still doesn't work for a cray,
so that needs to be left as the for loop.

cray has 64 bit ints, so if HASH_UNUSED is 0xffff, then shift it 8
ends up with 0xff, which is the same as HASH_UNUSEDCHAR.
so i see that really the for loop should be
#ifdef _UNICOS
        for (i=0; i<n; i++) h[i] = HASH_UNUSEDCHAR;
but that's moot anyway.

i can't figure out right now what's wrong with the memset call, but it's
not working on a cray.  it's got to be something with 8 bit chars and
64bit HASH_ENTRYSIZE.


..End of Quote..

I'm still digging.. I think I ended looking at a patch that did what you
wrote and kept the second part of the patch.

- Ben




More information about the openssh-unix-dev mailing list