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

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

?? radius_authorize.c

?? vxworks下radius協議棧 的源代碼
?? C
?? 第 1 頁 / 共 2 頁
字號:
		}	sptr_packet = (RADIUS_PACKET *) bptr_authentication_string;		memcpy (bptr_authentication_string, (BYTE *)sptr_rx_packet, packet_length);	memcpy (sptr_packet->header.authenticator, bptr_authenticator, RADIUS_SIZE_OF_AUTHENTICATOR);	memcpy (bptr_authentication_string + packet_length, p_server->bp_secret, p_server->secret_length);	MD_string (bptr_authentication_string, buffer_length, (BYTE *)&md5_result[0], MD5); 	table_free (bptr_authentication_string);	if (memcmp (md5_result, sptr_rx_packet->header.authenticator, RADIUS_SIZE_OF_AUTHENTICATOR) == MEMORY_IS_IDENTICAL)		{		return (PASS);		}	else		{		return (FAIL);		}}#ifdef __EAP__/*****************************************************************************************/bool radius_eap_message_present (RADIUS_LIST_CONTROLLER* p_radius_attribute_list_controller){	RW_CONTAINER_ITERATOR attribute_iterator;	RADIUS_ATTRIBUTE_ENTRY* p_attribute;	attribute_iterator = p_radius_attribute_list_controller->iterator;		rw_container_goto_front (attribute_iterator);		while (rw_container_is_at_end (attribute_iterator) == false)		{		p_attribute = rw_container_at (attribute_iterator);				if (p_attribute->type == RADIUS_EAP_MESSAGE)			{			return (true);			}		rw_container_next (attribute_iterator);		}	return (false);}/*************************************************************************//* refer to rfc2869 section 5.14 for details */enum TEST radius_verifiy_message_authenticator (RADIUS_PACKET *sptr_rx_packet, BYTE *bptr_authenticator,										   RADIUS_LIST_CONTROLLER* p_radius_attribute_list_controller, RADIUS_SERVER* p_server){	BYTE *bptr_authentication_string;	RADIUS_PACKET *sptr_packet;	USHORT packet_length;	BYTE hmac_md5_result[HMAC_MD5_RESULT_LENGTH];	BYTE message_authenticator[HMAC_MD5_RESULT_LENGTH];	if (radius_eap_message_present (p_radius_attribute_list_controller) == false)		{		return (PASS);		}	packet_length = swap (sptr_rx_packet->header.length);	bptr_authentication_string = (BYTE *) table_malloc (1, packet_length);	if (bptr_authentication_string == NULL)		{		return (FAIL);		}	sptr_packet = (RADIUS_PACKET *) bptr_authentication_string;		memcpy (bptr_authentication_string, (BYTE *)sptr_rx_packet, packet_length);	memcpy (sptr_packet->header.authenticator, bptr_authenticator, RADIUS_SIZE_OF_AUTHENTICATOR);	memset (&message_authenticator[0], 0, HMAC_MD5_RESULT_LENGTH);	if (radius_get_message_authenticator_attribute (sptr_packet, (BYTE *)&message_authenticator[0], p_radius_attribute_list_controller) == false)		{		table_free (bptr_authentication_string);		return (FAIL);		}	memset (&hmac_md5_result[0], 0, HMAC_MD5_RESULT_LENGTH);	radius_hmac_md5 ((unsigned char *)sptr_packet, packet_length, p_server->bp_secret, p_server->secret_length, (BYTE *)&hmac_md5_result[0]);	table_free (bptr_authentication_string);	if (memcmp (hmac_md5_result, message_authenticator, HMAC_MD5_RESULT_LENGTH) == MEMORY_IS_IDENTICAL)		{		return (PASS);		}	else		{		return (FAIL);		}}/*****************************************************************************************//* Copy MA (Message Authenticator) and remove it from the attribute list of the radius   *//* client.  Also zeroing out the MA of the packet										 *//*****************************************************************************************/static bool radius_get_message_authenticator_attribute (RADIUS_PACKET *sptr_packet, BYTE* p_buffer,													  RADIUS_LIST_CONTROLLER* p_radius_attribute_list_controller){	bool message_authenticator_exist;	enum RADIUS_ATTRIBUTE_TYPE type;	RW_CONTAINER_ITERATOR attribute_iterator;	RADIUS_ATTRIBUTE_ENTRY* p_attribute;	RADIUS_ATTRIBUTE_ENTRY_IN_PACKET *sptr_attribute_entry_in_packet;	UINT attribute_length;	UINT packet_length;	message_authenticator_exist = false;	sptr_attribute_entry_in_packet = (RADIUS_ATTRIBUTE_ENTRY_IN_PACKET *) &sptr_packet->data;	packet_length = (UINT) (swap (sptr_packet->header.length));	if (packet_length < sizeof (RADIUS_PACKET_HEADER)) 		{		return (false);		}	packet_length -= sizeof (RADIUS_PACKET_HEADER);	while (packet_length > 0)		{		type = sptr_attribute_entry_in_packet->type;		attribute_length = (UINT) sptr_attribute_entry_in_packet->length;		if (type == RADIUS_MESSAGE_AUTHENTICATOR)			{			memset (&sptr_attribute_entry_in_packet->value[0], 0, HMAC_MD5_RESULT_LENGTH);			message_authenticator_exist = true;			}		sptr_attribute_entry_in_packet = (RADIUS_ATTRIBUTE_ENTRY_IN_PACKET *) ((BYTE *) sptr_attribute_entry_in_packet + 			sptr_attribute_entry_in_packet->length);		packet_length -= attribute_length;		}	if (message_authenticator_exist == false)		{		return (false);		}	attribute_iterator = p_radius_attribute_list_controller->iterator;		rw_container_goto_front (attribute_iterator);		while (rw_container_is_at_end (attribute_iterator) == false)		{		p_attribute = rw_container_at (attribute_iterator);				if (p_attribute->type == RADIUS_MESSAGE_AUTHENTICATOR)			{			memcpy (p_buffer, &p_attribute->value[0], p_attribute->length_of_attribute_value);			rw_container_remove (attribute_iterator);					table_free (p_attribute);			return (true);			}		rw_container_next (attribute_iterator);		}	return (false);}/*****************************************************************************************//* check for eap message type and if it exists, we initialize the old message			 *//* authenticator to all zeros or add a new message authenticator.  We also remove		 *//* message authenticator if eap message type doesn't exist.								 *//* NOTE: If EAP packet is longer than 253 octes, it will be placed into more than one	 *//* EAP Message attribute with multiple of 253											 *//*****************************************************************************************/bool radius_check_eap_and_ma_attribute (RADIUS_LIST_CONTROLLER* p_radius_attribute_list_controller){	RW_CONTAINER_ITERATOR attribute_iterator;	RADIUS_ATTRIBUTE_ENTRY* p_attribute;	bool eap_message_exist = false;	bool message_authenticator_exist = false;	UINT attribute_length;	UINT new_attribute_value_length;	UINT new_attribute_entry_size;	RADIUS_ATTRIBUTE_ENTRY *sptr_new_attribute;	UINT temp_attribute_value_index;	attribute_iterator = p_radius_attribute_list_controller->iterator;		rw_container_goto_front (attribute_iterator);		while (rw_container_is_at_end (attribute_iterator) == false)		{		p_attribute = rw_container_at (attribute_iterator);				if (p_attribute->type == RADIUS_EAP_MESSAGE)			{			eap_message_exist = true;			if (p_attribute->length_of_attribute_value > RADIUS_MAX_EAP_PAYLOAD)				{				rw_container_remove (attribute_iterator);				temp_attribute_value_index = 0;				attribute_length = p_attribute->length_of_attribute_value;					while (attribute_length > 0)					{					if (attribute_length > RADIUS_MAX_EAP_PAYLOAD)						new_attribute_value_length = RADIUS_MAX_EAP_PAYLOAD;					else						new_attribute_value_length = attribute_length;									new_attribute_entry_size = new_attribute_value_length + sizeof (RADIUS_MESSAGE_ATTRIBUTE_HEADER);									sptr_new_attribute = (RADIUS_ATTRIBUTE_ENTRY *) table_malloc (1, new_attribute_entry_size);					if (sptr_new_attribute == NULL)						{						rw_container_free_iterator (attribute_iterator);											return (false);						}										memset ((BYTE *) sptr_new_attribute, 0, new_attribute_entry_size);								sptr_new_attribute->type = RADIUS_EAP_MESSAGE;							sptr_new_attribute->length_of_attribute_value = new_attribute_value_length;					memcpy (&sptr_new_attribute->value[0], &(p_attribute->value [temp_attribute_value_index]), new_attribute_value_length);					rw_container_add_back (p_radius_attribute_list_controller->p_list, (RW_CONTAINER_ITEM*) sptr_new_attribute);					temp_attribute_value_index += new_attribute_value_length;					attribute_length -= new_attribute_value_length;					}				table_free (p_attribute);				}			}		if (p_attribute->type == RADIUS_MESSAGE_AUTHENTICATOR)			{			memset (&p_attribute->value[0], 0, HMAC_MD5_RESULT_LENGTH);			message_authenticator_exist = true;			}		rw_container_next (attribute_iterator);		}	if ((eap_message_exist == true) && (message_authenticator_exist == true))		return (false);	else if (eap_message_exist == true)		return (true);	else if (message_authenticator_exist == true)		{		radius_remove_attribute ((RADIUS_ATTRIBUTE_LIST_HANDLE) p_radius_attribute_list_controller, RADIUS_MESSAGE_AUTHENTICATOR);		return (false);		}	else		return (false);}#endif /* __EAP__ *//*************************************************************************//* radius encryption as defined in RADIUS RFC				 					 *//* Note: the data must be a multiple of 16 bytes.								 */static bool do_radius_md5_encryption (BYTE *cptr_identifier, USHORT identifier_length, BYTE *p_secret, USHORT secret_length,	BYTE *p_data, USHORT data_length){	BYTE md5_result[MD5_RESULT_LENGTH];	BYTE *bptr_md5_input;	ULONG md5_input_length;	USHORT xored_data_length;	BYTE * bptr_data;	USHORT md5_result_index;	ULONG temp_value;		if ((p_data == NULL) || (p_secret == NULL))		{		return (false);		}			if ((data_length % RADIUS_PASSWORD_MODULUS) != 0)		{		return (false);		}	md5_input_length = identifier_length + secret_length;	bptr_md5_input = (BYTE *) table_malloc (1, md5_input_length);		if (bptr_md5_input == NULL)		{		return (false);		}	memcpy (bptr_md5_input, p_secret, secret_length);	memcpy ((bptr_md5_input + secret_length), cptr_identifier, identifier_length);	MD_string (bptr_md5_input, md5_input_length, (BYTE *) &md5_result[0], MD5);		xored_data_length = data_length;	bptr_data = p_data;	md5_input_length = secret_length + MD5_RESULT_LENGTH;	while (xored_data_length > 0)		{		for (md5_result_index = 0;			(md5_result_index < MD5_RESULT_LENGTH) && (xored_data_length > 0);			--xored_data_length, ++md5_result_index, ++bptr_data)			{			temp_value = *bptr_data;			temp_value = temp_value ^ md5_result[md5_result_index];			*bptr_data = (BYTE) temp_value;			md5_result[md5_result_index] = *bptr_data;			}		if (xored_data_length > 0)			{			memcpy ((bptr_md5_input + secret_length), md5_result, MD5_RESULT_LENGTH);			MD_string (bptr_md5_input, md5_input_length, (BYTE *) &md5_result[0], MD5);			}		}			table_free (bptr_md5_input);		return (true);}/*************************************************************************//* radius decryption as defined in RADIUS RFC				 					 *//* Note: the data must be a multiple of 16 bytes.								 */static bool do_radius_md5_decryption (BYTE *cptr_identifier, USHORT identifier_length, BYTE *p_secret, USHORT secret_length,	BYTE *p_data, USHORT data_length){	BYTE md5_result[MD5_RESULT_LENGTH];	BYTE *bptr_md5_input;	ULONG md5_input_length;	USHORT xored_data_length;	BYTE * bptr_data;	USHORT md5_result_index;	ULONG temp_value;		if ((p_data == NULL) || (p_secret == NULL))		{		return (false);		}			if ((data_length % RADIUS_PASSWORD_MODULUS) != 0)		{		return (false);		}	md5_input_length = identifier_length + secret_length;	bptr_md5_input = (BYTE *) table_malloc (1, md5_input_length);		if (bptr_md5_input == NULL)		{		return (false);		}	memcpy (bptr_md5_input, p_secret, secret_length);	memcpy ((bptr_md5_input + secret_length), cptr_identifier, identifier_length);	MD_string (bptr_md5_input, md5_input_length, (BYTE *) &md5_result[0], MD5);		xored_data_length = data_length;	bptr_data = p_data;	md5_input_length = secret_length + MD5_RESULT_LENGTH;	while (xored_data_length > 0)		{		for (md5_result_index = 0;			(md5_result_index < MD5_RESULT_LENGTH) && (xored_data_length > 0);			--xored_data_length, ++md5_result_index, ++bptr_data)			{			temp_value = *bptr_data;			temp_value = temp_value ^ md5_result[md5_result_index];			md5_result[md5_result_index] = *bptr_data;			*bptr_data = (BYTE) temp_value;			}		if (xored_data_length > 0)			{			memcpy ((bptr_md5_input + secret_length), md5_result, MD5_RESULT_LENGTH);			MD_string (bptr_md5_input, md5_input_length, (BYTE *) &md5_result[0], MD5);			}		}			table_free (bptr_md5_input);		return (true);}/*************************************************************************/bool radius_accounting_fill_in_request_authenticator (RADIUS_PACKET* p_packet, UINT length, RADIUS_SERVER* p_server, BYTE *bptr_authenticator){	BYTE md5_result[MD5_RESULT_LENGTH];	BYTE *bptr_authentication_string;	UINT length_of_buffer_to_encrypt;		  	length_of_buffer_to_encrypt = length + p_server->secret_length;		bptr_authentication_string = table_malloc (1, length_of_buffer_to_encrypt);		if (bptr_authentication_string == NULL)		{		return (false);		}			memcpy (bptr_authentication_string, p_packet, length);	memcpy ((BYTE*) ((ULONG) bptr_authentication_string + length), p_server->bp_secret, p_server->secret_length);		MD_string (bptr_authentication_string, length_of_buffer_to_encrypt, (BYTE *)&md5_result[0], MD5); 		memcpy ((void *) ((ULONG) p_packet + RADIUS_OFFSET_OF_AUTHENTICATOR), &md5_result[0], RADIUS_SIZE_OF_AUTHENTICATOR);		memcpy ((void *) bptr_authenticator, &md5_result[0], RADIUS_SIZE_OF_AUTHENTICATOR);	table_free (bptr_authentication_string);		return (true);}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美日韩一区在线| 在线亚洲+欧美+日本专区| 中文字幕在线一区免费| 91福利小视频| 国产aⅴ精品一区二区三区色成熟| 亚洲精品成人精品456| 精品国产网站在线观看| 在线观看不卡一区| 国产在线国偷精品产拍免费yy| 亚洲精选视频在线| 久久蜜臀精品av| 欧美日韩高清不卡| 91在线国内视频| 韩国一区二区三区| 日本sm残虐另类| 亚洲国产婷婷综合在线精品| 国产精品理论在线观看| 亚洲精品在线免费观看视频| 欧美日韩激情一区| 色婷婷综合久久久久中文| 国产成人a级片| 激情综合色丁香一区二区| 亚洲大片免费看| 一区二区三区在线观看视频| 国产精品伦理一区二区| 久久蜜桃av一区精品变态类天堂 | 色八戒一区二区三区| 丁香六月综合激情| 婷婷综合五月天| 国产精品三级在线观看| 欧美电影在线免费观看| 成人免费高清在线| 麻豆国产欧美一区二区三区| 亚洲欧美一区二区三区极速播放| 欧美一区二区三级| 91麻豆国产福利精品| 精品亚洲aⅴ乱码一区二区三区| 专区另类欧美日韩| 久久亚洲春色中文字幕久久久| 91国模大尺度私拍在线视频| 国产v日产∨综合v精品视频| 日韩成人一级片| 亚洲视频一二三| **欧美大码日韩| 国产精品美女久久久久久久久久久 | 一区二区三区在线观看欧美| 最新日韩av在线| 国产欧美一区二区在线| 91麻豆精品国产| 色8久久人人97超碰香蕉987| 国产传媒久久文化传媒| 久草热8精品视频在线观看| 亚洲午夜电影在线| 亚洲视频免费观看| 国产欧美日韩亚州综合| 精品久久久久久久久久久久包黑料| 91精品国产欧美日韩| 欧美日韩在线精品一区二区三区激情| 91啦中文在线观看| 一本到不卡免费一区二区| heyzo一本久久综合| 成人午夜精品一区二区三区| 国产一区免费电影| 成人污视频在线观看| 国产精品一区二区男女羞羞无遮挡| 青青青爽久久午夜综合久久午夜 | 亚洲日本va午夜在线影院| 久久精品一区四区| 26uuu亚洲| 国产欧美日本一区二区三区| 久久美女艺术照精彩视频福利播放 | 亚洲狠狠爱一区二区三区| 亚洲一二三四在线| 亚洲精品久久7777| 亚洲一区影音先锋| 三级欧美韩日大片在线看| 亚洲综合成人网| 天天综合色天天| 青青草国产成人av片免费| 日韩中文字幕区一区有砖一区 | 丁香激情综合国产| 国产成人福利片| 97久久人人超碰| 欧美日韩国产一级片| 久久亚洲免费视频| 尤物在线观看一区| 国模无码大尺度一区二区三区| 国产一区二区在线视频| 国产精一区二区三区| av中文字幕一区| 欧美日韩综合色| 精品少妇一区二区三区免费观看| 久久久久久久网| 一本久久a久久精品亚洲| 欧美一区二区精品| 亚洲欧洲日产国码二区| 美女任你摸久久| 在线观看av一区| 国产午夜精品一区二区| 日韩精品国产精品| 91日韩精品一区| 国产片一区二区三区| 麻豆一区二区99久久久久| 欧洲国产伦久久久久久久| 精品一区二区三区影院在线午夜| 91美女片黄在线观看| 久久久五月婷婷| 日本女优在线视频一区二区| 91免费看视频| 国产嫩草影院久久久久| 麻豆91在线看| 欧美日韩国产另类一区| 综合久久国产九一剧情麻豆| 国产一区二区调教| 日韩一级免费观看| 午夜伊人狠狠久久| 一本大道av伊人久久综合| 国产精品久久三| 国产夫妻精品视频| 精品噜噜噜噜久久久久久久久试看 | 欧美日韩在线一区二区| 亚洲视频免费在线| av网站免费线看精品| 国产日本欧美一区二区| 国产伦精品一区二区三区免费 | 国产精品一区二区在线播放| 这里只有精品电影| 亚洲成人av中文| 欧美三级一区二区| 一区二区三区精密机械公司| 欧美日韩黄色一区二区| 一本到不卡精品视频在线观看| 国产精品亲子伦对白| 国产精品一线二线三线精华| 精品1区2区在线观看| 久久国产人妖系列| 精品国产乱码久久久久久久久| 天堂成人免费av电影一区| 91国产免费看| 一区二区在线观看免费视频播放| 波多野结衣在线一区| 欧美激情一区二区三区在线| 丁香天五香天堂综合| 国产精品污网站| 97久久人人超碰| 亚洲国产综合人成综合网站| 欧美狂野另类xxxxoooo| 日韩av中文字幕一区二区三区| 91精品国产品国语在线不卡| 久久成人免费网| 久久久久久久久久美女| 国产一区91精品张津瑜| 中文字幕不卡的av| 97成人超碰视| 午夜久久福利影院| 欧美一二三四区在线| 国产一区二区三区在线观看免费视频| 久久久久国产一区二区三区四区| 成人综合婷婷国产精品久久蜜臀| 国产精品传媒入口麻豆| 91久久一区二区| 日日夜夜精品视频免费| 精品国产自在久精品国产| 国产麻豆欧美日韩一区| 亚洲视频在线一区观看| 欧美日韩一区二区电影| 久久er99精品| 中文字幕亚洲一区二区av在线 | 一区二区三区中文字幕| 欧美日韩视频在线第一区 | 亚洲国产精品久久久久秋霞影院| 51精品秘密在线观看| 国产一区二区三区国产| 中文一区一区三区高中清不卡| 欧洲av在线精品| 黑人巨大精品欧美一区| 亚洲色图都市小说| 在线观看91av| 成人午夜视频在线观看| 婷婷成人激情在线网| 国产精品视频观看| 777奇米四色成人影色区| 国产黄色精品网站| 日韩中文字幕麻豆| 国产精品卡一卡二卡三| 69久久99精品久久久久婷婷| 成人激情开心网| 奇米777欧美一区二区| 亚洲欧洲精品一区二区三区不卡| 日韩欧美的一区二区| 99久久综合国产精品| 久久精品国产色蜜蜜麻豆| 亚洲视频网在线直播| 精品国产a毛片| 精品婷婷伊人一区三区三| 风间由美性色一区二区三区| 蜜臀精品久久久久久蜜臀| 亚洲黄色免费网站| 国产欧美日韩视频在线观看| 日韩欧美一区中文|