<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2900.2604" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face=Arial size=2>Howdy,</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>I'm working on my own TKIP WPA-PSK client.&nbsp; 
I'm having trouble with message 2 of the four way handshake.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>Specifcally, using Ethereal I can verify that I 
correctly send EAPOL start, and that I correctly parse Message 1 from the Access 
point to the supplicant.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>I compose Message 2 according to the spec.&nbsp; My 
routines for calculating the password hash, pairwise temporal key, and HMAC-MD5 
hash produce the correct answers when using the spec test vectors.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>When I send Message 2 it is ignored by the AP, and 
ethereal complains that it is a malformed packet.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>Here is my Message 2 as captured:</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>=================================</FONT></DIV>
<DIV><FONT face=Arial size=2>No.&nbsp;&nbsp;&nbsp;&nbsp; 
Time&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
Source&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
Destination&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Protocol 
Info<BR>&nbsp;&nbsp;&nbsp;&nbsp; 14 38.256563&nbsp;&nbsp; 
172.16.1.6&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
D-Link_bc:28:e9&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; EAPOL&nbsp;&nbsp;&nbsp; 
Key[Malformed Packet]</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>Frame 14 (121 bytes on wire, 121 bytes 
captured)<BR>&nbsp;&nbsp;&nbsp; Arrival Time: Mar 29, 2005 
16:22:20.661177000<BR>&nbsp;&nbsp;&nbsp; Time delta from previous packet: 
1.250820000 seconds<BR>&nbsp;&nbsp;&nbsp; Time since reference or first frame: 
38.256563000 seconds<BR>&nbsp;&nbsp;&nbsp; Frame Number: 
14<BR>&nbsp;&nbsp;&nbsp; Packet Length: 121 bytes<BR>&nbsp;&nbsp;&nbsp; Capture 
Length: 121 bytes<BR>Ethernet II, Src: 00:02:8a:c8:33:2a, Dst: 
00:0d:88:bc:28:e9<BR>&nbsp;&nbsp;&nbsp; Destination: 00:0d:88:bc:28:e9 
(D-Link_bc:28:e9)<BR>&nbsp;&nbsp;&nbsp; Source: 00:02:8a:c8:33:2a 
(172.16.1.6)<BR>&nbsp;&nbsp;&nbsp; Type: 802.1X Authentication 
(0x888e)<BR>802.1x Authentication<BR>&nbsp;&nbsp;&nbsp; Version: 
1<BR>&nbsp;&nbsp;&nbsp; Type: Key (3)<BR>&nbsp;&nbsp;&nbsp; Length: 
121<BR>&nbsp;&nbsp;&nbsp; Descriptor Type: EAPOL WPA key 
(254)<BR>&nbsp;&nbsp;&nbsp; Key Information: 
0x0109<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; .... .... .... .001 = Key 
Descriptor Version: HMAC-MD5 for MIC and RC4 for encryption 
(1)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; .... .... .... 1... = Key 
Type: Pairwise key<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; .... .... ..00 
.... = Key Index: 0<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; .... .... .0.. 
.... = Install flag: Not set<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; .... 
.... 0... .... = Key Ack flag: Not 
set<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; .... ...1 .... .... = Key MIC 
flag: Set<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; .... ..0. .... .... = 
Secure flag: Not set<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; .... .0.. 
.... .... = Error flag: Not set<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
.... 0... .... .... = Request flag: Not 
set<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ...0 .... .... .... = 
Encrypted Key Data flag: Not set<BR>&nbsp;&nbsp;&nbsp; Key Length: 
32<BR>&nbsp;&nbsp;&nbsp; Replay Counter: 3<BR>&nbsp;&nbsp;&nbsp; Nonce: 
FCFB4B2ADC5C314394AB890413628B3D1F571880369EE664...<BR>&nbsp;&nbsp;&nbsp; Key 
IV: 00000000000000000000000000000000<BR>&nbsp;&nbsp;&nbsp; WPA Key RSC: 
0000000000000000<BR>&nbsp;&nbsp;&nbsp; WPA Key ID: 
0000000000000000<BR>&nbsp;&nbsp;&nbsp; WPA Key MIC: 
5BC9C16E109AB8C9347A2156283A4396<BR>&nbsp;&nbsp;&nbsp; WPA Key Length: 
26<BR>[Malformed Packet: EAPOL]</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>0000&nbsp; 00 0d 88 bc 28 e9 00 02 8a c8 33 2a 88 
8e 01 03&nbsp;&nbsp; ....(.....3*....<BR>0010&nbsp; 00 79 fe 01 09 00 20 00 00 
00 00 00 00 00 03 fc&nbsp;&nbsp; .y.... .........<BR>0020&nbsp; fb 4b 2a dc 5c 
31 43 94 ab 89 04 13 62 8b 3d 1f&nbsp;&nbsp; .K*.\1C.....b.=.<BR>0030&nbsp; 57 
18 80 36 9e e6 64 16 38 38 97 84 fa fa 8e 00&nbsp;&nbsp; 
W..6..d.88......<BR>0040&nbsp; 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
00&nbsp;&nbsp; ................<BR>0050&nbsp; 00 00 00 00 00 00 00 00 00 00 00 
00 00 00 00 5b&nbsp;&nbsp; ...............[<BR>0060&nbsp; c9 c1 6e 10 9a b8 c9 
34 7a 21 56 28 3a 43 96 00&nbsp;&nbsp; ..n....4z!V(:C..<BR>0070&nbsp; 1a dd 18 
00 50 f2 01 01 
00&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
....P....<BR>======================================</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>I am not sure what the problem is, but I have two 
suspections:</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>1) I&nbsp;may not be&nbsp;correctly calcuting the 
MIC.&nbsp; Specifically, am I correct in saying that:</FONT></DIV>
<DIV><FONT face=Arial size=2>&nbsp;&nbsp; a) &nbsp;the MIC is calculated using 
HMAC-MD5&nbsp;,</FONT></DIV>
<DIV><FONT face=Arial size=2>&nbsp;&nbsp; and</FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>&nbsp;&nbsp; b) </FONT><FONT face=Arial size=2>the 
input to the HMAC-MD5&nbsp;has function should be the&nbsp; frame as shown above 
begining just past the destination and source address, that is starting with the 
ethernet verison packet:&nbsp; 01, 03, 00, 79..... and&nbsp;continuing through 
the end of the Information Element at the end of the packet?&nbsp; </FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>As you see, Ethereal is truncating the IE for some 
reason.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>2)&nbsp; I am returning the Information Element 
exactly as I receive it from the access point.&nbsp; Is that correct, or should 
I do some kind of processing on it?</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>Thanks,</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>Jim Howard</FONT></DIV></BODY></HTML>