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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? test_wep.c

?? Atheros wifi driver source code
?? C
字號:
/*- * Copyright (c) 2004 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. *//* * WEP test module. * * Test vectors come from section I.7.2 of P802.11i/D7.0, October 2003. * * To use this tester load the net80211 layer (either as a module or * by statically configuring it into your kernel), then insmod this * module.  It should automatically run all test cases and print * information for each.  To run one or more tests you can specify a * tests parameter to the module that is a bit mask of the set of tests * you want; e.g. insmod wep_test tests=7 will run only test mpdu's * 1, 2, and 3. */#include <linux/config.h>#include <linux/version.h>#include <linux/module.h>#include <linux/init.h>#include <linux/skbuff.h>#include <linux/netdevice.h>#include "if_media.h"#include <net80211/ieee80211_var.h>/*MPDU data aa aa 03 00 00 00 08 00 45 00 00 4e 66 1a 00 00 80 11 be 64 0a 00 01 22 0a ff ff ff 00 89 00 89 00 3a 00 00 80 a6 01 10 00 01 00 00 00 00 00 00 20 45 43 45 4a 45 48 45 43 46 43 45 50 46 45 45 49 45 46 46 43 43 41 43 41 43 41 43 41 43 41 41 41 00 00 20 00 01RC4 encryption is performed as follows:1718  Key  fb 02 9e 30 31 32 33 34 Plaintext aa aa 03 00 00 00 08 00 45 00 00 4e 66 1a 00 00 80 11 be 64 0a 00 01 22 0a ff ff ff 00 89 00 89 00 3a 00 00 80 a6 01 10 00 01 00 00 00 00 00 00 20 45 43 45 4a 45 48 45 43 46 43 45 50 46 45 45 49 45 46 46 43 43 41 43 41 43 41 43 41 43 41 41 41 00 00 20 00 01 1b d0 b6 04Ciphertext f6 9c 58 06 bd 6c e8 46 26 bc be fb 94 74 65 0a ad 1f 79 09 b0 f6 4d 5f 58 a5 03 a2 58 b7 ed 22 eb 0e a6 49 30 d3 a0 56 a5 57 42 fc ce 14 1d 48 5f 8a a8 36 de a1 8d f4 2c 53 80 80 5a d0 c6 1a 5d 6f 58 f4 10 40 b2 4b 7d 1a 69 38 56 ed 0d 43 98 e7 ae e3 bf 0e 2a 2c a8 f7The plaintext consists of the MPDU data, followed by a 4-octet CRC-32calculated over the MPDU data.19  The expanded MPDU, after WEP encapsulation, is as follows:2021  IV  fb 02 9e 80MPDU  data f6 9c 58 06 bd 6c e8 46 26 bc be fb 94 74 65 0a ad 1f 79 09 b0 f6 4d 5f 58 a5 03 a2 58 b7 ed 22 eb 0e a6 49 30 d3 a0 56 a5 57 42 fc ce 14 1d 48 5f 8a a8 36 de a1 8d f4 2c 53 80 80 5a d0 c6 1a 5d 6f 58 f4 10 40 b2 4b 7d 1a 69 38 56 ed 0d 43 98 e7 ae e3 bf 0eICV  2a 2c a8 f7  */static const u_int8_t test1_key[] = {		/* TK (w/o IV) */	0x30, 0x31, 0x32, 0x33, 0x34, };static const u_int8_t test1_plaintext[] = {	/* Plaintext MPDU */	0x08, 0x48, 0xc3, 0x2c, 0x0f, 0xd2, 0xe1, 0x28,	/* 802.11 Header */	0xa5, 0x7c, 0x50, 0x30, 0xf1, 0x84, 0x44, 0x08,	0xab, 0xae, 0xa5, 0xb8, 0xfc, 0xba, 0x80, 0x33, 	0xaa, 0xaa, 0x03, 0x00, 0x00, 0x00, 0x08, 0x00,	/* Plaintext data */	0x45, 0x00, 0x00, 0x4e, 0x66, 0x1a, 0x00, 0x00,	0x80, 0x11, 0xbe, 0x64, 0x0a, 0x00, 0x01, 0x22,	0x0a, 0xff, 0xff, 0xff, 0x00, 0x89, 0x00, 0x89,	0x00, 0x3a, 0x00, 0x00, 0x80, 0xa6, 0x01, 0x10,	0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,	0x20, 0x45, 0x43, 0x45, 0x4a, 0x45, 0x48, 0x45,	0x43, 0x46, 0x43, 0x45, 0x50, 0x46, 0x45, 0x45,	0x49, 0x45, 0x46, 0x46, 0x43, 0x43, 0x41, 0x43,	0x41, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x41,	0x41, 0x00, 0x00, 0x20, 0x00, 0x01,};static const u_int8_t test1_encrypted[] = {	/* Encrypted MPDU */	0x08, 0x48, 0xc3, 0x2c, 0x0f, 0xd2, 0xe1, 0x28,	0xa5, 0x7c, 0x50, 0x30, 0xf1, 0x84, 0x44, 0x08,	0xab, 0xae, 0xa5, 0xb8, 0xfc, 0xba, 0x80, 0x33,	0xfb, 0x02, 0x9e, 0x80, 0xf6, 0x9c, 0x58, 0x06,	0xbd, 0x6c, 0xe8, 0x46, 0x26, 0xbc, 0xbe, 0xfb,	0x94, 0x74, 0x65, 0x0a, 0xad, 0x1f, 0x79, 0x09,	0xb0, 0xf6, 0x4d, 0x5f, 0x58, 0xa5, 0x03, 0xa2,	0x58, 0xb7, 0xed, 0x22, 0xeb, 0x0e, 0xa6, 0x49,	0x30, 0xd3, 0xa0, 0x56, 0xa5, 0x57, 0x42, 0xfc,	0xce, 0x14, 0x1d, 0x48, 0x5f, 0x8a, 0xa8, 0x36,	0xde, 0xa1, 0x8d, 0xf4, 0x2c, 0x53, 0x80, 0x80,	0x5a, 0xd0, 0xc6, 0x1a, 0x5d, 0x6f, 0x58, 0xf4,	0x10, 0x40, 0xb2, 0x4b, 0x7d, 0x1a, 0x69, 0x38,	0x56, 0xed, 0x0d, 0x43, 0x98, 0xe7, 0xae, 0xe3,	0xbf, 0x0e, 0x2a, 0x2c, 0xa8, 0xf7,};/* XXX fix byte order of iv */#define	TEST(n,name,cipher,keyix,iv0,iv1,iv2,iv3) { \	name, IEEE80211_CIPHER_##cipher,keyix, { iv2,iv1,iv0,iv3 }, \	test##n##_key,   sizeof(test##n##_key), \	test##n##_plaintext, sizeof(test##n##_plaintext), \	test##n##_encrypted, sizeof(test##n##_encrypted) \}struct ciphertest {	const char	*name;	int		cipher;	int		keyix;	u_int8_t	iv[4];	const u_int8_t	*key;	size_t		key_len;	const u_int8_t	*plaintext;	size_t		plaintext_len;	const u_int8_t	*encrypted;	size_t		encrypted_len;} weptests[] = {	TEST(1, "WEP test mpdu 1", WEP, 2, 0xfb, 0x02, 0x9e, 0x80),};static voiddumpdata(const char *tag, const void *p, size_t len){	int i;	printk("%s: 0x%p len %u", tag, p, len);	for (i = 0; i < len; i++) {		if ((i % 16) == 0)			printk("\n%03d:", i);		printk(" %02x", ((u_int8_t *)p)[i]);	}	printk("\n");}static voidcmpfail(const void *gen, size_t genlen, const void *ref, size_t reflen){	int i;	for (i = 0; i < genlen; i++)		if (((u_int8_t *)gen)[i] != ((u_int8_t *)ref)[i]) {			printk("first difference at byte %u\n", i);			break;		}	dumpdata("Generated", gen, genlen);	dumpdata("Reference", ref, reflen);}struct wep_ctx_hw {			/* for use with h/w support */	struct ieee80211com *wc_ic;	/* for diagnostics */	u_int32_t	wc_iv;		/* initial vector for crypto */};intruntest(struct ieee80211com *ic, struct ciphertest *t){	struct ieee80211_key key;	struct sk_buff *skb = NULL;	const struct ieee80211_cipher *cip;	u_int8_t mac[IEEE80211_ADDR_LEN];	struct wep_ctx_hw *ctx;	printk("%s: ", t->name);	/*	 * Setup key.	 */	memset(&key, 0, sizeof(key));	key.wk_flags = IEEE80211_KEY_XMIT | IEEE80211_KEY_RECV;	key.wk_cipher = &ieee80211_cipher_none;	if (!ieee80211_crypto_newkey(ic, t->cipher, &key)) {		printk("FAIL: ieee80211_crypto_newkey failed\n");		goto bad;	}	memcpy(key.wk_key, t->key, t->key_len);	key.wk_keylen = t->key_len;	if (!ieee80211_crypto_setkey(ic, &key, mac)) {		printk("FAIL: ieee80211_crypto_setkey failed\n");		goto bad;	}	cip = key.wk_cipher;	/*	 * Craft encrypted frame from known data.	 */	skb = dev_alloc_skb(t->encrypted_len);	if (skb == NULL) {		printk("FAIL: unable to allocate skbuff\n");		goto bad;	}	memcpy(skb_put(skb, t->encrypted_len), t->encrypted, t->encrypted_len);	/*	 * Decrypt frame.	 */	if (!(*cip->ic_decap)(&key, skb)) {		printk("FAIL: wep decap failed\n");		cmpfail(skb->data, skb->len,			t->plaintext, t->plaintext_len);		goto bad;	}	/*	 * Verify: frame length, frame contents.	 */	if (skb->len != t->plaintext_len) {		printk("FAIL: decap botch; length mismatch\n");		cmpfail(skb->data, skb->len,			t->plaintext, t->plaintext_len);		goto bad;	} else if (memcmp(skb->data, t->plaintext, t->plaintext_len)) {		printk("FAIL: decap botch; data does not compare\n");		cmpfail(skb->data, skb->len,			t->plaintext, sizeof(t->plaintext));		goto bad;	}	/*	 * Encrypt frame.	 */	ctx = (struct wep_ctx_hw *) key.wk_private;	memcpy(&ctx->wc_iv, t->iv, sizeof(t->iv));	/* for encap/encrypt */	if (!(*cip->ic_encap)(&key, skb, t->keyix<<6)) {		printk("FAIL: wep encap failed\n");		goto bad;	}	/*	 * Verify: frame length, frame contents.	 */	if (skb->len != t->encrypted_len) {		printk("FAIL: encap data length mismatch\n");		cmpfail(skb->data, skb->len,			t->encrypted, t->encrypted_len);		goto bad;	} else if (memcmp(skb->data, t->encrypted, skb->len)) {		printk("FAIL: encrypt data does not compare\n");		cmpfail(skb->data, skb->len,			t->encrypted, t->encrypted_len);		dumpdata("Plaintext", t->plaintext, t->plaintext_len);		goto bad;	}	dev_kfree_skb(skb);	ieee80211_crypto_delkey(ic, &key);	printk("PASS\n");	return 1;bad:	if (skb != NULL)		dev_kfree_skb(skb);	ieee80211_crypto_delkey(ic, &key);	return 0;}/* * Module glue. */MODULE_AUTHOR("Errno Consulting, Sam Leffler");MODULE_DESCRIPTION("802.11 wireless support: WEP cipher tester");#ifdef MODULE_LICENSEMODULE_LICENSE("Dual BSD/GPL");#endifstatic	int tests = -1;MODULE_PARM(tests, "i");MODULE_PARM_DESC(tests, "Specify which tests to run");static	int debug = 0;MODULE_PARM(debug, "i");MODULE_PARM_DESC(debug, "Enable IEEE80211_MSG_CRYPTO");static int __initinit_crypto_wep_test(void){#define	N(a)	(sizeof(a)/sizeof(a[0]))	struct ieee80211com ic;	int i, pass, total;	memset(&ic, 0, sizeof(ic));	if (debug)		ic.msg_enable = IEEE80211_MSG_CRYPTO;	ieee80211_crypto_attach(&ic);	pass = 0;	total = 0;	for (i = 0; i < N(weptests); i++)		if (tests & (1<<i)) {			total++;			pass += runtest(&ic, &weptests[i]);		}	printk("%u of %u 802.11i WEP test vectors passed\n", pass, total);	ieee80211_crypto_detach(&ic);	return (pass == total ? 0 : -1);#undef N}module_init(init_crypto_wep_test);static void __exitexit_crypto_wep_test(void){}module_exit(exit_crypto_wep_test);

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日韩欧美一级二级| 亚洲一级二级三级| 亚洲一区在线观看视频| 国内外精品视频| 欧美日韩三级视频| 国产精品色眯眯| 奇米影视7777精品一区二区| 99久久综合国产精品| 日韩一级欧美一级| 午夜久久电影网| 91免费看片在线观看| 久久久精品黄色| 久热成人在线视频| 日韩一区二区在线观看视频播放| 亚洲综合一区二区| 99久久久无码国产精品| 久久久久久久综合| 捆绑变态av一区二区三区| 欧美日韩不卡一区| 午夜精品爽啪视频| 欧美日韩黄色一区二区| 一区二区三区四区乱视频| 99久久精品国产网站| 中文字幕第一区| 成人听书哪个软件好| 久久久久久久久久久99999| 日韩电影在线一区二区三区| 欧美性生交片4| 亚洲超丰满肉感bbw| 欧美日韩在线播放三区| 一区二区三区视频在线看| 色综合一个色综合| 亚洲精选在线视频| 欧美日韩一区二区三区免费看| 一区二区三区中文字幕电影 | 亚洲视频一区二区免费在线观看| 国产一区视频在线看| 精品国产一区二区三区不卡| 老司机精品视频一区二区三区| 欧美大片国产精品| 国内精品免费**视频| 国产亚洲综合av| 成人av电影在线播放| 1024精品合集| 欧美在线短视频| 日韩高清一级片| 精品久久久久久久久久久久久久久 | 欧美一区国产二区| 美女www一区二区| 国产丝袜美腿一区二区三区| 成人av在线资源网| 亚洲福中文字幕伊人影院| 欧美成人在线直播| 国产成人av在线影院| 亚洲免费观看高清完整| 这里是久久伊人| 国产成人在线视频网址| 综合激情网...| 欧美一区在线视频| 成人动漫精品一区二区| 亚洲一区影音先锋| 久久精品欧美一区二区三区不卡 | 国产精品久久久久毛片软件| 91国偷自产一区二区开放时间| 五月天久久比比资源色| 欧美精品一区二区三区蜜桃视频| 成人综合婷婷国产精品久久蜜臀| 一区二区三区中文字幕电影| 精品盗摄一区二区三区| 色哟哟精品一区| 国产一区二区三区高清播放| 亚洲精品高清在线| 欧美大胆一级视频| 在线看不卡av| 国产黄人亚洲片| 秋霞电影网一区二区| 中文字幕永久在线不卡| 日韩一区二区三区免费观看| 91在线高清观看| 国产精品1区二区.| 日日夜夜免费精品视频| 国产精品第四页| 精品国产电影一区二区| 在线观看一区不卡| av成人免费在线| 麻豆精品新av中文字幕| 一区二区三区日韩精品视频| 日韩精品一区二区三区三区免费| 在线观看视频一区| 成人性生交大片免费看中文| 毛片不卡一区二区| 亚洲v中文字幕| 亚洲欧美日韩系列| 欧美va天堂va视频va在线| 欧美中文字幕一区二区三区亚洲| 国产91综合一区在线观看| 麻豆国产欧美一区二区三区| 亚洲成av人综合在线观看| 国产精品久久久久久久久晋中| 欧美mv日韩mv亚洲| 欧美一区二区三区精品| 欧美性色欧美a在线播放| 91免费国产在线观看| 国产a视频精品免费观看| 激情伊人五月天久久综合| 国产成人精品免费在线| 国产一区二区精品久久| 精品一区二区三区视频| 日韩国产欧美视频| 亚洲国产成人av好男人在线观看| 一区二区三区四区精品在线视频| 日韩美女精品在线| 亚洲欧美日韩一区二区 | 色噜噜久久综合| 99国产精品久久久久| 91麻豆免费观看| 欧美无乱码久久久免费午夜一区| 91一区在线观看| 91精彩视频在线| 91福利国产精品| 欧美午夜精品一区| 欧美一区日韩一区| 精品久久99ma| 久久久影院官网| 国产精品视频麻豆| 亚洲九九爱视频| 日产精品久久久久久久性色| 麻豆91在线观看| 国产麻豆日韩欧美久久| 成人一级黄色片| 欧美在线观看18| 日韩欧美精品三级| 久久久另类综合| 亚洲欧洲国产日本综合| 亚洲成人7777| 久久福利资源站| 国产91在线观看丝袜| 欧美亚洲免费在线一区| 日韩视频在线你懂得| 久久亚洲一级片| 综合分类小说区另类春色亚洲小说欧美| 日韩一区在线看| 男男成人高潮片免费网站| 国产酒店精品激情| 色欧美日韩亚洲| 精品福利一二区| 日韩一区欧美一区| 男人的天堂亚洲一区| 国产成人av一区| 欧美色涩在线第一页| 精品久久久久香蕉网| 一区二区三区中文字幕| 激情综合色播激情啊| 91美女蜜桃在线| 精品国产91洋老外米糕| 综合久久久久久久| 91香蕉视频mp4| 欧美大度的电影原声| 亚洲美女视频一区| 国产一区欧美一区| 欧美日韩一区高清| 中文字幕乱码亚洲精品一区| 亚洲超碰97人人做人人爱| 国产成人精品一区二区三区网站观看| 在线视频一区二区三区| 国产欧美日韩视频一区二区| 天天综合天天综合色| 91美女视频网站| 欧美国产欧美综合| 蜜臀av一区二区| 91成人免费电影| 中文字幕免费观看一区| 久久激情五月婷婷| 欧美巨大另类极品videosbest | 精品一区二区在线看| 色94色欧美sute亚洲线路一ni| 久久久久久久久久久久久女国产乱 | 国产精品主播直播| 日韩一区二区三区精品视频| 一级女性全黄久久生活片免费| 成人深夜视频在线观看| 精品国产亚洲在线| 天堂资源在线中文精品| 色综合天天狠狠| 中文字幕亚洲一区二区va在线| 精久久久久久久久久久| 91精品国产综合久久精品性色| 一区二区三区免费观看| 色综合久久综合网97色综合| 中文字幕视频一区| 国产精品18久久久| 久久精品人人做人人爽人人| 久久99热狠狠色一区二区| 91精品国产综合久久蜜臀| 性感美女极品91精品| 欧美视频一区二区三区四区| 国产真实乱偷精品视频免| ww亚洲ww在线观看国产| 国产一区二区福利视频| 国产亚洲一本大道中文在线|