亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? ieee80211_crypto_wep.c

?? Linux下wifi實(shí)現(xiàn)
?? C
?? 第 1 頁 / 共 2 頁
字號(hào):
/*- * Copyright (c) 2002-2005 Sam Leffler, Errno Consulting * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright *    notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright *    notice, this list of conditions and the following disclaimer in the *    documentation and/or other materials provided with the distribution. * 3. The name of the author may not be used to endorse or promote products *    derived from this software without specific prior written permission. * * Alternatively, this software may be distributed under the terms of the * GNU General Public License ("GPL") version 2 as published by the Free * Software Foundation. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * $Id: ieee80211_crypto_wep.c 1443 2006-02-06 20:20:57Z mrenzmann $ *//* * IEEE 802.11 WEP crypto support. */#include <linux/config.h>#include <linux/version.h>#include <linux/module.h>#include <linux/skbuff.h>#include <linux/netdevice.h>#include <linux/random.h>#include <linux/init.h>#include "if_media.h"#include <net80211/ieee80211_var.h>static void *wep_attach(struct ieee80211vap *, struct ieee80211_key *);static void wep_detach(struct ieee80211_key *);static int wep_setkey(struct ieee80211_key *);static int wep_encap(struct ieee80211_key *, struct sk_buff *, u_int8_t);static int wep_decap(struct ieee80211_key *, struct sk_buff *, int);static int wep_enmic(struct ieee80211_key *, struct sk_buff *, int);static int wep_demic(struct ieee80211_key *, struct sk_buff *, int);static const struct ieee80211_cipher wep = {	.ic_name	= "WEP",	.ic_cipher	= IEEE80211_CIPHER_WEP,	.ic_header	= IEEE80211_WEP_IVLEN + IEEE80211_WEP_KIDLEN,	.ic_trailer	= IEEE80211_WEP_CRCLEN,	.ic_miclen	= 0,	.ic_attach	= wep_attach,	.ic_detach	= wep_detach,	.ic_setkey	= wep_setkey,	.ic_encap	= wep_encap,	.ic_decap	= wep_decap,	.ic_enmic	= wep_enmic,	.ic_demic	= wep_demic,};static int wep_encrypt(struct ieee80211_key *, struct sk_buff *, int);static int wep_decrypt(struct ieee80211_key *, struct sk_buff *, int);struct wep_ctx {	struct ieee80211vap *wc_vap;	/* for diagnostics + statistics */	struct ieee80211com *wc_ic;	/* for diagnostics */	u_int32_t wc_iv;			/* initial vector for crypto */};static void *wep_attach(struct ieee80211vap *vap, struct ieee80211_key *k){	struct wep_ctx *ctx;	_MOD_INC_USE(THIS_MODULE, return NULL);	MALLOC(ctx, struct wep_ctx *, sizeof(struct wep_ctx),		M_DEVBUF, M_NOWAIT | M_ZERO);	if (ctx == NULL) {		vap->iv_stats.is_crypto_nomem++;		_MOD_DEC_USE(THIS_MODULE);		return NULL;	}	ctx->wc_vap = vap;	ctx->wc_ic = vap->iv_ic;	get_random_bytes(&ctx->wc_iv, sizeof(ctx->wc_iv));	return ctx;}static voidwep_detach(struct ieee80211_key *k){	struct wep_ctx *ctx = k->wk_private;	FREE(ctx, M_DEVBUF);	_MOD_DEC_USE(THIS_MODULE);}static intwep_setkey(struct ieee80211_key *k){	return k->wk_keylen >= 40 / NBBY;}#ifndef _BYTE_ORDER#error "Don't know native byte order"#endif/* * Add privacy headers appropriate for the specified key. */static intwep_encap(struct ieee80211_key *k, struct sk_buff *skb, u_int8_t keyid){	struct wep_ctx *ctx = k->wk_private;	struct ieee80211com *ic = ctx->wc_ic;	u_int32_t iv;	u_int8_t *ivp;	int hdrlen;	hdrlen = ieee80211_hdrspace(ic, skb->data);	/*	 * Copy down 802.11 header and add the IV + KeyID.	 */	ivp = skb_push(skb, wep.ic_header);	memmove(ivp, ivp + wep.ic_header, hdrlen);	ivp += hdrlen;	/*	 * XXX	 * IV must not duplicate during the lifetime of the key.	 * But no mechanism to renew keys is defined in IEEE 802.11	 * for WEP.  And the IV may be duplicated at other stations	 * because the session key itself is shared.  So we use a	 * pseudo random IV for now, though it is not the right way.	 *	 * NB: Rather than use a strictly random IV we select a	 * random one to start and then increment the value for	 * each frame.  This is an explicit tradeoff between	 * overhead and security.  Given the basic insecurity of	 * WEP this seems worthwhile.	 */	/*	 * Skip 'bad' IVs from Fluhrer/Mantin/Shamir:	 * (B, 255, N) with 3 <= B < 16 and 0 <= N <= 255	 */	iv = ctx->wc_iv;	if ((iv & 0xff00) == 0xff00) {		int B = (iv & 0xff0000) >> 16;		if (3 <= B && B < 16)			iv += 0x0100;	}	ctx->wc_iv = iv + 1;	/*	 * NB: Preserve byte order of IV for packet	 *     sniffers; it doesn't matter otherwise.	 */#if _BYTE_ORDER == _BIG_ENDIAN	ivp[0] = iv >> 0;	ivp[1] = iv >> 8;	ivp[2] = iv >> 16;#else	ivp[2] = iv >> 0;	ivp[1] = iv >> 8;	ivp[0] = iv >> 16;#endif	ivp[3] = keyid;	/*	 * Finally, do software encrypt if neeed.	 */	if ((k->wk_flags & IEEE80211_KEY_SWCRYPT) &&	    !wep_encrypt(k, skb, hdrlen))		return 0;	return 1;}/* * Add MIC to the frame as needed. */static intwep_enmic(struct ieee80211_key *k, struct sk_buff *skb, int force){	return 1;}/* * Validate and strip privacy headers (and trailer) for a * received frame.  If necessary, decrypt the frame using * the specified key. */static intwep_decap(struct ieee80211_key *k, struct sk_buff *skb, int hdrlen){	struct wep_ctx *ctx = k->wk_private;	struct ieee80211vap *vap = ctx->wc_vap;	struct ieee80211_frame *wh;	wh = (struct ieee80211_frame *)skb->data;	/*	 * Check if the device handled the decrypt in hardware.	 * If so we just strip the header; otherwise we need to	 * handle the decrypt in software.	 */	if ((k->wk_flags & IEEE80211_KEY_SWCRYPT) &&	    !wep_decrypt(k, skb, hdrlen)) {		IEEE80211_NOTE_MAC(vap, IEEE80211_MSG_CRYPTO, wh->i_addr2,			"%s", "WEP ICV mismatch on decrypt");		vap->iv_stats.is_rx_wepfail++;		return 0;	}	/*	 * Copy up 802.11 header and strip crypto bits.	 */	memmove(skb->data + wep.ic_header, skb->data, hdrlen);	skb_pull(skb, wep.ic_header);	skb_trim(skb, skb->len - wep.ic_trailer);	return 1;}/* * Verify and strip MIC from the frame. */static intwep_demic(struct ieee80211_key *k, struct sk_buff *skb, int hdrlen){	return 1;}static const uint32_t crc32_table[256] = {	0x00000000L, 0x77073096L, 0xee0e612cL, 0x990951baL, 0x076dc419L,	0x706af48fL, 0xe963a535L, 0x9e6495a3L, 0x0edb8832L, 0x79dcb8a4L,	0xe0d5e91eL, 0x97d2d988L, 0x09b64c2bL, 0x7eb17cbdL, 0xe7b82d07L,	0x90bf1d91L, 0x1db71064L, 0x6ab020f2L, 0xf3b97148L, 0x84be41deL,	0x1adad47dL, 0x6ddde4ebL, 0xf4d4b551L, 0x83d385c7L, 0x136c9856L,	0x646ba8c0L, 0xfd62f97aL, 0x8a65c9ecL, 0x14015c4fL, 0x63066cd9L,	0xfa0f3d63L, 0x8d080df5L, 0x3b6e20c8L, 0x4c69105eL, 0xd56041e4L,	0xa2677172L, 0x3c03e4d1L, 0x4b04d447L, 0xd20d85fdL, 0xa50ab56bL,	0x35b5a8faL, 0x42b2986cL, 0xdbbbc9d6L, 0xacbcf940L, 0x32d86ce3L,

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
色偷偷成人一区二区三区91| 91麻豆精品国产91久久久使用方法| 亚洲综合在线五月| 日韩欧美国产三级电影视频| 91在线码无精品| 久99久精品视频免费观看| 一区二区久久久久久| 久久综合久久鬼色| 欧美日本在线视频| 欧美日韩大陆一区二区| 国产精品99久久不卡二区| 日韩精品色哟哟| 亚洲视频一区在线观看| 久久众筹精品私拍模特| 欧美一区欧美二区| 欧美午夜宅男影院| 91社区在线播放| aaa亚洲精品| 成人午夜在线视频| 国产精品88av| 国产丶欧美丶日本不卡视频| 久草在线在线精品观看| 免费在线观看不卡| 丝袜诱惑制服诱惑色一区在线观看| 亚洲欧洲日韩综合一区二区| 国产欧美日韩中文久久| 亚洲精品一区二区精华| 精品少妇一区二区三区在线播放| 欧美群妇大交群中文字幕| 在线免费观看日本一区| 一道本成人在线| 91网站在线播放| proumb性欧美在线观看| 99久久综合精品| 99在线热播精品免费| 成人性色生活片免费看爆迷你毛片| 国产精品一级二级三级| 国产精品一区免费视频| 国产精品18久久久久久vr| 国产一区二区不卡在线| 国产精品亚洲一区二区三区在线| 国产一区二区电影| 成人综合激情网| 成人在线综合网| 成人国产在线观看| 一道本成人在线| 欧美视频一区二区在线观看| 欧美性一区二区| 91精选在线观看| 日韩一区二区在线看片| 精品国一区二区三区| 久久午夜电影网| 欧美激情一区二区三区四区| 国产精品久久久久久久蜜臀 | 舔着乳尖日韩一区| 午夜亚洲福利老司机| 蜜桃免费网站一区二区三区| 国产自产2019最新不卡| av一区二区三区四区| 色老汉av一区二区三区| 91精品国产91久久综合桃花 | 成人福利视频网站| 色哟哟在线观看一区二区三区| 色88888久久久久久影院按摩 | 国产成人av一区二区三区在线 | 亚洲综合在线观看视频| 婷婷夜色潮精品综合在线| 蜜臀av一区二区三区| 国产不卡视频在线观看| 99国产精品久久久久久久久久久 | 日韩亚洲欧美综合| 国产日韩欧美精品在线| 一区二区免费视频| 黄色资源网久久资源365| av电影在线观看完整版一区二区 | 久久久久久一二三区| 自拍偷拍亚洲激情| 久久精品国产亚洲高清剧情介绍| 91免费小视频| 欧美一级在线观看| 国产精品盗摄一区二区三区| 日本视频一区二区| 大美女一区二区三区| 欧美图片一区二区三区| 久久久国产精品麻豆| 亚洲国产综合在线| 国产精品66部| 8v天堂国产在线一区二区| 国产精品色一区二区三区| 五月综合激情日本mⅴ| 成人黄色综合网站| 日韩一区二区三区电影| 亚洲精品久久久久久国产精华液| 蜜桃视频在线观看一区| 色老头久久综合| 日本一区二区三区久久久久久久久不 | 91亚洲精品久久久蜜桃| 欧美精品在线视频| 亚洲免费观看在线视频| 国产一区二区三区av电影| 欧美色倩网站大全免费| 国产精品欧美一区喷水| 久久99久久99精品免视看婷婷| 91久久精品午夜一区二区| 国产女主播一区| 美国毛片一区二区三区| 欧美精品一级二级三级| 亚洲素人一区二区| 成人永久aaa| 精品sm在线观看| 日本三级亚洲精品| 欧美群妇大交群中文字幕| 亚洲精品国产第一综合99久久| 懂色av一区二区三区免费看| 精品久久久影院| 免费在线看一区| 欧美日韩中文字幕一区二区| 亚洲青青青在线视频| 国产成人综合自拍| 国产亚洲欧美中文| 日产欧产美韩系列久久99| 欧美视频你懂的| 亚洲夂夂婷婷色拍ww47 | 成人性生交大片| 亚洲国产精品激情在线观看| 国产高清不卡一区二区| 久久综合色播五月| 国产在线视频一区二区| 精品对白一区国产伦| 久久99精品久久久久久动态图| 91精品久久久久久久91蜜桃| 首页综合国产亚洲丝袜| 欧美高清dvd| 日韩精品欧美精品| 日韩精品一区二| 国模冰冰炮一区二区| 久久久久久久综合狠狠综合| 国产在线精品一区二区三区不卡| 久久天天做天天爱综合色| 国产一区二区三区观看| 国产日产欧美一区二区三区| 一本色道久久综合亚洲精品按摩 | 久久99国产精品久久99| 日韩免费视频一区二区| 精品亚洲免费视频| 久久天天做天天爱综合色| 成人午夜激情影院| 亚洲另类在线一区| 欧美三区免费完整视频在线观看| 亚洲成人黄色影院| 91.成人天堂一区| 男女男精品视频网| 久久久久久日产精品| 成人av电影观看| 一区二区高清免费观看影视大全| 在线观看成人小视频| 无吗不卡中文字幕| 日韩午夜小视频| 国产99久久久精品| 亚洲综合成人网| 日韩欧美国产精品| 成人免费看片app下载| 一区二区三区在线视频观看| 欧美日韩精品一区二区天天拍小说 | 国产欧美日韩综合精品一区二区 | 国产超碰在线一区| 夜夜嗨av一区二区三区中文字幕| 欧美日韩夫妻久久| 国产在线精品视频| 亚洲激情av在线| 26uuu国产日韩综合| 99精品视频在线免费观看| 午夜视频一区二区三区| 精品国产乱码久久久久久1区2区 | 亚洲国产婷婷综合在线精品| 日韩美女视频一区二区在线观看| 成人免费视频免费观看| 香港成人在线视频| 国产精品视频一二三| 7777精品伊人久久久大香线蕉完整版| 麻豆一区二区99久久久久| 亚洲人成伊人成综合网小说| 欧美一区二区黄| 91麻豆免费在线观看| 老司机精品视频一区二区三区| 综合中文字幕亚洲| 精品裸体舞一区二区三区| 色94色欧美sute亚洲线路一久| 看国产成人h片视频| 一个色在线综合| 国产女主播视频一区二区| 欧美日韩国产精品成人| 成人毛片在线观看| 捆绑调教一区二区三区| 亚洲电影一级黄| 国产精品福利av| 久久久欧美精品sm网站| 日韩一区二区电影网| 欧美伊人久久久久久久久影院| 不卡的av电影|