Deleted Added
full compact
ieee80211_crypto_wep.c (302408) ieee80211_crypto_wep.c (305614)
1/*-
2 * Copyright (c) 2002-2008 Sam Leffler, Errno Consulting
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 10 unchanged lines hidden (view full) ---

19 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
20 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
21 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
23 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24 */
25
26#include <sys/cdefs.h>
1/*-
2 * Copyright (c) 2002-2008 Sam Leffler, Errno Consulting
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 10 unchanged lines hidden (view full) ---

19 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
20 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
21 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
23 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24 */
25
26#include <sys/cdefs.h>
27__FBSDID("$FreeBSD: stable/11/sys/net80211/ieee80211_crypto_wep.c 288526 2015-10-03 00:50:13Z adrian $");
27__FBSDID("$FreeBSD: stable/11/sys/net80211/ieee80211_crypto_wep.c 305614 2016-09-08 15:05:25Z pfg $");
28
29/*
30 * IEEE 802.11 WEP crypto support.
31 */
32#include "opt_wlan.h"
33
34#include <sys/param.h>
35#include <sys/systm.h>

--- 392 unchanged lines hidden (view full) ---

428 j = 0;
429 keylen = key->wk_keylen + IEEE80211_WEP_IVLEN;
430 for (i = 0; i < 256; i++) {
431 j = (j + S[i] + rc4key[i % keylen]) & 0xff;
432 S_SWAP(i, j);
433 }
434
435 off = hdrlen + wep.ic_header;
28
29/*
30 * IEEE 802.11 WEP crypto support.
31 */
32#include "opt_wlan.h"
33
34#include <sys/param.h>
35#include <sys/systm.h>

--- 392 unchanged lines hidden (view full) ---

428 j = 0;
429 keylen = key->wk_keylen + IEEE80211_WEP_IVLEN;
430 for (i = 0; i < 256; i++) {
431 j = (j + S[i] + rc4key[i % keylen]) & 0xff;
432 S_SWAP(i, j);
433 }
434
435 off = hdrlen + wep.ic_header;
436 data_len = m->m_pkthdr.len - (off + wep.ic_trailer),
436 data_len = m->m_pkthdr.len - (off + wep.ic_trailer);
437
438 /* Compute CRC32 over unencrypted data and apply RC4 to data */
439 crc = ~0;
440 i = j = 0;
441 pos = mtod(m, uint8_t *) + off;
442 buflen = m->m_len - off;
443 for (;;) {
444 if (buflen > data_len)

--- 50 unchanged lines hidden ---
437
438 /* Compute CRC32 over unencrypted data and apply RC4 to data */
439 crc = ~0;
440 i = j = 0;
441 pos = mtod(m, uint8_t *) + off;
442 buflen = m->m_len - off;
443 for (;;) {
444 if (buflen > data_len)

--- 50 unchanged lines hidden ---