2.2.9 international patch des.c question/problem

Paul (set@pobox.com)
Sat, 29 May 1999 20:44:42 -0400 (EWT)


Hi.

In the linux/crypto/des.c from the 2.2.9 international patch, there is
a section of code in des_set_key() that always rejects my keys. I was hoping
someone could explain the purpose of this bit of code, and maybe why it
doesnt seem to like any of my keys.

Linux squish 2.2.9 #1 Sat May 22 18:51:38 EDT 1999 i486 unknown
Kernel modules 2.1.121
Gnu C egcs-2.91.60
Binutils 2.9.1.0.7
Linux C Library /lib/libc.so.6
Dynamic linker ldd (GNU libc) 2.0.7
Linux C++ Library 2.8.0
Procps 1.2.7
Mount 2.9r
Net-tools 1.50
Kbd 0.89
Sh-utils 1.16
Modules Loaded bsd_comp ppp slhc serp6f des loop_gen api loop nfs lockd sunrpc af_packet nls_cp437 msdos fat

==========

Here is the code snip: (for all my keys, the conditional is true. If I
just skip this check, everything seems to work ok.)

int des_set_key(struct cipher_context *cx,
u8 *key, int keybytes)
{
register u32 n, w;
register char * b0, * b1;
char bits0[56], bits1[56];

.....

/* check for bad parity and weak keys */
b0 = parity;
n = b0[key[0]]; n <<= 4;
n |= b0[key[1]]; n <<= 4;
n |= b0[key[2]]; n <<= 4;
n |= b0[key[3]]; n <<= 4;
n |= b0[key[4]]; n <<= 4;
n |= b0[key[5]]; n <<= 4;
n |= b0[key[6]]; n <<= 4;
n |= b0[key[7]];
w = 0X88888888L;
/* report bad parity in key */
if ( n & w )
return -1;

==========

Any info appreciated.

Paul
set@pobox.com

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/