MIC computation wpa_supplicant -> python script

seb2 at gmx.at seb2
Sun Mar 3 10:45:18 PST 2013


Hello Mailing List!

I am trying to write a script, that produces a wpa 4 way handshake, but unfortunatelly the MIC fails to compute. I think I am doing it correct, with the correct input (I reference to the following page):
http://hostap.epitest.fi/wpa_supplicant/devel/wpa__common_8c.html
(int wpa_eapol_key_mic)

This is the relevant Python code:

mic = hmac.new(ptk[0:16],data)
print "mic: " + mic.hexdigest()  + "\n"

Where hmac.new is taken from the hmac lib:

import hmac,hashlib,binascii

Further, I am sure that the PTK is correct, since I confirmed it by using cowPatty...

This is my 802.1x data:
01030077fe010a001000000000000000
01ae11df37f5fb100665ce0c849f5950
c0e7901da3224ddfc9e9434babad5512
73000000000000000000000000000000
00000000000000000000000000000000
00e8b4b90bfc3fd97b657afeb66262ae
940018dd160050f20101000050f20201
000050f20401000050f202

This would be the whole packet:
00000d0004800200020000000088013a
01021a11f75a406067209ef2f8021a11
f75a4000000000aaaa03000000888e01
030077fe010a00100000000000000001
ae11df37f5fb100665ce0c849f5950c0
e7901da3224ddfc9e9434babad551273
00000000000000000000000000000000
00000000000000000000000000000000
e8b4b90bfc3fd97b657afeb66262ae94
0018dd160050f20101000050f2020100
0050f20401000050f202

The MIC that Wireshark calculates is:

e8b4b90bfc3fd97b657afeb66262ae94

The MIC that I calculate is:

5492624bb538b52d6aa6261c692bd595

I hope, that I have found the right mailing list now (after I tried some programming boards- without success...)

Best regards!




More information about the Hostap mailing list