From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <04eb01c42665$becced30$0fca7d50@SOMA> From: "boyd, rounin" To: <9fans@cse.psu.edu> References: <31c092fb1a6b81a657845f36752eacba@juice.thebigchoice.com> Subject: Re: [9fans] Microsoft Visual C++ Toolkit 2003 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Date: Tue, 20 Apr 2004 01:26:27 +0200 Topicbox-Message-UUID: 6045eb52-eacd-11e9-9e20-41e7f4b1d025 > there are some other minor errors too > > such as auth.c(104) : warning C4013: 'des56to64' undefined; assuming extern returning int my theory is that you need the inverse of this: -/* - * Convert a Plan 9 key to a DES key. - */ -uchar * -des9key(uchar *key) -{ - int i; - int m1[] = { 0x00, 0x01, 0x03, 0x07, 0x0F, 0x1F, 0x3F }; - int m2[] = { 0x00, 0xFC, 0xF8, 0xF0, 0xE0, 0xC0, 0x80 }; - static uchar nkey[DESKEYPLEN]; - - nkey[0] = key[0] & 0xFE; - - for (i = 1; i < 7; i++) - nkey[i] = (key[i - 1] & m1[i]) << 8 - i | (key[i] & m2[i]) >> i; - - nkey[7] = (key[6] & 0x7F) << 1; - - - return nkey; -} as Plan 9 packs a DES key into 7 bytes, the 8th bit being a 'parity' bit and unused.