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

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

?? test_tkip.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. *//* * TKIP test module. */#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>/*Key	12 34 56 78 90 12 34 56 78 90 12 34 56 78 90 12	34 56 78 90 12 34 56 78 90 12 34 56 78 90 12 34PN	0x000000000001IV	00 20 01 20 00 00 00 00Phase1	bb 58 07 1f 9e 93 b4 38 25 4bPhase2	00 20 01 4c fe 67 be d2 7c 86 7b 1b f8 02 8b 1c */static const u_int8_t ref_key[] = {	0x12, 0x34, 0x56, 0x78, 0x90, 0x12, 0x34, 0x56, 0x78, 0x90, 0x12,	0x34, 0x56, 0x78, 0x90, 0x12,	0x34, 0x56, 0x78, 0x90, 0x12, 0x34, 0x56, 0x78,		/* TX MIC */	/*	 * NB: 11i test vector specifies a RX MIC key different	 *     from the TX key.  But this doesn't work to enmic,	 *     encrypt, then decrypt, demic.  So instead we use	 *     the same key for doing the MIC in each direction.	 *	 * XXX need additional vectors to test alternate MIC keys	 */#if 0	0x90, 0x12, 0x34, 0x56, 0x78, 0x90, 0x12, 0x34,		/* 11i RX MIC */#else	0x34, 0x56, 0x78, 0x90, 0x12, 0x34, 0x56, 0x78,		/* TX copy */#endif};static const u_int8_t ref_phase1[] = {	0xbb, 0x58, 0x07, 0x1f, 0x9e, 0x93, 0xb4, 0x38, 0x25, 0x4b};static const u_int8_t ref_phase2[] = {	0x00, 0x20, 0x01, 0x4c, 0xfe, 0x67, 0xbe, 0xd2, 0x7c, 0x86,	0x7b, 0x1b, 0xf8, 0x02, 0x8b, 0x1c, };/* Plaintext MPDU with MIC */static const u_int8_t ref_plaintext[] = {0x08,0x42,0x2c,0x00,0x02,0x03,0x04,0x05,0x06,0x08,0x02,0x03,0x04,0x05,0x06,0x07,0x02,0x03,0x04,0x05,0x06,0x07,0xd0,0x02,0xaa,0xaa,0x03,0x00,0x00,0x00,0x08,0x00,0x45,0x00,0x00,0x54,0x00,0x00,0x40,0x00,0x40,0x01,0xa5,0x55,0xc0,0xa8,0x0a,0x02,0xc0,0xa8,0x0a,0x01,0x08,0x00,0x3a,0xb0,0x00,0x00,0x00,0x00,0xcd,0x4c,0x05,0x00,0x00,0x00,0x00,0x00,0x08,0x09,0x0a,0x0b,0x0c,0x0d,0x0e,0x0f,0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1a,0x1b,0x1c,0x1d,0x1e,0x1f,0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2a,0x2b,0x2c,0x2d,0x2e,0x2f,0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,/* MIC */ 0x68,0x81,0xa3,0xf3,0xd6,0x48,0xd0,0x3c};/* Encrypted MPDU with MIC and ICV */static const u_int8_t ref_encrypted[] = {0x08,0x42,0x2c,0x00,0x02,0x03,0x04,0x05,0x06,0x08,0x02,0x03,0x04,0x05,0x06,0x07,0x02,0x03,0x04,0x05,0x06,0x07,0xd0,0x02,0x00,0x20,0x01,0x20,0x00,0x00,0x00,0x00,0xc0,0x0e,0x14,0xfc,0xe7,0xcf,0xab,0xc7,0x75,0x47,0xe6,0x66,0xe5,0x7c,0x0d,0xac,0x70,0x4a,0x1e,0x35,0x8a,0x88,0xc1,0x1c,0x8e,0x2e,0x28,0x2e,0x38,0x01,0x02,0x7a,0x46,0x56,0x05,0x5e,0xe9,0x3e,0x9c,0x25,0x47,0x02,0xe9,0x73,0x58,0x05,0xdd,0xb5,0x76,0x9b,0xa7,0x3f,0x1e,0xbb,0x56,0xe8,0x44,0xef,0x91,0x22,0x85,0xd3,0xdd,0x6e,0x54,0x1e,0x82,0x38,0x73,0x55,0x8a,0xdb,0xa0,0x79,0x06,0x8a,0xbd,0x7f,0x7f,0x50,0x95,0x96,0x75,0xac,0xc4,0xb4,0xde,0x9a,0xa9,0x9c,0x05,0xf2,0x89,0xa7,0xc5,0x2f,0xee,0x5b,0xfc,0x14,0xf6,0xf8,0xe5,0xf8};struct tkip_ctx {	struct ieee80211com *tc_ic;	/* for diagnostics */	u16	tx_ttak[5];	int	tx_phase1_done;	u8	tx_rc4key[16];	u16	rx_ttak[5];	int	rx_phase1_done;	u8	rx_rc4key[16];	u_int64_t rx_rsc;		/* held until MIC verified */};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);}voidtkip_test(struct ieee80211com *ic){	struct tkip_ctx *ctx;	struct ieee80211_key key;	struct sk_buff *skb = NULL;	const struct ieee80211_cipher *cip;	u_int8_t mac[IEEE80211_ADDR_LEN];	/*	 * 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, IEEE80211_CIPHER_TKIP, &key)) {		printk("ieee80211_crypto_newkey failed\n");		goto bad;	}	memcpy(key.wk_key, ref_key, sizeof(ref_key));	key.wk_keylen = 128/NBBY;	key.wk_keyrsc = 0;	key.wk_keytsc = 0;	if (!ieee80211_crypto_setkey(ic, &key, mac)) {		printk("ieee80211_crypto_setkey failed\n");		goto bad;	}	/*	 * Craft frame from plaintext data.  Note that	 * we leave the MIC off as we'll add it ourself	 * and then check it against the reference data.	 */	cip = key.wk_cipher;	skb = dev_alloc_skb(sizeof(ref_plaintext) +			cip->ic_miclen + cip->ic_header + cip->ic_trailer);	if (skb == NULL) {		printk("unable to allocate skbuff\n");		goto bad;	}	skb_reserve(skb, cip->ic_header);	memcpy(skb_put(skb, sizeof(ref_plaintext) - cip->ic_miclen),		ref_plaintext, sizeof(ref_plaintext) - cip->ic_miclen);	/*	 * Add MIC.	 */	if (!ieee80211_crypto_enmic(ic, &key, skb)) {		printk("tkip enmic failed\n");		goto bad;	}	/*	 * Verify: frame length, frame contents.	 */	if (skb->len != sizeof(ref_plaintext)) {		printk("enmic botch; length mismatch\n");		cmpfail(skb->data, skb->len,			ref_plaintext, sizeof(ref_plaintext));		goto bad;	}	if (memcmp(skb->data, ref_plaintext, sizeof(ref_plaintext))) {		printk("enmic botch\n");		cmpfail(skb->data, skb->len,			ref_plaintext, sizeof(ref_plaintext));		goto bad;	}	/*	 * Encrypt frame w/ MIC.	 */	if (!(*cip->ic_encap)(&key, skb, 0<<6)) {		printk("tkip encap failed\n");		goto bad;	}	/*	 * Verify: phase1, phase2, frame length, frame contents.	 */	ctx = key.wk_private;	if (memcmp(ctx->tx_ttak, ref_phase1, sizeof(ref_phase1))) {		printk("encrypt phase1 botch\n");		cmpfail(ctx->tx_ttak, sizeof(ctx->tx_ttak),			ref_phase1, sizeof(ref_phase1));		goto bad;	} else if (memcmp(ctx->tx_rc4key, ref_phase2, sizeof(ref_phase2))) {		printf("encrypt phase2 botch\n");		cmpfail(ctx->tx_rc4key, sizeof(ctx->tx_rc4key),			ref_phase2, sizeof(ref_phase2));		goto bad;	} else if (skb->len != sizeof(ref_encrypted)) {		printk("encrypt data length mismatch\n");		cmpfail(skb->data, skb->len,			ref_encrypted, sizeof(ref_encrypted));		goto bad;	} else if (memcmp(skb->data, ref_encrypted, skb->len)) {		printk("encrypt data does not compare\n");		cmpfail(skb->data, skb->len,			ref_encrypted, sizeof(ref_encrypted));		dumpdata("Plaintext", ref_plaintext, sizeof(ref_plaintext));		goto bad;	}	/*	 * Decrypt frame.	 */	if (!(*cip->ic_decap)(&key, skb)) {		printk("tkip decap failed\n");		/*		 * Check reason for failure: phase1, phase2, frame data (ICV).		 */		if (memcmp(ctx->rx_ttak, ref_phase1, sizeof(ref_phase1))) {			printk("decrypt phase1 botch\n");			cmpfail(ctx->rx_ttak, sizeof(ctx->rx_ttak),				ref_phase1, sizeof(ref_phase1));		} else if (memcmp(ctx->rx_rc4key, ref_phase2, sizeof(ref_phase2))) {			printf("decrypt phase2 botch\n");			cmpfail(ctx->rx_rc4key, sizeof(ctx->rx_rc4key),				ref_phase2, sizeof(ref_phase2));		} else {			printk("decrypt data does not compare\n");			cmpfail(skb->data, skb->len,				ref_plaintext, sizeof(ref_plaintext));		}		goto bad;	}	/*	 * Verify: frame length, frame contents.	 */	if (skb->len != sizeof(ref_plaintext)) {		printk("decap botch; length mismatch\n");		cmpfail(skb->data, skb->len,			ref_plaintext, sizeof(ref_plaintext));		goto bad;	}	if (memcmp(skb->data, ref_plaintext, sizeof(ref_plaintext))) {		printk("decap botch; data does not compare\n");		cmpfail(skb->data, skb->len,			ref_plaintext, sizeof(ref_plaintext));		goto bad;	}	/*	 * De-MIC decrypted frame.	 */	if (!ieee80211_crypto_demic(ic, &key, skb)) {		printk("tkip demic failed\n");		goto bad;	}	/* XXX check frame length and contents... */	printk("802.11i TKIP test vectors passed\n");bad:	if (skb != NULL)		dev_kfree_skb(skb);	ieee80211_crypto_delkey(ic, &key);}/* * Module glue. */MODULE_AUTHOR("Errno Consulting, Sam Leffler");MODULE_DESCRIPTION("802.11 wireless support: TKIP cipher tester");#ifdef MODULE_LICENSEMODULE_LICENSE("Dual BSD/GPL");#endifstatic	int debug = 0;MODULE_PARM(debug, "i");MODULE_PARM_DESC(debug, "Enable IEEE80211_MSG_CRYPTO");static int __initinit_crypto_tkip_test(void){	struct ieee80211com ic;	memset(&ic, 0, sizeof(ic));	if (debug)		ic.msg_enable = IEEE80211_MSG_CRYPTO;	ieee80211_crypto_attach(&ic);	tkip_test(&ic);	ieee80211_crypto_detach(&ic);	return 0;}module_init(init_crypto_tkip_test);static void __exitexit_crypto_tkip_test(void){}module_exit(exit_crypto_tkip_test);

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美午夜免费电影| 欧美国产成人精品| 国产精品午夜在线| 首页国产丝袜综合| 91免费观看在线| 精品国产伦理网| 亚洲一区二区三区四区五区黄| 麻豆国产精品视频| 欧美三级资源在线| 成人欧美一区二区三区| 韩国成人在线视频| 欧美日本视频在线| 亚洲精品中文字幕乱码三区| 国产自产v一区二区三区c| 欧美性受xxxx黑人xyx| 国产精品美女久久久久av爽李琼| 午夜电影网一区| 欧美亚洲国产一区二区三区 | 久久综合综合久久综合| 色综合久久综合网| 国产精品久久久久影视| 福利视频网站一区二区三区| 精品久久一区二区| 免费黄网站欧美| 91精品一区二区三区久久久久久| 亚洲男同1069视频| 91国产视频在线观看| 亚洲免费在线播放| 色婷婷综合久久久中文字幕| 亚洲婷婷在线视频| 波多野洁衣一区| 国产精品久久久久久一区二区三区 | 欧美丰满一区二区免费视频| 亚洲黄色小说网站| 色婷婷综合激情| 亚洲柠檬福利资源导航| 在线区一区二视频| 三级成人在线视频| 日韩丝袜情趣美女图片| 久久91精品久久久久久秒播| 日韩欧美电影一区| 韩国一区二区在线观看| 久久久三级国产网站| 99vv1com这只有精品| 欧美极品少妇xxxxⅹ高跟鞋 | 在线视频一区二区免费| 亚洲香蕉伊在人在线观| 欧美人与z0zoxxxx视频| 日本欧美肥老太交大片| 日韩欧美国产一二三区| 国产一区二区三区在线看麻豆| 国产视频不卡一区| 色又黄又爽网站www久久| 亚洲第一久久影院| 精品嫩草影院久久| 成人国产精品免费观看视频| 亚洲日本丝袜连裤袜办公室| 欧美精品在欧美一区二区少妇| 看片的网站亚洲| 国产欧美一区二区精品仙草咪| jlzzjlzz亚洲日本少妇| 午夜日韩在线观看| 国产午夜精品久久久久久久 | 夜夜嗨av一区二区三区中文字幕 | 国产精品女人毛片| 欧洲生活片亚洲生活在线观看| 亚洲成va人在线观看| 久久一留热品黄| 色悠久久久久综合欧美99| 日本欧美一区二区三区| 国产精品久久免费看| 欧美精品精品一区| 国产.精品.日韩.另类.中文.在线.播放 | 日韩一级二级三级精品视频| 成人性色生活片免费看爆迷你毛片| 亚洲一区在线观看网站| 久久这里都是精品| 日本高清不卡视频| 国产精品夜夜爽| 日韩激情视频在线观看| 国产精品不卡视频| 日韩精品专区在线影院重磅| 色狠狠桃花综合| 国产精品一级在线| 蜜桃在线一区二区三区| 亚洲免费观看高清完整| 欧美精品一区二区三区蜜桃 | 亚洲一二三四在线观看| 久久久蜜桃精品| 欧美日本韩国一区| 色94色欧美sute亚洲线路二| 国产一区二区三区黄视频| 香蕉乱码成人久久天堂爱免费| 国产精品理论片| 国产调教视频一区| 4438成人网| 欧美日韩中文字幕一区二区| 99riav一区二区三区| 国产成人av影院| 国产乱人伦偷精品视频不卡| 亚洲国产sm捆绑调教视频 | 日本韩国欧美三级| 成人一级视频在线观看| 国产精品一线二线三线精华| 天使萌一区二区三区免费观看| 一区二区三区**美女毛片| 国产精品福利av| 国产欧美日本一区二区三区| 精品国产一区二区三区四区四| 欧美一区二区三区性视频| 欧美精品自拍偷拍| 欧美日本韩国一区| 91精品啪在线观看国产60岁| 在线免费视频一区二区| 欧美性受xxxx| 欧美人牲a欧美精品| 欧美日韩亚洲综合在线 欧美亚洲特黄一级| 成人久久视频在线观看| 国产成人综合精品三级| 国产盗摄精品一区二区三区在线| 激情五月激情综合网| 韩国欧美国产1区| 国产精品综合二区| 成人免费av网站| 99综合影院在线| 日本韩国精品在线| 欧美优质美女网站| 欧美日韩国产a| 91精品视频网| 久久一区二区视频| 中文字幕视频一区二区三区久| 国产精品灌醉下药二区| 亚洲精品伦理在线| 日韩二区三区在线观看| 激情图片小说一区| 成人午夜在线播放| 欧美视频在线不卡| 久久综合一区二区| 椎名由奈av一区二区三区| 五月婷婷另类国产| 国产乱理伦片在线观看夜一区| 波多野结衣中文字幕一区二区三区| 一本久久a久久精品亚洲| 91精品国产免费| 国产欧美日韩视频一区二区| 亚洲乱码精品一二三四区日韩在线| 亚洲.国产.中文慕字在线| 精品一区二区三区免费观看| 白白色亚洲国产精品| 欧美日韩一区二区三区高清| 26uuu国产日韩综合| 亚洲精品久久久蜜桃| 奇米综合一区二区三区精品视频| 国产毛片精品视频| 欧美日韩国产高清一区| 久久色在线观看| 亚洲精品videosex极品| 久久精品99国产精品日本| 99在线精品一区二区三区| 欧美精三区欧美精三区| 国产精品二三区| 日本视频一区二区三区| av激情综合网| 久久午夜国产精品| 水蜜桃久久夜色精品一区的特点| 国产成a人亚洲| 91精品国产一区二区三区香蕉| 国产免费观看久久| 免费观看一级特黄欧美大片| 不卡视频在线观看| 精品久久免费看| 午夜精品视频在线观看| 91在线观看成人| 久久久精品tv| 久久9热精品视频| 欧美性生活影院| 国产精品久久久久久久久免费桃花 | 欧美一区二区三区四区在线观看 | 91久久国产综合久久| 欧美激情自拍偷拍| 国内精品视频一区二区三区八戒 | 青青草视频一区| 欧美在线视频日韩| 亚洲另类一区二区| 成人av电影在线播放| 久久久综合九色合综国产精品| 日韩精品乱码av一区二区| 欧美影院精品一区| 亚洲免费资源在线播放| av电影在线观看完整版一区二区| 精品捆绑美女sm三区| 欧美aaaaa成人免费观看视频| 欧美日韩精品高清| 午夜日韩在线电影| 欧美高清dvd| 亚洲图片一区二区| 欧美亚洲另类激情小说| 亚洲一区av在线| 欧美亚洲图片小说| 午夜私人影院久久久久|