I had some time to finish the software WEP crypto module, and then I sat down to test it. It was some hardcore testing with two laptops, one in monitor mode sniffing packets flowing in the air, then dissecting them byte for byte to find out what the problem was. I don’t even want to talk about it.
Anyway: I got WEP working.
In hardware.
Yeah, turns out hardware WEP had been working from the very start, but the receiving of packets was not quite correct. The hardware leaves the IVs and the CRC header and trailer on decoded packets, which was causing my input packet handler to send a frame to OS X which started with an LLC/SNAP header, not a pure Ethernet II header. OS X cannot parse LLC packets (yet), so even when Rx/Tx was working perfectly at the MAC layer, it wasn’t working at the data link layer.
After I fixed that, my software crypto module was handling Tx for WEP, and everything was working. Then I thought, what if I enable hardware crypto, it should work right? So I quickly modified (removed) the sw crypto hook and replaced it with the (much simpler) hw crypt, and lo and behold, I’m online.
Next step: WPA2 in hardware!
WPA1 (TKIP) is a bit tricky for hardware because the card cannot calculate the MIC, so we’ll have to fall back to software crypto for it anyway (but maybe it’s not needed immediately). However, WPA2 (AES/CCMP) should be handled entirely in hardware so we probably won’t need to write software crypto modules for it (yet).
I’ve already finished designing the software cipher interface though, and implemented WEP as an example cipher. I’ll maybe upload that soon so anyone else who feels like it will write the WPA1 cipher.
I already got one firmware error minutes after using hw cipher for WEP, though, so I’ll probably give people an option via sysctl whether they prefer to use software ciphers instead of hw cipher even if such is available.
Now for our little problem with Airport —
Dense has tested and confirms 128bit WEP works, and I’ve tested it as well along with external testers. But 64bit WEP doesn’t seem to work - the Airport UI sends the driver a hashed 128bit key if anything other than 13 ascii characters are entered in the WEP password dialog box. Adding $ or 0x to the key doesn’t help. Hopefully we can find a workaround, but as far as the driver is concerned, hardcoding 64bit key works so it’s most definitely an Airport-related issue.
Anyway that’s it for now. And thanks for all the donations everyone’s been sending - highly appreciated!
I’ve updated the Download entry to include v02 of the kext.