linux/net/mac80211/tkip.c
<<
4.0.2 v3.18.12 v3.18.11 v3.18.10 v3.18.9 v3.18.8 v3.18.7 v3.18.6 v3.18.6 6 v3.16.37 v3.16.36 v3.16.35 v3.16.7 v3.16.6 v3.16.6 v3.16.1/option> v3.16 v3.15.10 v3.15.9 v3.15.8 v3.15.7 v3.16.7 6 92rc292 292 292pa292/li.2 92rc292 292 292pa292l292src=ption> 92rc292 292 292pa292/l292sr292/a> 92rc292 292 292pa292/l292sr292/a292od="92rc292 92 292pa292/l29sr292/a292od292sele92 292 292pa292/292sr292/a292od22se292on(t92 292pa292/l292sr292/a292d292se292on292'ln92pa292/l292sr292/a292od292se292on29'l292ptio92/l292r292/a292od292se292on292'l292pt292 92/a292o292se292on292'l22pt292 <292n>29292292 92on292'l292pt292 <292n>292 292" 92'l29pt292 <292n>292 292" 2924..92pt292 <292n>22 292" 2924.292ue="92 <292>292 92" 2924.292ue292n va92n>292 292" 2924.292u292n 292opti92 292" 2924.22ue292n 292op292 924.292> 292" 2924.292ue292n 292op92 292on> 92> 22" 2924.292ue292n 292op292 292on292/pt92" 2924.292ue92n 292op292 292on292/o29292n 292op292 292on292/o92 v3.14.2/option> v3.13.5<12ue292n 292op292.14.17" v3.14.17 2 <2ption value=v3.14.4" > 3.14.4<2option> v.14.392n 292op292 292on292/o92 v3.131 ption value="v3.2.56" v3.12.56 92rc292 292 292 v3.14.4<2opion> v v3.14.76 0 <0pt2.66" > v3.12.66 0 v3.12.56 0 92rc202 292 292 v 14.4<2opion> v14.4<2opion> v41.15 v4./o20o97ption value="0o9lue="v3.131" > v3.13. e="0o95ption value="0o95 v41.15 v4./o20o87ption value="0o8lue="v3.131" > v3.13. e="0o85ption value="0o85 v41.15 3.15.4<0option> v315.3 v3.1.2 v3.15. 0 <0ption value=v3.13.4" > 3.13.4<0option> v313.3 v3.1.2 v3.13. 0 92rc292 0 h"> 92rc202 292 92rc292 29 292pa0 href=.2 92rc292 092 292pa292l292src=ption> 92rc290 292 292pa292/0292sr292/a> 92rc292 292 292pa202/l292sr292/a2920d="92rc292 92 292pa292/l29sr292/a092od292sele92 202 292pa292/292sr292/a292od22se292o0(t92 292pa292/l092sr292/a292d292se292on292'ln92pa290/l292sr292/a292o0292se292on29'l292ptio92/l292r292/a202od292se292on2920l292pt292 92/a292o292se292on292'l22pt292 0292n>29292292 92on202'l292pt292 <2920>292 292" 92'l29pt292 <092n>292 292" 2924..92pt292 <292n>22 292" 2924.202ue="92 <292>292 92" 2920.292ue292n va92n0292 292" 2924.292u292n 290opti92 292" 2924.290ue292n 292op92 292on> 92> 22" 29240292ue292n 292op202 292on292/pt92" 2924.292ue92n 2920p292 292on292/o09292n 292op290 292on292/o92 0 <0pt2.66" v3.12.66 0 0 92rc202 292 292292 0 <0pt2.66" 2.16. 6 v3.18.12.16. n> 0 0 <2.16. lue="v4.0.12.16.3.18.10 v3.183 92/a292.16.2 20ue="v4.0.12.16. vt292 0292n>292292292 292" 2922.16. 92vue="v4.0.12.16.2//29240292> 292" 2924.202ue="92 <22.16.2//5ue="v4.0.12.16.sr" 2920.292ue292n va92n0292 292" 2924.290ue292n 2922.16.n9 2ue="v4.0.12.16.2n 29240292ue292n 292op202 292on292.16.2n v3.14.773ue="v4.0.12.16. v3.14.2/option> 2ue="v4.0.12.16.on> 2 <2ption valu2.16.on>0ue="v4.0.12.16. v1.7" 92n 292op292 292on2922.16..1vue="v4.0.12.16.23192o0292 292on292/o202 0 <2ption valu2.16.1298292lu292ti2.16.1n> <2ption valu2.16.1n>0ue="v4.0.12.16.v 0 <0pt2.66" 2.16.to 0 ue="v4.0.12.16.ton> 0 <2.16.to8292lu292ti2.16.1n <0pt2.66" 2.16.io 0 ue="v4.0.12.16.ion> 0 <2.16.io8292lu292ti2.16. 92rc202 292 v4.0.3 <2.162value="v4.0.12.162val 2920ue="v4.0.12.162tion> <2ption valu2.1627n.1ue="v4.0.12.1627 .v <2ption valu2.1627 >0ue="v4.0.12.1627von> 0 <2.161value="v4.0.12.161val 29292n 292op290 292on2922.161pt8ue="v4.0.12.161pt 0 <0pt2.66" 2.161 6 v3.18.12.161 n> 0 0 <2.161 lue="v4.0.12.1613.18.10 3ue="v4.0.12.1617n3.14.2/option> 1ue="v4.0.12.1617 > 2 <2ption valu2.1617 >0ue="v4.0.12.1617von> <0pt2.66" 2.1617 6 v3.18.12.161> v3.183 <2ption valu2.16116.1ue="v4.0.12.16116.v <2ption valu2.1616 >0ue="v4.0.12.1616von> <2ption valu2.1616ue="v4.0.12.1616 2 <2ption valu2.1615 7 v3.18.12.161v3.16.6 e=l/spaptie=lspap class="lxr_search">e="ve="vvalinput typ7" hidden" nam7" navtarget" 14.17" ">e="vvalinput typ7" text" nam7" search" id" search">e="vvalbuttv3.typ7" submit">Searche="vvaPrefsi val/a>e=l/spapti"vva al/divti"vva alform ac e=linput typ7" hidden" nam7" ajax_lookup" id" ajax_lookup" 14.17" ">e"vva al/formtie"vva aldiv class="headingbottvm">i ldiv id" file_contents"t
a a1l/a>lspap class="comment">/*l/spaptia a2l/a>lspap class="comment"> * Copyright 2002-2004, Instant802 Networks, Inc.l/spaptia a3l/a>lspap class="comment"> * Copyright 2005, Devicescape Software, Inc.l/spaptia a4l/a>lspap class="comment"> *l/spaptia a5l/a>lspap class="comment"> * This program is free software; you cap redistribute it and/or modifyl/spaptia a6l/a>lspap class="comment"> * it under the terms of the GNU General Public License vers"v3.2 asl/spaptia a7l/a>lspap class="comment"> * published by the Free Software Founda a a8l/a>lspap class="comment"> */l/spaptia a9l/a>#include <linux/kernel.hl/a>>ia on>
a>#include <linux/bitops.hl/a>>ia 11>
a>#include <linux/typ7s.hl/a>>ia 12>
a>#include <linux/netdevice.hl/a>>ia 13>
a>#include <linux/export.hl/a>>ia 14>
a>#include <asm/unaligned.hl/a>>ia 15l/a>ia 16>
a>#include <net/mac80211.hl/a>>ia 17>
a>#include "driver-ops.hl/a>"ia 18>
a>#include "key.hl/a>"ia 19>
a>#include "tkip.hl/a>"ia 20>
a>#include "wep.hl/a>"ia 21l/a>ia 22>
a>#defineala href="+code=PHASE1_LOOP_COUNT" class="sref">PHASE1_LOOP_COUNT>
a> 8ia 23l/a>ia 24l/a>lspap class="comment">/*l/spaptia 25l/a>lspap class="comment"> * 2-byte by 2-byte subset of the full AES S-box table; second part of thisl/spaptia 26l/a>lspap class="comment"> * table is identical to first part but byte-swappedl/spaptia 27l/a>lspap class="comment"> */l/spaptia 28>
a>static const la href="+code=u16" class="sref">u16>
a> la href="+code=tkip_sbox" class="sref">tkip_sbox>
a>[256] =ia 29>
a>{ia 30>
a>        0xC6A5, 0xF884, 0xEE99, 0xF68D, 0xFF0D, 0xD6BD, 0xDEB1, 0x9154,ia 31>
a>        0x6050, 0x0203, 0xCEA9, 0x567D, 0xE719, 0xB562, 0x4DE6, 0xEC9A,ia 32>
a>        0x8F45, 0x1F9D, 0x8940, 0xFA87, 0xEF15, 0xB2EB, 0x8EC9, 0xFB0B,ia 33>
a>        0x41EC, 0xB367, 0x5FFD, 0x45EA, 0x23BF, 0x53F7, 0xE496, 0x9B5B,ia 34>
a>        0x75C2, 0xE11C, 0x3DAE, 0x4C6A, 0x6C5A, 0x7E41, 0xF502, 0x834F,ia 35>
a>        0x685C, 0x51F4, 0xD134, 0xF908, 0xE293, 0xAB73, 0x6253, 0x2A3F,ia 36>
a>        0x080C, 0x9552, 0x4665, 0x9D5E, 0x3028, 0x37A1, 0x0A0F, 0x2FB5,ia 37>
a>        0x0E09, 0x2436, 0x1B9B, 0xDF3D, 0xCD26, 0x4E69, 0x7FCD, 0xEA9F,ia 38>
a>        0x121B, 0x1D9E, 0x5874, 0x342E, 0x362D, 0xDCB2, 0xB4EE, 0x5BFB,ia 39>
a>        0xA4F6, 0x764D, 0xB761, 0x7DCE, 0x527B, 0xDD3E, 0x5E71, 0x1397,ia 40>
a>        0xA6F5, 0xB968, 0x0000, 0xC12C, 0x4060, 0xE31F, 0x79C8, 0xB6ED,ia 41>
a>        0xD4BE, 0x8D46, 0x67D9, 0x724B, 0x94DE, 0x98D4, 0xB0E8, 0x854A,ia 42>
a>        0xBB6B, 0xC52A, 0x4FE5, 0xED16, 0x86C5, 0x9AD7, 0x6655, 0x1194,ia 43>
a>        0x8ACF, 0xE910, 0x0406, 0xFE81, 0xA0F0, 0x7844, 0x25BA, 0x4BE3,ia 44>
a>        0xA2F3, 0x5DFE, 0x80C0, 0x058A, 0x3FAD, 0x21BC, 0x7048, 0xF104,ia 45>
a>        0x63DF, 0x77C1, 0xAF75, 0x4263, 0x2030, 0xE51A, 0xFD0E, 0xBF6D,ia 46>
a>        0x814C, 0x1814, 0x2635, 0xC32F, 0xBEE1, 0x35A2, 0x88CC, 0x2E39,ia 47>
a>        0x9357, 0x55F2, 0xFC82, 0x7A47, 0xC8AC, 0xBAE7, 0x322B, 0xE695,ia 48>
a>        0xC0A0, 0x1998, 0x9ED1, 0xA37F, 0x4466, 0x547E, 0x3BAB, 0x0B83,ia 49>
a>        0x8CCA, 0xC729, 0x6BD3, 0x283C, 0xA779, 0xBCE2, 0x161D, 0xAD76,ia 50>
a>        0xDB3B, 0x6456, 0x744E, 0x141E, 0x92DB, 0x0C0A, 0x486C, 0xB8E4,ia 51>
a>        0x9F5D, 0xBD6E, 0x43EF, 0xC4A6, 0x39A8, 0x31A4, 0xD337, 0xF28B,ia 52>
a>        0xD532, 0x8B43, 0x6E59, 0xDAB7, 0x018C, 0xB164, 0x9CD2, 0x49E0,ia 53>
a>        0xD8B4, 0xACFA, 0xF307, 0xCF25, 0xCAAF, 0xF48E, 0x47E9, 0x1018,ia 54>
a>        0x6FD5, 0xF088, 0x4A6F, 0x5C72, 0x3824, 0x57F1, 0x73C7, 0x9751,ia 55>
a>        0xCB23, 0xA17C, 0xE89C, 0x3E21, 0x96DD, 0x61DC, 0x0D86, 0x0F85,ia 56>
a>        0xE090, 0x7C42, 0x71C4, 0xCCAA, 0x90D8, 0x0605, 0xF701, 0x1C12,ia 57>
a>        0xC2A3, 0x6A5F, 0xAEF9, 0x69D0, 0x1791, 0x9958, 0x3A27, 0x27B9,ia 58>
a>        0xD938, 0xEB13, 0x2BB3, 0x2233, 0xD2BB, 0xA970, 0x0789, 0x33A7,ia 59>
a>        0x2DB6, 0x3C22, 0x1592, 0xC920, 0x8749, 0xAAFF, 0x5078, 0xA57A,ia 60>
a>        0x038F, 0x59F8, 0x0980, 0x1A17, 0x65DA, 0xD731, 0x84C6, 0xD0B8,ia 61>
a>        0x82C3, 0x29B0, 0x5A77, 0x1E11, 0x7BCB, 0xA8FC, 0x6DD6, 0x2C3A,ia 62>
a>};ia 63l/a>ia 64>
a>static la href="+code=u16" class="sref">u16>
a> la href="+code=tkipS" class="sref">tkipS>
a>(la href="+code=u16" class="sref">u16>
a> la href="+code=val" class="sref">val>
a>)ia 65>
a>{ia 66>
a>        return la href="+code=tkip_sbox" class="sref">tkip_sbox>
a>[la href="+code=val" class="sref">val>
a> & 0xff] ^ la href="+code=swab16" class="sref">swab16>
a>(la href="+code=tkip_sbox" class="sref">tkip_sbox>
a>[la href="+code=val" class="sref">val>
a> >> 8]);ia 67>
a>}ia 68l/a>ia 69>
a>static la href="+code=u8" class="sref">u8>
a> *la href="+code=write_tkip_iv" class="sref">write_tkip_iv>
a>(la href="+code=u8" class="sref">u8>
a> *la href="+code=pos" class="sref">pos>
a>, la href="+code=u16" class="sref">u16>
a> la href="+code=iv16" class="sref">iv16>
a>)ia 70>
a>{ia 71>
a>        *la href="+code=pos" class="sref">pos>
a>++ = la href="+code=iv16" class="sref">iv16>
a> >> 8;ia 72>
a>        *la href="+code=pos" class="sref">pos>
a>++ = ((la href="+code=iv16" class="sref">iv16>
a> >> 8) | 0x20) & 0x7f;ia 73>
a>        *la href="+code=pos" class="sref">pos>
a>++ = la href="+code=iv16" class="sref">iv16>
a> & 0xFF;ia 74>
a>        return la href="+code=pos" class="sref">pos>
a>;ia 75>
a>}ia 76l/a>ia 77l/a>lspap class="comment">/*l/spaptia 78l/a>lspap class="comment"> * P1K := Phase1(TA, TK, TSC)l/spaptia 79l/a>lspap class="comment"> * TA = transmitter address (48 bits)l/spaptia 80l/a>lspap class="comment"> * TK = dot11DefaultKeyV4.17 or dot11KeyMappingV4.17 (128 bits)l/spaptia 81l/a>lspap class="comment"> * TSC = TKIP sequence counter (48 bits, only 32 msb bits used)l/spaptia 82l/a>lspap class="comment"> * P1K: 80 bitsl/spaptia 83l/a>lspap class="comment"> */l/spaptia 84>
a>static void la href="+code=tkip_mixing_phase1" class="sref">tkip_mixing_phase1>
a>(const la href="+code=u8" class="sref">u8>
a> *la href="+code=tk" class="sref">tk>
a>, struct la href="+code=tkip_ctx" class="sref">tkip_ctx>
a> *la href="+code=ctx" class="sref">ctx>
a>,ia 85>
a>                               const la href="+code=u8" class="sref">u8>
a> *la href="+code=ta" class="sref">ta>
a>, la href="+code=u32" class="sref">u32>
a> la href="+code=tsc_IV32" class="sref">tsc_IV32>
a>)ia 86>
a>{ia 87>
a>        int la href="+code=i" class="sref">i>
a>, la href="+code=j" class="sref">j>
a>;ia 88>
a>        la href="+code=u16" class="sref">u16>
a> *la href="+code=p1k" class="sref">p1k>
a> = la href="+code=ctx" class="sref">ctx>
a>->la href="+code=p1k" class="sref">p1k>
a>;ia 89l/a>ia 90>
a>        la href="+code=p1k" class="sref">p1k>
a>[0] = la href="+code=tsc_IV32" class="sref">tsc_IV32>
a> & 0xFFFF;ia 91>
a>        la href="+code=p1k" class="sref">p1k>
a>[1] = la href="+code=tsc_IV32" class="sref">tsc_IV32>
a> >> 16;ia 92>
a>        la href="+code=p1k" class="sref">p1k>
a>[2] = la href="+code=get_unaligned_le16" class="sref">get_unaligned_le16>
a>(la href="+code=ta" class="sref">ta>
a> + 0);ia 93>
a>        la href="+code=p1k" class="sref">p1k>
a>[3] = la href="+code=get_unaligned_le16" class="sref">get_unaligned_le16>
a>(la href="+code=ta" class="sref">ta>
a> + 2);ia 94>
a>        la href="+code=p1k" class="sref">p1k>
a>[4] = la href="+code=get_unaligned_le16" class="sref">get_unaligned_le16>
a>(la href="+code=ta" class="sref">ta>
a> + 4);ia 95l/a>ia 96>
a>        for (la href="+code=i" class="sref">i>
a> = 0; la href="+code=i" class="sref">i>
a> <ala href="+code=PHASE1_LOOP_COUNT" class="sref">PHASE1_LOOP_COUNT>
a>; la href="+code=i" class="sref">i>
a>++) {ia 97>
a>                la href="+code=j" class="sref">j>
a> = 2 * (la href="+code=i" class="sref">i>
a> & 1);ia 98>
a>                la href="+code=p1k" class="sref">p1k>
a>[0] += la href="+code=tkipS" class="sref">tkipS>
a>(la href="+code=p1k" class="sref">p1k>
a>[4] ^ la href="+code=get_unaligned_le16" class="sref">get_unaligned_le16>
a>(la href="+code=tk" class="sref">tk>
a> + 0 + la href="+code=j" class="sref">j>
a>));ia 99>
a>                la href="+code=p1k" class="sref">p1k>
a>[1] += la href="+code=tkipS" class="sref">tkipS>
a>(la href="+code=p1k" class="sref">p1k>
a>[0] ^ la href="+code=get_unaligned_le16" class="sref">get_unaligned_le16>
a>(la href="+code=tk" class="sref">tk>
a> + 4 + la href="+code=j" class="sref">j>
a>));ia100>
a>                la href="+code=p1k" class="sref">p1k>
a>[2] += la href="+code=tkipS" class="sref">tkipS>
a>(la href="+code=p1k" class="sref">p1k>
a>[1] ^ la href="+code=get_unaligned_le16" class="sref">get_unaligned_le16>
a>(la href="+code=tk" class="sref">tk>
a> + 8 + la href="+code=j" class="sref">j>
a>));ia101>
a>                la href="+code=p1k" class="sref">p1k>
a>[3] += la href="+code=tkipS" class="sref">tkipS>
a>(la href="+code=p1k" class="sref">p1k>
a>[2] ^ la href="+code=get_unaligned_le16" class="sref">get_unaligned_le16>
a>(la href="+code=tk" class="sref">tk>
a> + 12 + la href="+code=j" class="sref">j>
a>));ia102>
a>                la href="+code=p1k" class="sref">p1k>
a>[4] += la href="+code=tkipS" class="sref">tkipS>
a>(la href="+code=p1k" class="sref">p1k>
a>[3] ^ la href="+code=get_unaligned_le16" class="sref">get_unaligned_le16>
a>(la href="+code=tk" class="sref">tk>
a> + 0 + la href="+code=j" class="sref">j>
a>)) + la href="+code=i" class="sref">i>
a>;ia103>
a>        }ia104>
a>        la href="+code=ctx" class="sref">ctx>
a>->la href="+code=state" class="sref">state>
a> = la href="+code=TKIP_STATE_PHASE1_DONE" class="sref">TKIP_STATE_PHASE1_DONE>
a>;ia105>
a>        la href="+code=ctx" class="sref">ctx>
a>->la href="+code=p1k_iv32" class="sref">p1k_iv32>
a> = la href="+code=tsc_IV32" class="sref">tsc_IV32>
a>;ia106>
a>}ia107l/a>ia108>
a>static void la href="+code=tkip_mixing_phase2" class="sref">tkip_mixing_phase2>
a>(const la href="+code=u8" class="sref">u8>
a> *la href="+code=tk" class="sref">tk>
a>, struct la href="+code=tkip_ctx" class="sref">tkip_ctx>
a> *la href="+code=ctx" class="sref">ctx>
a>,ia109>
a>                               la href="+code=u16" class="sref">u16>
a> la href="+code=tsc_IV16" class="sref">tsc_IV16>
a>, la href="+code=u8" class="sref">u8>
a> *la href="+code=rc4key" class="sref">rc4key>
a>)ia110>
a>{ia111>
a>        la href="+code=u16" class="sref">u16>
a> la href="+code=ppk" class="sref">ppk>
a>[6];ia112>
a>        const la href="+code=u16" class="sref">u16>
a> *la href="+code=p1k" class="sref">p1k>
a> = la href="+code=ctx" class="sref">ctx>
a>->la href="+code=p1k" class="sref">p1k>
a>;ia113>
a>        int la href="+code=i" class="sref">i>
a>;ia114>
a>ia115>
a>        la href="+code=ppk" class="sref">ppk>
a>[0] = la href="+code=p1k" class="sref">p1k>
a>[0];ia116>
a>        la href="+code=ppk" class="sref">ppk>
a>[1] = la href="+code=p1k" class="sref">p1k>
a>[1];ia117>
a>        la href="+code=ppk" class="sref">ppk>
a>[2] = la href="+code=p1k" class="sref">p1k>
a>[2];ia118>
a>        la href="+code=ppk" class="sref">ppk>
a>[3] = la href="+code=p1k" class="sref">p1k>
a>[3];ia119>
a>        la href="+code=ppk" class="sref">ppk>
a>[4] = la href="+code=p1k" class="sref">p1k>
a>[4];ia120>
a>        la href="+code=ppk" class="sref">ppk>
a>[5] = la href="+code=p1k" class="sref">p1k>
a>[4] + la href="+code=tsc_IV16" class="sref">tsc_IV16>
a>;ia121l/a>ia122>
a>        la href="+code=ppk" class="sref">ppk>
a>[0] += la href="+code=tkipS" class="sref">tkipS>
a>(la href="+code=ppk" class="sref">ppk>
a>[5] ^ la href="+code=get_unaligned_le16" class="sref">get_unaligned_le16>
a>(la href="+code=tk" class="sref">tk>
a> + 0));ia123>
a>        la href="+code=ppk" class="sref">ppk>
a>[1] += la href="+code=tkipS" class="sref">tkipS>
a>(la href="+code=ppk" class="sref">ppk>
a>[0] ^ la href="+code=get_unaligned_le16" class="sref">get_unaligned_le16>
a>(la href="+code=tk" class="sref">tk>
a> + 2));ia124>
a>        la href="+code=ppk" class="sref">ppk>
a>[2] += la href="+code=tkipS" class="sref">tkipS>
a>(la href="+code=ppk" class="sref">ppk>
a>[1] ^ la href="+code=get_unaligned_le16" class="sref">get_unaligned_le16>
a>(la href="+code=tk" class="sref">tk>
a> + 4));ia125>
a>        la href="+code=ppk" class="sref">ppk>
a>[3] += la href="+code=tkipS" class="sref">tkipS>
a>(la href="+code=ppk" class="sref">ppk>
a>[2] ^ la href="+code=get_unaligned_le16" class="sref">get_unaligned_le16>
a>(la href="+code=tk" class="sref">tk>
a> + 6));ia126>
a>        la href="+code=ppk" class="sref">ppk>
a>[4] += la href="+code=tkipS" class="sref">tkipS>
a>(la href="+code=ppk" class="sref">ppk>
a>[3] ^ la href="+code=get_unaligned_le16" class="sref">get_unaligned_le16>
a>(la href="+code=tk" class="sref">tk>
a> + 8));ia127>
a>        la href="+code=ppk" class="sref">ppk>
a>[5] += la href="+code=tkipS" class="sref">tkipS>
a>(la href="+code=ppk" class="sref">ppk>
a>[4] ^ la href="+code=get_unaligned_le16" class="sref">get_unaligned_le16>
a>(la href="+code=tk" class="sref">tk>
a> + 10));ia128>
a>        la href="+code=ppk" class="sref">ppk>
a>[0] += la href="+code=ror16" class="sref">ror16>
a>(la href="+code=ppk" class="sref">ppk>
a>[5] ^ la href="+code=get_unaligned_le16" class="sref">get_unaligned_le16>
a>(la href="+code=tk" class="sref">tk>
a> + 12), 1);ia129>
a>        la href="+code=ppk" class="sref">ppk>
a>[1] += la href="+code=ror16" class="sref">ror16>
a>(la href="+code=ppk" class="sref">ppk>
a>[0] ^ la href="+code=get_unaligned_le16" class="sref">get_unaligned_le16>
a>(la href="+code=tk" class="sref">tk>
a> + 14), 1);ia130>
a>        la href="+code=ppk" class="sref">ppk>
a>[2] += la href="+code=ror16" class="sref">ror16>
a>(la href="+code=ppk" class="sref">ppk>
a>[1], 1);ia131>
a>        la href="+code=ppk" class="sref">ppk>
a>[3] += la href="+code=ror16" class="sref">ror16>
a>(la href="+code=ppk" class="sref">ppk>
a>[2], 1);ia132>
a>        la href="+code=ppk" class="sref">ppk>
a>[4] += la href="+code=ror16" class="sref">ror16>
a>(la href="+code=ppk" class="sref">ppk>
a>[3], 1);ia133>
a>        la href="+code=ppk" class="sref">ppk>
a>[5] += la href="+code=ror16" class="sref">ror16>
a>(la href="+code=ppk" class="sref">ppk>
a>[4], 1);ia134>
a>ia135>
a>        la href="+code=rc4key" class="sref">rc4key>
a> = la href="+code=write_tkip_iv" class="sref">write_tkip_iv>
a>(la href="+code=rc4key" class="sref">rc4key>
a>, la href="+code=tsc_IV16" class="sref">tsc_IV16>
a>);ia136>
a>        *la href="+code=rc4key" class="sref">rc4key>
a>++ = ((la href="+code=ppk" class="sref">ppk>
a>[5] ^ la href="+code=get_unaligned_le16" class="sref">get_unaligned_le16>
a>(la href="+code=tk" class="sref">tk>
a>)) >> 1) & 0xFF;ia137l/a>ia138>
a>        for (la href="+code=i" class="sref">i>
a> = 0; la href="+code=i" class="sref">i>
a> <a6; la href="+code=i" class="sref">i>
a>++)ia139>
a>                la href="+code=put_unaligned_le16" class="sref">put_unaligned_le16>
a>(la href="+code=ppk" class="sref">ppk>
a>[la href="+code=i" class="sref">i>
a>], la href="+code=rc4key" class="sref">rc4key>
a> + 2 * la href="+code=i" class="sref">i>
a>);ia140>
a>}ia141l/a>ia142l/a>lspap class="comment">/* Add TKIP IV and Ext. IV at @pos. @iv0, @iv1, and @iv2 are the first octetsl/spaptia143l/a>lspap class="comment"> * of the IV. Returns pointer to the octet following IVs (i.e., beginning ofl/spaptia144l/a>lspap class="comment"> * the packet payload). */l/spaptia145>
a>la href="+code=u8" class="sref">u8>
a> *la href="+code=ieee80211_tkip_add_iv" class="sref">ieee80211_tkip_add_iv>
a>(la href="+code=u8" class="sref">u8>
a> *la href="+code=pos" class="sref">pos>
a>, struct la href="+code=ieee80211_key" class="sref">ieee80211_key>
a> *la href="+code=key" class="sref">key>
a>)ia146>
a>{ia147>
a>        la href="+code=lockdep_assert_held" class="sref">lockdep_assert_held>
a>(&la href="+code=key" class="sref">key>
a>->la href="+code=u" class="sref">u>
a>.la href="+code=tkip" class="sref">tkip>
a>.la href="+code=txlock" class="sref">txlock>
a>);ia148l/a>ia149>
a>        la href="+code=pos" class="sref">pos>
a> = la href="+code=write_tkip_iv" class="sref">write_tkip_iv>
a>(la href="+code=pos" class="sref">pos>
a>, la href="+code=key" class="sref">key>
a>->la href="+code=u" class="sref">u>
a>.la href="+code=tkip" class="sref">tkip>
a>.la href="+code=tx" class="sref">tx>
a>.la href="+code=iv16" class="sref">iv16>
a>);ia150>
a>        *la href="+code=pos" class="sref">pos>
a>++ = (la href="+code=key" class="sref">key>
a>->la href="+code=conf" class="sref">conf>
a>.la href="+code=keyidx" class="sref">keyidx>
a> <<a6) | (1 <<a5) lspap class="comment">/* Ext IV */l/spapt;ia151>
a>        la href="+code=put_unaligned_le32" class="sref">put_unaligned_le32>
a>(la href="+code=key" class="sref">key>
a>->la href="+code=u" class="sref">u>
a>.la href="+code=tkip" class="sref">tkip>
a>.la href="+code=tx" class="sref">tx>
a>.la href="+code=iv32" class="sref">iv32>
a>, la href="+code=pos" class="sref">pos>
a>);ia152>
a>        return la href="+code=pos" class="sref">pos>
a> + 4;ia153>
a>}ia154>
a>ia155>
a>static void la href="+code=ieee80211_compute_tkip_p1k" class="sref">ieee80211_compute_tkip_p1k>
a>(struct la href="+code=ieee80211_key" class="sref">ieee80211_key>
a> *la href="+code=key" class="sref">key>
a>, la href="+code=u32" class="sref">u32>
a> la href="+code=iv32" class="sref">iv32>
a>)ia156>
a>{ia157>
a>        struct la href="+code=ieee80211_sub_if_data" class="sref">ieee80211_sub_if_data>
a> *la href="+code=sdata" class="sref">sdata>
a> = la href="+code=key" class="sref">key>
a>->la href="+code=sdata" class="sref">sdata>
a>;ia158>
a>        struct la href="+code=tkip_ctx" class="sref">tkip_ctx>
a> *la href="+code=ctx" class="sref">ctx>
a> = &la href="+code=key" class="sref">key>
a>->la href="+code=u" class="sref">u>
a>.la href="+code=tkip" class="sref">tkip>
a>.la href="+code=tx" class="sref">tx>
a>;ia159>
a>        const la href="+code=u8" class="sref">u8>
a> *la href="+code=tk" class="sref">tk>
a> = &la href="+code=key" class="sref">key>
a>->la href="+code=conf" class="sref">conf>
a>.la href="+code=key" class="sref">key>
a>[la href="+code=NL80211_TKIP_DATA_OFFSET_ENCR_KEY" class="sref">NL80211_TKIP_DATA_OFFSET_ENCR_KEY>
a>];ia160>
a>ia161>
a>        la href="+code=lockdep_assert_held" class="sref">lockdep_assert_held>
a>(&la href="+code=key" class="sref">key>
a>->la href="+code=u" class="sref">u>
a>.la href="+code=tkip" class="sref">tkip>
a>.la href="+code=txlock" class="sref">txlock>
a>);ia162>
a>ia163>
a>        lspap class="comment">/*l/spaptia164l/a>lspap class="comment">         * Update the P1K when the IV32 is different from the 14.17 itl/spaptia165l/a>lspap class="comment">         * had when we last computed it (or when not initialised yet).l/spaptia166l/a>lspap class="comment">         * This might flip-flop back and forth if packets are processedl/spaptia167l/a>lspap class="comment">         * out-of-order d17 to the different ACs, but then we hav7 tol/spaptia168l/a>lspap class="comment">         * just compute the P1K more oftep.l/spaptia169l/a>lspap class="comment">         */l/spaptia170>
a>        if (la href="+code=ctx" class="sref">ctx>
a>->la href="+code=p1k_iv32" class="sref">p1k_iv32>
a> != la href="+code=iv32" class="sref">iv32>
a> || la href="+code=ctx" class="sref">ctx>
a>->la href="+code=state" class="sref">state>
a> == la href="+code=TKIP_STATE_NOT_INIT" class="sref">TKIP_STATE_NOT_INIT>
a>)ia171>
a>                la href="+code=tkip_mixing_phase1" class="sref">tkip_mixing_phase1>
a>(la href="+code=tk" class="sref">tk>
a>, la href="+code=ctx" class="sref">ctx>
a>, la href="+code=sdata" class="sref">sdata>
a>->la href="+code=vif" class="sref">vif>
a>.la href="+code=addr" class="sref">addr>
a>, la href="+code=iv32" class="sref">iv32>
a>);ia172>
a>}ia173l/a>ia174>
a>void la href="+code=ieee80211_get_tkip_p1k_iv" class="sref">ieee80211_get_tkip_p1k_iv>
a>(struct la href="+code=ieee80211_key_conf" class="sref">ieee80211_key_conf>
a> *la href="+code=keyconf" class="sref">keyconf>
a>,ia175>
a>                               la href="+code=u32" class="sref">u32>
a> la href="+code=iv32" class="sref">iv32>
a>, la href="+code=u16" class="sref">u16>
a> *la href="+code=p1k" class="sref">p1k>
a>)ia176>
a>{ia177>
a>        struct la href="+code=ieee80211_key" class="sref">ieee80211_key>
a> *la href="+code=key" class="sref">key>
a> = (struct la href="+code=ieee80211_key" class="sref">ieee80211_key>
a> *)ia178>
a>                        la href="+code=container_of" class="sref">container_of>
a>(la href="+code=keyconf" class="sref">keyconf>
a>, struct la href="+code=ieee80211_key" class="sref">ieee80211_key>
a>, la href="+code=conf" class="sref">conf>
a>);ia179>
a>        struct la href="+code=tkip_ctx" class="sref">tkip_ctx>
a> *la href="+code=ctx" class="sref">ctx>
a> = &la href="+code=key" class="sref">key>
a>->la href="+code=u" class="sref">u>
a>.la href="+code=tkip" class="sref">tkip>
a>.la href="+code=tx" class="sref">tx>
a>;ia180>
a>        unsigned long la href="+code=flags" class="sref">flags>
a>;ia181l/a>ia182>
a>        la href="+code=spin_lock_irqsav7" class="sref">spin_lock_irqsav7>
a>(&la href="+code=key" class="sref">key>
a>->la href="+code=u" class="sref">u>
a>.la href="+code=tkip" class="sref">tkip>
a>.la href="+code=txlock" class="sref">txlock>
a>, la href="+code=flags" class="sref">flags>
a>);ia183>
a>        la href="+code=ieee80211_compute_tkip_p1k" class="sref">ieee80211_compute_tkip_p1k>
a>(la href="+code=key" class="sref">key>
a>, la href="+code=iv32" class="sref">iv32>
a>);ia184>
a>        la href="+code=memcpy" class="sref">memcpy>
a>(la href="+code=p1k" class="sref">p1k>
a>, la href="+code=ctx" class="sref">ctx>
a>->la href="+code=p1k" class="sref">p1k>
a>, sizeof(la href="+code=ctx" class="sref">ctx>
a>->la href="+code=p1k" class="sref">p1k>
a>));ia185>
a>        la href="+code=spin_unlock_irqrestore" class="sref">spin_unlock_irqrestore>
a>(&la href="+code=key" class="sref">key>
a>->la href="+code=u" class="sref">u>
a>.la href="+code=tkip" class="sref">tkip>
a>.la href="+code=txlock" class="sref">txlock>
a>, la href="+code=flags" class="sref">flags>
a>);ia186>
a>}ia187>
a>la href="+code=EXPORT_SYMBOL" class="sref">EXPORT_SYMBOL>
a>(la href="+code=ieee80211_get_tkip_p1k_iv" class="sref">ieee80211_get_tkip_p1k_iv>
a>);ia188l/a>ia189l/a>void la href="+code=ieee80211_get_tkip_rx_p1k" class="sref">ieee80211_get_tkip_rx_p1k>
a>(struct la href="+code=ieee80211_key_conf" class="sref">ieee80211_key_conf>
a> *la href="+code=keyconf" class="sref">keyconf>
a>,ia190>
a>                               const la href="+code=u8" class="sref">u8>
a> *la href="+code=ta" class="sref">ta>
a>, la href="+code=u32" class="sref">u32>
a> la href="+code=iv32" class="sref">iv32>
a>, la href="+code=u16" class="sref">u16>
a> *la href="+code=p1k" class="sref">p1k>
a>)ia191>
a>{ia192>
a>        const la href="+code=u8" class="sref">u8>
a> *la href="+code=tk" class="sref">tk>
a> = &la href="+code=keyconf" class="sref">keyconf>
a>->la href="+code=key" class="sref">key>
a>[la href="+code=NL80211_TKIP_DATA_OFFSET_ENCR_KEY" class="sref">NL80211_TKIP_DATA_OFFSET_ENCR_KEY>
a>];ia193>
a>        struct la href="+code=tkip_ctx" class="sref">tkip_ctx>
a> la href="+code=ctx" class="sref">ctx>
a>;ia194>
a>ia195>
a>        la href="+code=tkip_mixing_phase1" class="sref">tkip_mixing_phase1>
a>(la href="+code=tk" class="sref">tk>
a>, &la href="+code=ctx" class="sref">ctx>
a>, la href="+code=ta" class="sref">ta>
a>, la href="+code=iv32" class="sref">iv32>
a>);ia196>
a>        la href="+code=memcpy" class="sref">memcpy>
a>(la href="+code=p1k" class="sref">p1k>
a>, la href="+code=ctx" class="sref">ctx>
a>.la href="+code=p1k" class="sref">p1k>
a>, sizeof(la href="+code=ctx" class="sref">ctx>
a>.la href="+code=p1k" class="sref">p1k>
a>));ia197>
a>}ia198>
a>la href="+code=EXPORT_SYMBOL" class="sref">EXPORT_SYMBOL>
a>(la href="+code=ieee80211_get_tkip_rx_p1k" class="sref">ieee80211_get_tkip_rx_p1k>
a>);ia199l/a>ia200>
a>void la href="+code=ieee80211_get_tkip_p2k" class="sref">ieee80211_get_tkip_p2k>
a>(struct la href="+code=ieee80211_key_conf" class="sref">ieee80211_key_conf>
a> *la href="+code=keyconf" class="sref">keyconf>
a>,ia201>
a>                            struct la href="+code=sk_buff" class="sref">sk_buff>
a> *la href="+code=skb" class="sref">skb>
a>, la href="+code=u8" class="sref">u8>
a> *la href="+code=p2k" class="sref">p2k>
a>)ia202>
a>{ia203>
a>        struct la href="+code=ieee80211_key" class="sref">ieee80211_key>
a> *la href="+code=key" class="sref">key>
a> = (struct la href="+code=ieee80211_key" class="sref">ieee80211_key>
a> *)ia204>
a>                        la href="+code=container_of" class="sref">container_of>
a>(la href="+code=keyconf" class="sref">keyconf>
a>, struct la href="+code=ieee80211_key" class="sref">ieee80211_key>
a>, la href="+code=conf" class="sref">conf>
a>);ia205>
a>        const la href="+code=u8" class="sref">u8>
a> *la href="+code=tk" class="sref">tk>
a> = &la href="+code=key" class="sref">key>
a>->la href="+code=conf" class="sref">conf>
a>.la href="+code=key" class="sref">key>
a>[la href="+code=NL80211_TKIP_DATA_OFFSET_ENCR_KEY" class="sref">NL80211_TKIP_DATA_OFFSET_ENCR_KEY>
a>];ia206>
a>        struct la href="+code=tkip_ctx" class="sref">tkip_ctx>
a> *la href="+code=ctx" class="sref">ctx>
a> = &la href="+code=key" class="sref">key>
a>->la href="+code=u" class="sref">u>
a>.la href="+code=tkip" class="sref">tkip>
a>.la href="+code=tx" class="sref">tx>
a>;ia207>
a>        struct la href="+code=ieee80211_hdr" class="sref">ieee80211_hdr>
a> *la href="+code=hdr" class="sref">hdr>
a> = (struct la href="+code=ieee80211_hdr" class="sref">ieee80211_hdr>
a> *)la href="+code=skb" class="sref">skb>
a>->la href="+code=data" class="sref">data>
a>;ia208>
a>        const la href="+code=u8" class="sref">u8>
a> *la href="+code=data" class="sref">data>
a> = (la href="+code=u8" class="sref">u8>
a> *)la href="+code=hdr" class="sref">hdr>
a> + la href="+code=ieee80211_hdrlen" class="sref">ieee80211_hdrlen>
a>(la href="+code=hdr" class="sref">hdr>
a>->la href="+code=fram7_control" class="sref">fram7_control>
a>);ia209>
a>        la href="+code=u32" class="sref">u32>
a> la href="+code=iv32" class="sref">iv32>
a> = la href="+code=get_unaligned_le32" class="sref">get_unaligned_le32>
a>(&la href="+code=data" class="sref">data>
a>[4]);ia210>
a>        la href="+code=u16" class="sref">u16>
a> la href="+code=iv16" class="sref">iv16>
a> = la href="+code=data" class="sref">data>
a>[2] | (la href="+code=data" class="sref">data>
a>[0] <<a8);ia211>
a>        unsigned long la href="+code=flags" class="sref">flags>
a>;ia212>
a>ia213>
a>        la href="+code=spin_lock_irqsav7" class="sref">spin_lock_irqsav7>
a>(&la href="+code=key" class="sref">key>
a>->la href="+code=u" class="sref">u>
a>.la href="+code=tkip" class="sref">tkip>
a>.la href="+code=txlock" class="sref">txlock>
a>, la href="+code=flags" class="sref">flags>
a>);ia214>
a>        la href="+code=ieee80211_compute_tkip_p1k" class="sref">ieee80211_compute_tkip_p1k>
a>(la href="+code=key" class="sref">key>
a>, la href="+code=iv32" class="sref">iv32>
a>);ia215>
a>        la href="+code=tkip_mixing_phase2" class="sref">tkip_mixing_phase2>
a>(la href="+code=tk" class="sref">tk>
a>, la href="+code=ctx" class="sref">ctx>
a>, la href="+code=iv16" class="sref">iv16>
a>, la href="+code=p2k" class="sref">p2k>
a>);ia216>
a>        la href="+code=spin_unlock_irqrestore" class="sref">spin_unlock_irqrestore>
a>(&la href="+code=key" class="sref">key>
a>->la href="+code=u" class="sref">u>
a>.la href="+code=tkip" class="sref">tkip>
a>.la href="+code=txlock" class="sref">txlock>
a>, la href="+code=flags" class="sref">flags>
a>);ia217>
a>}ia218>
a>la href="+code=EXPORT_SYMBOL" class="sref">EXPORT_SYMBOL>
a>(la href="+code=ieee80211_get_tkip_p2k" class="sref">ieee80211_get_tkip_p2k>
a>);ia219l/a>ia220l/a>lspap class="comment">/*l/spaptia221l/a>lspap class="comment"> * Encrypt packet payload with TKIP using @key. @pos is a pointer to thel/spaptia222l/a>lspap class="comment"> * beginning of the buffer containing payload. This payload must includel/spaptia223l/a>lspap class="comment"> * the IV/Ext.IV and space for (taildroom) four octets for ICV.l/spaptia224l/a>lspap class="comment"> * @payload_len is the length of payload (_not_ including IV/ICV length).l/spaptia225l/a>lspap class="comment"> * @ta is the transmitter addresses.l/spaptia226l/a>lspap class="comment"> */l/spaptia227>
a>int la href="+code=ieee80211_tkip_encrypt_data" class="sref">ieee80211_tkip_encrypt_data>
a>(struct la href="+code=crypto_cipher" class="sref">crypto_cipher>
a> *la href="+code=tfm" class="sref">tfm>
a>,ia228>
a>                                struct la href="+code=ieee80211_key" class="sref">ieee80211_key>
a> *la href="+code=key" class="sref">key>
a>,ia229>
a>                                struct la href="+code=sk_buff" class="sref">sk_buff>
a> *la href="+code=skb" class="sref">skb>
a>,ia230>
a>                                la href="+code=u8" class="sref">u8>
a> *la href="+code=payload" class="sref">payload>
a>, la href="+code=size_t" class="sref">size_t>
a> la href="+code=payload_len" class="sref">payload_len>
a>)ia231>
a>{ia232>
a>        la href="+code=u8" class="sref">u8>
a> la href="+code=rc4key" class="sref">rc4key>
a>[16];ia233l/a>ia234>
a>        la href="+code=ieee80211_get_tkip_p2k" class="sref">ieee80211_get_tkip_p2k>
a>(&la href="+code=key" class="sref">key>
a>->la href="+code=conf" class="sref">conf>
a>, la href="+code=skb" class="sref">skb>
a>, la href="+code=rc4key" class="sref">rc4key>
a>);ia235l/a>ia236>
a>        return la href="+code=ieee80211_wep_encrypt_data" class="sref">ieee80211_wep_encrypt_data>
a>(la href="+code=tfm" class="sref">tfm>
a>, la href="+code=rc4key" class="sref">rc4key>
a>, 16,ia237>
a>                                          la href="+code=payload" class="sref">payload>
a>, la href="+code=payload_len" class="sref">payload_len>
a>);ia238>
a>}ia239l/a>ia240l/a>lspap class="comment">/* Decrypt packet payload with TKIP using @key. @pos is a pointer to thel/spaptia241l/a>lspap class="comment"> * beginning of the buffer containing IEEE 802.11 header payload, i.e.,l/spaptia242l/a>lspap class="comment"> * including IV, Ext. IV, real data, Michael MIC, ICV. @payload_len is thel/spaptia243l/a>lspap class="comment"> * length of payload, including IV, Ext. IV, MIC, ICV.  */l/spaptia244l/a>int la href="+code=ieee80211_tkip_decrypt_data" class="sref">ieee80211_tkip_decrypt_data>
a>(struct la href="+code=crypto_cipher" class="sref">crypto_cipher>
a> *la href="+code=tfm" class="sref">tfm>
a>,ia245>
a>                                struct la href="+code=ieee80211_key" class="sref">ieee80211_key>
a> *la href="+code=key" class="sref">key>
a>,ia246>
a>                                la href="+code=u8" class="sref">u8>
a> *la href="+code=payload" class="sref">payload>
a>, la href="+code=size_t" class="sref">size_t>
a> la href="+code=payload_len" class="sref">payload_len>
a>, la href="+code=u8" class="sref">u8>
a> *la href="+code=ta" class="sref">ta>
a>,ia247>
a>                                la href="+code=u8" class="sref">u8>
a> *la href="+code=ra" class="sref">ra>
a>, int la href="+code=only_iv" class="sref">only_iv>
a>, int la href="+code=queue" class="sref">queue>
a>,ia248>
a>                                la href="+code=u32" class="sref">u32>
a> *la href="+code=out_iv32" class="sref">out_iv32>
a>, la href="+code=u16" class="sref">u16>
a> *la href="+code=out_iv16" class="sref">out_iv16>
a>)ia249>
a>{ia250>
a>        la href="+code=u32" class="sref">u32>
a> la href="+code=iv32" class="sref">iv32>
a>;ia251>
a>        la href="+code=u32" class="sref">u32>
a> la href="+code=iv16" class="sref">iv16>
a>;ia252>
a>        la href="+code=u8" class="sref">u8>
a> la href="+code=rc4key" class="sref">rc4key>
a>[16], la href="+code=keyid" class="sref">keyid>
a>, *la href="+code=pos" class="sref">pos>
a> = la href="+code=payload" class="sref">payload>
a>;ia253>
a>        int la href="+code=res" class="sref">res>
a>;ia254>
a>        const la href="+code=u8" class="sref">u8>
a> *la href="+code=tk" class="sref">tk>
a> = &la href="+code=key" class="sref">key>
a>->la href="+code=conf" class="sref">conf>
a>.la href="+code=key" class="sref">key>
a>[la href="+code=NL80211_TKIP_DATA_OFFSET_ENCR_KEY" class="sref">NL80211_TKIP_DATA_OFFSET_ENCR_KEY>
a>];ia255l/a>ia256>
a>        if (la href="+code=payload_len" class="sref">payload_len>
a> <a12)ia257>
a>                return -1;ia258l/a>ia259>
a>        la href="+code=iv16" class="sref">iv16>
a> = (la href="+code=pos" class="sref">pos>
a>[0] <<a8) | la href="+code=pos" class="sref">pos>
a>[2];ia260>
a>        la href="+code=keyid" class="sref">keyid>
a> = la href="+code=pos" class="sref">pos>
a>[3];ia261>
a>        la href="+code=iv32" class="sref">iv32>
a> = la href="+code=get_unaligned_le32" class="sref">get_unaligned_le32>
a>(la href="+code=pos" class="sref">pos>
a> + 4);ia262>
a>        la href="+code=pos" class="sref">pos>
a> += 8;ia263l/a>ia264>
a>        if (!(la href="+code=keyid" class="sref">keyid>
a> & (1 <<a5)))ia265>
a>                return la href="+code=TKIP_DECRYPT_NO_EXT_IV" class="sref">TKIP_DECRYPT_NO_EXT_IV>
a>;ia266l/a>ia267>
a>        if ((la href="+code=keyid" class="sref">keyid>
a> >> 6) != la href="+code=key" class="sref">key>
a>->la href="+code=conf" class="sref">conf>
a>.la href="+code=keyidx" class="sref">keyidx>
a>)ia268>
a>                return la href="+code=TKIP_DECRYPT_INVALID_KEYIDX" class="sref">TKIP_DECRYPT_INVALID_KEYIDX>
a>;ia269l/a>ia270>
a>        if (la href="+code=key" class="sref">key>
a>->la href="+code=u" class="sref">u>
a>.la href="+code=tkip" class="sref">tkip>
a>.la href="+code=rx" class="sref">rx>
a>[la href="+code=queue" class="sref">queue>
a>].la href="+code=state" class="sref">state>
a> != la href="+code=TKIP_STATE_NOT_INIT" class="sref">TKIP_STATE_NOT_INIT>
a> &&ia271>
a>            (la href="+code=iv32" class="sref">iv32>
a> <ala href="+code=key" class="sref">key>
a>->la href="+code=u" class="sref">u>
a>.la href="+code=tkip" class="sref">tkip>
a>.la href="+code=rx" class="sref">rx>
a>[la href="+code=queue" class="sref">queue>
a>].la href="+code=iv32" class="sref">iv32>
a> ||ia272>
a>             (la href="+code=iv32" class="sref">iv32>
a> == la href="+code=key" class="sref">key>
a>->la href="+code=u" class="sref">u>
a>.la href="+code=tkip" class="sref">tkip>
a>.la href="+code=rx" class="sref">rx>
a>[la href="+code=queue" class="sref">queue>
a>].la href="+code=iv32" class="sref">iv32>
a> &&ia273>
a>              la href="+code=iv16" class="sref">iv16>
a> <= la href="+code=key" class="sref">key>
a>->la href="+code=u" class="sref">u>
a>.la href="+code=tkip" class="sref">tkip>
a>.la href="+code=rx" class="sref">rx>
a>[la href="+code=queue" class="sref">queue>
a>].la href="+code=iv16" class="sref">iv16>
a>)))ia274>
a>                return la href="+code=TKIP_DECRYPT_REPLAY" class="sref">TKIP_DECRYPT_REPLAY>
a>;ia275l/a>ia276>
a>        if (la href="+code=only_iv" class="sref">only_iv>
a>) {ia277>
a>                la href="+code=res" class="sref">res>
a> = la href="+code=TKIP_DECRYPT_OK" class="sref">TKIP_DECRYPT_OK>
a>;ia278>
a>                la href="+code=key" class="sref">key>
a>->la href="+code=u" class="sref">u>
a>.la href="+code=tkip" class="sref">tkip>
a>.la href="+code=rx" class="sref">rx>
a>[la href="+code=queue" class="sref">queue>
a>].la href="+code=state" class="sref">state>
a> = la href="+code=TKIP_STATE_PHASE1_HW_UPLOADED" class="sref">TKIP_STATE_PHASE1_HW_UPLOADED>
a>;ia279>
a>                goto la href="+code=done" class="sref">done>
a>;ia280>
a>        }ia281l/a>ia282>
a>        if (la href="+code=key" class="sref">key>
a>->la href="+code=u" class="sref">u>
a>.la href="+code=tkip" class="sref">tkip>
a>.la href="+code=rx" class="sref">rx>
a>[la href="+code=queue" class="sref">queue>
a>].la href="+code=state" class="sref">state>
a> == la href="+code=TKIP_STATE_NOT_INIT" class="sref">TKIP_STATE_NOT_INIT>
a> ||ia283>
a>            la href="+code=key" class="sref">key>
a>->la href="+code=u" class="sref">u>
a>.la href="+code=tkip" class="sref">tkip>
a>.la href="+code=rx" class="sref">rx>
a>[la href="+code=queue" class="sref">queue>
a>].la href="+code=iv32" class="sref">iv32>
a> != la href="+code=iv32" class="sref">iv32>
a>) {ia284>
a>                lspap class="comment">/* IV16 wrapped around - perform TKIP phase 1 */l/spaptia285>
a>                la href="+code=tkip_mixing_phase1" class="sref">tkip_mixing_phase1>
a>(la href="+code=tk" class="sref">tk>
a>, &la href="+code=key" class="sref">key>
a>->la href="+code=u" class="sref">u>
a>.la href="+code=tkip" class="sref">tkip>
a>.la href="+code=rx" class="sref">rx>
a>[la href="+code=queue" class="sref">queue>
a>], la href="+code=ta" class="sref">ta>
a>, la href="+code=iv32" class="sref">iv32>
a>);ia286>
a>        }ia287>
a>        if (la href="+code=key" class="sref">key>
a>->la href="+code=local" class="sref">local>
a>->la href="+code=ops" class="sref">ops>
a>->la href="+code=update_tkip_key" class="sref">update_tkip_key>
a> &&ia288>
a>            la href="+code=key" class="sref">key>
a>->la href="+code=flags" class="sref">flags>
a> & la href="+code=KEY_FLAG_UPLOADED_TO_HARDWARE" class="sref">KEY_FLAG_UPLOADED_TO_HARDWARE>
a> &&ia289>
a>            la href="+code=key" class="sref">key>
a>->la href="+code=u" class="sref">u>
a>.la href="+code=tkip" class="sref">tkip>
a>.la href="+code=rx" class="sref">rx>
a>[la href="+code=queue" class="sref">queue>
a>].la href="+code=state" class="sref">state>
a> != la href="+code=TKIP_STATE_PHASE1_HW_UPLOADED" class="sref">TKIP_STATE_PHASE1_HW_UPLOADED>
a>) {ia290>
a>                struct la href="+code=ieee80211_sub_if_data" class="sref">ieee80211_sub_if_data>
a> *la href="+code=sdata" class="sref">sdata>
a> = la href="+code=key" class="sref">key>
a>->la href="+code=sdata" class="sref">sdata>
a>;ia291l/a>ia292>
a>                if (la href="+code=sdata" class="sref">sdata>
a>->la href="+code=vif" class="sref">vif>
a>.la href="+code=type" class="sref">type>
a> == la href="+code=NL80211_IFTYPE_AP_VLAN" class="sref">NL80211_IFTYPE_AP_VLAN>
a>)ia293>
a>                        la href="+code=sdata" class="sref">sdata>
a> = la href="+code=container_of" class="sref">container_of>
a>(la href="+code=key" class="sref">key>
a>->la href="+code=sdata" class="sref">sdata>
a>->la href="+code=bss" class="sref">bss>
a>,ia294>
a>                                        struct la href="+code=ieee80211_sub_if_data" class="sref">ieee80211_sub_if_data>
a>, la href="+code=u" class="sref">u>
a>.la href="+code=ap" class="sref">ap>
a>);ia295>
a>                la href="+code=drv_update_tkip_key" class="sref">drv_update_tkip_key>
a>(la href="+code=key" class="sref">key>
a>->la href="+code=local" class="sref">local>
a>, la href="+code=sdata" class="sref">sdata>
a>, &la href="+code=key" class="sref">key>
a>->la href="+code=conf" class="sref">conf>
a>, la href="+code=key" class="sref">key>
a>->la href="+code=sta" class="sref">sta>
a>,ia296>
a>                                la href="+code=iv32" class="sref">iv32>
a>, la href="+code=key" class="sref">key>
a>->la href="+code=u" class="sref">u>
a>.la href="+code=tkip" class="sref">tkip>
a>.la href="+code=rx" class="sref">rx>
a>[la href="+code=queue" class="sref">queue>
a>].la href="+code=p1k" class="sref">p1k>
a>);ia297>
a>                la href="+code=key" class="sref">key>
a>->la href="+code=u" class="sref">u>
a>.la href="+code=tkip" class="sref">tkip>
a>.la href="+code=rx" class="sref">rx>
a>[la href="+code=queue" class="sref">queue>
a>].la href="+code=state" class="sref">state>
a> = la href="+code=TKIP_STATE_PHASE1_HW_UPLOADED" class="sref">TKIP_STATE_PHASE1_HW_UPLOADED>
a>;ia298>
a>        }ia299l/a>ia300>
a>        la href="+code=tkip_mixing_phase2" class="sref">tkip_mixing_phase2>
a>(la href="+code=tk" class="sref">tk>
a>, &la href="+code=key" class="sref">key>
a>->la href="+code=u" class="sref">u>
a>.la href="+code=tkip" class="sref">tkip>
a>.la href="+code=rx" class="sref">rx>
a>[la href="+code=queue" class="sref">queue>
a>], la href="+code=iv16" class="sref">iv16>
a>, la href="+code=rc4key" class="sref">rc4key>
a>);ia301l/a>ia302>
a>        la href="+code=res" class="sref">res>
a> = la href="+code=ieee80211_wep_decrypt_data" class="sref">ieee80211_wep_decrypt_data>
a>(la href="+code=tfm" class="sref">tfm>
a>, la href="+code=rc4key" class="sref">rc4key>
a>, 16, la href="+code=pos" class="sref">pos>
a>, la href="+code=payload_len" class="sref">payload_len>
a> -a12);ia303>
a> la href="+code=done" class="sref">done>
a>:ia304>
a>        if (la href="+code=res" class="sref">res>
a> == la href="+code=TKIP_DECRYPT_OK" class="sref">TKIP_DECRYPT_OK>
a>) {ia305>
a>                lspap class="comment">/*l/spaptia306l/a>lspap class="comment">                 * Record previously received IV, will be copied into thel/spaptia307l/a>lspap class="comment">                 * key information after MIC verification. It is possiblel/spaptia308l/a>lspap class="comment">                 * that we don't catch replays of fragments but that's okl/spaptia309l/a>lspap class="comment">                 * because the Michael MIC verication will then fail.l/spaptia310l/a>lspap class="comment">                 */l/spaptia311>
a>                *la href="+code=out_iv32" class="sref">out_iv32>
a> = la href="+code=iv32" class="sref">iv32>
a>;ia312>
a>                *la href="+code=out_iv16" class="sref">out_iv16>
a> = la href="+code=iv16" class="sref">iv16>
a>;ia313>
a>        }ia314>
a>ia315>
a>        return la href="+code=res" class="sref">res>
a>;ia316>
a>}ia317>
a>
lxr.linux.no kindly hosted by Redpill Linpro AS> a>, provider of Linux consulting and operations services sincea1995.