.. | .. |
---|
13 | 13 | #include "wlancrypto_wrap.h" |
---|
14 | 14 | |
---|
15 | 15 | |
---|
16 | | -static void gcmp_aad_nonce(_adapter * padapter, const struct ieee80211_hdr *hdr, const u8 *data, |
---|
17 | | - u8 *aad, size_t *aad_len, u8 *nonce) |
---|
18 | | - |
---|
| 16 | +static void gcmp_aad_nonce(const struct ieee80211_hdr *hdr, const u8 *data, |
---|
| 17 | + u8 *aad, size_t *aad_len, u8 *nonce) |
---|
19 | 18 | { |
---|
20 | 19 | u16 fc, stype, seq; |
---|
21 | 20 | int qos = 0, addr4 = 0; |
---|
.. | .. |
---|
55 | 54 | pos += addr4 * ETH_ALEN; |
---|
56 | 55 | if (qos) { |
---|
57 | 56 | pos[0] &= ~0x70; |
---|
58 | | - /* only spp mode need to refer QoS bit7 */ |
---|
59 | | - if (padapter->registrypriv.amsdu_mode != RTW_AMSDU_MODE_SPP) |
---|
| 57 | + if (1 /* FIX: either device has SPP A-MSDU Capab = 0 */) |
---|
60 | 58 | pos[0] &= ~0x80; |
---|
61 | 59 | pos++; |
---|
62 | 60 | *pos++ = 0x00; |
---|
.. | .. |
---|
83 | 81 | * @data_len: length of @data (PN + enc_data + MIC) |
---|
84 | 82 | * @decrypted_len: length of the data decrypted |
---|
85 | 83 | */ |
---|
86 | | -u8 * gcmp_decrypt(_adapter *padapter, const u8 *tk, size_t tk_len, const struct ieee80211_hdr *hdr, |
---|
87 | | - const u8 *data, size_t data_len, size_t *decrypted_len) |
---|
| 84 | +u8 * gcmp_decrypt(const u8 *tk, size_t tk_len, const struct ieee80211_hdr *hdr, |
---|
| 85 | + const u8 *data, size_t data_len, size_t *decrypted_len) |
---|
88 | 86 | { |
---|
89 | 87 | u8 aad[30], nonce[12], *plain; |
---|
90 | 88 | size_t aad_len, mlen; |
---|
.. | .. |
---|
101 | 99 | mlen = data_len - 8 - 16; |
---|
102 | 100 | |
---|
103 | 101 | os_memset(aad, 0, sizeof(aad)); |
---|
104 | | - gcmp_aad_nonce(padapter, hdr, data, aad, &aad_len, nonce); |
---|
| 102 | + gcmp_aad_nonce(hdr, data, aad, &aad_len, nonce); |
---|
105 | 103 | wpa_hexdump(_MSG_EXCESSIVE_, "GCMP AAD", aad, aad_len); |
---|
106 | 104 | wpa_hexdump(_MSG_EXCESSIVE_, "GCMP nonce", nonce, sizeof(nonce)); |
---|
107 | 105 | |
---|
.. | .. |
---|
137 | 135 | * @encrypted_len: length of the encrypted frame |
---|
138 | 136 | * including mac header, pn, payload and MIC |
---|
139 | 137 | */ |
---|
140 | | -u8 * gcmp_encrypt(_adapter *padapter, const u8 *tk, size_t tk_len, const u8 *frame, size_t len, |
---|
141 | | - size_t hdrlen, const u8 *qos, |
---|
142 | | - const u8 *pn, int keyid, size_t *encrypted_len) |
---|
| 138 | +u8 * gcmp_encrypt(const u8 *tk, size_t tk_len, const u8 *frame, size_t len, |
---|
| 139 | + size_t hdrlen, const u8 *qos, |
---|
| 140 | + const u8 *pn, int keyid, size_t *encrypted_len) |
---|
143 | 141 | { |
---|
144 | 142 | u8 aad[30], nonce[12], *crypt, *pos; |
---|
145 | 143 | const u8 *pdata; |
---|
.. | .. |
---|
176 | 174 | } |
---|
177 | 175 | |
---|
178 | 176 | os_memset(aad, 0, sizeof(aad)); |
---|
179 | | - gcmp_aad_nonce(padapter, hdr, crypt + hdrlen, aad, &aad_len, nonce); |
---|
| 177 | + gcmp_aad_nonce(hdr, crypt + hdrlen, aad, &aad_len, nonce); |
---|
180 | 178 | wpa_hexdump(_MSG_EXCESSIVE_, "GCMP AAD", aad, aad_len); |
---|
181 | 179 | wpa_hexdump(_MSG_EXCESSIVE_, "GCMP nonce", nonce, sizeof(nonce)); |
---|
182 | 180 | |
---|