bug in hostap_crypt_tkip.c

Rajendra Kumar rajendra_krsingh
Thu Mar 25 11:28:04 PST 2004

Hi Jouni,
   The following code in hostap_ctypt_tkip.c, looks
buggy to me.
if (iv32 != tkey->rx_iv32 || !tkey->rx_phase1_done) {
   tkip_mixing_phase1(tkey->rx_ttak, tkey->key, 
                      hdr->addr2, iv32);
   tkey->rx_phase1_done = 1;

suppose we recieve an invalid packet (incorrectly
encrypted) and iv32 != tkey->rx_iv32 condition is

we are updating tkey->rx_ttak while tkey->rx_iv32  is
only updated when MIC is verified.

so when you receive a invalid packet, you update
tx_ttak and try to decrypt it , which fails (ICV
so we discard the packet and wait for next packet. now
notice rx_ttak has been modified so next time when you
get correct packet iv32==tkey->rx_iv32 , it wont be
decrypted properly as only tkip_mixing_phase2 is
called this time. so generated rc4key is different
what was used to encrypt that packet and hence all
following packets will be dropped.

Does this make sense ? I guess you did not face this
problem in your testing because, you never received an
invallid packet.

I will appreciate if you can confirm that this is a


Do you Yahoo!?
Yahoo! Finance Tax Center - File online. File on time.

More information about the Hostap mailing list