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

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

?? chap.c

?? FreeRtos Source code Version 4.04
?? C
?? 第 1 頁 / 共 2 頁
字號:
/*** WARNING - THIS HAS NEVER BEEN FINISHED ***//****************************************************************************** chap.c - Network Challenge Handshake Authentication Protocol program file.** Copyright (c) 2003 by Marc Boucher, Services Informatiques (MBSI) inc.* portions Copyright (c) 1997 by Global Election Systems Inc.** The authors hereby grant permission to use, copy, modify, distribute,* and license this software and its documentation for any purpose, provided* that existing copyright notices are retained in all copies and that this* notice and the following disclaimer are included verbatim in any * distributions. No written agreement, license, or royalty fee is required* for any of the authorized uses.** THIS SOFTWARE IS PROVIDED BY THE CONTRIBUTORS *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 CONTRIBUTORS 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.******************************************************************************** REVISION HISTORY** 03-01-01 Marc Boucher <marc@mbsi.ca>*   Ported to lwIP.* 97-12-04 Guy Lancaster <lancasterg@acm.org>, Global Election Systems Inc.*	Original based on BSD chap.c.*****************************************************************************//* * chap.c - Challenge Handshake Authentication Protocol. * * Copyright (c) 1993 The Australian National University. * All rights reserved. * * Redistribution and use in source and binary forms are permitted * provided that the above copyright notice and this paragraph are * duplicated in all such forms and that any documentation, * advertising materials, and other materials related to such * distribution and use acknowledge that the software was developed * by the Australian National University.  The name of the University * may not be used to endorse or promote products derived from this * software without specific prior written permission. * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. * * Copyright (c) 1991 Gregory M. Christy. * All rights reserved. * * Redistribution and use in source and binary forms are permitted * provided that the above copyright notice and this paragraph are * duplicated in all such forms and that any documentation, * advertising materials, and other materials related to such * distribution and use acknowledge that the software was developed * by Gregory M. Christy.  The name of the author may not be used to * endorse or promote products derived from this software without * specific prior written permission. * * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. */#include "ppp.h"#if PPP_SUPPORT > 0#include "magic.h"#if CHAP_SUPPORT > 0#include "randm.h"#include "auth.h"#include "md5.h"#include "chap.h"#include "chpms.h"#include "pppdebug.h"/*************************//*** LOCAL DEFINITIONS ***//*************************//************************//*** LOCAL DATA TYPES ***//************************//***********************************//*** LOCAL FUNCTION DECLARATIONS ***//***********************************//* * Protocol entry points. */static void ChapInit (int);static void ChapLowerUp (int);static void ChapLowerDown (int);static void ChapInput (int, u_char *, int);static void ChapProtocolReject (int);static int  ChapPrintPkt (u_char *, int,			      void (*) (void *, char *, ...), void *);static void ChapChallengeTimeout (void *);static void ChapResponseTimeout (void *);static void ChapReceiveChallenge (chap_state *, u_char *, int, int);static void ChapRechallenge (void *);static void ChapReceiveResponse (chap_state *, u_char *, int, int);static void ChapReceiveSuccess(chap_state *cstate, u_char *inp, u_char id, int len);static void ChapReceiveFailure(chap_state *cstate, u_char *inp, u_char id, int len);static void ChapSendStatus (chap_state *, int);static void ChapSendChallenge (chap_state *);static void ChapSendResponse (chap_state *);static void ChapGenChallenge (chap_state *);/******************************//*** PUBLIC DATA STRUCTURES ***//******************************/chap_state chap[NUM_PPP];		/* CHAP state; one for each unit */struct protent chap_protent = {    PPP_CHAP,    ChapInit,    ChapInput,    ChapProtocolReject,    ChapLowerUp,    ChapLowerDown,    NULL,    NULL,#if 0    ChapPrintPkt,    NULL,#endif    1,    "CHAP",#if 0    NULL,    NULL,    NULL#endif};/*****************************//*** LOCAL DATA STRUCTURES ***//*****************************/static char *ChapCodenames[] = {	"Challenge", "Response", "Success", "Failure"};/***********************************//*** PUBLIC FUNCTION DEFINITIONS ***//***********************************//* * ChapAuthWithPeer - Authenticate us with our peer (start client). * */void ChapAuthWithPeer(int unit, char *our_name, int digest){	chap_state *cstate = &chap[unit];		cstate->resp_name = our_name;	cstate->resp_type = digest;		if (cstate->clientstate == CHAPCS_INITIAL ||			cstate->clientstate == CHAPCS_PENDING) {		/* lower layer isn't up - wait until later */		cstate->clientstate = CHAPCS_PENDING;		return;	}		/*	 * We get here as a result of LCP coming up.	 * So even if CHAP was open before, we will 	 * have to re-authenticate ourselves.	 */	cstate->clientstate = CHAPCS_LISTEN;}/* * ChapAuthPeer - Authenticate our peer (start server). */void ChapAuthPeer(int unit, char *our_name, int digest){	chap_state *cstate = &chap[unit];		cstate->chal_name = our_name;	cstate->chal_type = digest;		if (cstate->serverstate == CHAPSS_INITIAL ||			cstate->serverstate == CHAPSS_PENDING) {		/* lower layer isn't up - wait until later */		cstate->serverstate = CHAPSS_PENDING;		return;	}		ChapGenChallenge(cstate);	ChapSendChallenge(cstate);		/* crank it up dude! */	cstate->serverstate = CHAPSS_INITIAL_CHAL;}/**********************************//*** LOCAL FUNCTION DEFINITIONS ***//**********************************//* * ChapInit - Initialize a CHAP unit. */static void ChapInit(int unit){	chap_state *cstate = &chap[unit];		BZERO(cstate, sizeof(*cstate));	cstate->unit = unit;	cstate->clientstate = CHAPCS_INITIAL;	cstate->serverstate = CHAPSS_INITIAL;	cstate->timeouttime = CHAP_DEFTIMEOUT;	cstate->max_transmits = CHAP_DEFTRANSMITS;	/* random number generator is initialized in magic_init */}/* * ChapChallengeTimeout - Timeout expired on sending challenge. */static void ChapChallengeTimeout(void *arg){	chap_state *cstate = (chap_state *) arg;		/* if we aren't sending challenges, don't worry.  then again we */	/* probably shouldn't be here either */	if (cstate->serverstate != CHAPSS_INITIAL_CHAL &&			cstate->serverstate != CHAPSS_RECHALLENGE)		return;		if (cstate->chal_transmits >= cstate->max_transmits) {		/* give up on peer */		CHAPDEBUG((LOG_ERR, "Peer failed to respond to CHAP challenge\n"));		cstate->serverstate = CHAPSS_BADAUTH;		auth_peer_fail(cstate->unit, PPP_CHAP);		return;	}		ChapSendChallenge(cstate);		/* Re-send challenge */}/* * ChapResponseTimeout - Timeout expired on sending response. */static void ChapResponseTimeout(void *arg){	chap_state *cstate = (chap_state *) arg;		/* if we aren't sending a response, don't worry. */	if (cstate->clientstate != CHAPCS_RESPONSE)		return;		ChapSendResponse(cstate);		/* re-send response */}/* * ChapRechallenge - Time to challenge the peer again. */static void ChapRechallenge(void *arg){	chap_state *cstate = (chap_state *) arg;		/* if we aren't sending a response, don't worry. */	if (cstate->serverstate != CHAPSS_OPEN)		return;		ChapGenChallenge(cstate);	ChapSendChallenge(cstate);	cstate->serverstate = CHAPSS_RECHALLENGE;}/* * ChapLowerUp - The lower layer is up. * * Start up if we have pending requests. */static void ChapLowerUp(int unit){	chap_state *cstate = &chap[unit];		if (cstate->clientstate == CHAPCS_INITIAL)		cstate->clientstate = CHAPCS_CLOSED;	else if (cstate->clientstate == CHAPCS_PENDING)		cstate->clientstate = CHAPCS_LISTEN;		if (cstate->serverstate == CHAPSS_INITIAL)		cstate->serverstate = CHAPSS_CLOSED;	else if (cstate->serverstate == CHAPSS_PENDING) {		ChapGenChallenge(cstate);		ChapSendChallenge(cstate);		cstate->serverstate = CHAPSS_INITIAL_CHAL;	}}/* * ChapLowerDown - The lower layer is down. * * Cancel all timeouts. */static void ChapLowerDown(int unit){	chap_state *cstate = &chap[unit];		/* Timeout(s) pending?  Cancel if so. */	if (cstate->serverstate == CHAPSS_INITIAL_CHAL ||			cstate->serverstate == CHAPSS_RECHALLENGE)		UNTIMEOUT(ChapChallengeTimeout, cstate);	else if (cstate->serverstate == CHAPSS_OPEN			&& cstate->chal_interval != 0)		UNTIMEOUT(ChapRechallenge, cstate);	if (cstate->clientstate == CHAPCS_RESPONSE)		UNTIMEOUT(ChapResponseTimeout, cstate);		cstate->clientstate = CHAPCS_INITIAL;	cstate->serverstate = CHAPSS_INITIAL;}/* * ChapProtocolReject - Peer doesn't grok CHAP. */static void ChapProtocolReject(int unit){	chap_state *cstate = &chap[unit];		if (cstate->serverstate != CHAPSS_INITIAL &&			cstate->serverstate != CHAPSS_CLOSED)		auth_peer_fail(unit, PPP_CHAP);	if (cstate->clientstate != CHAPCS_INITIAL &&			cstate->clientstate != CHAPCS_CLOSED)		auth_withpeer_fail(unit, PPP_CHAP);	ChapLowerDown(unit);		/* shutdown chap */}/* * ChapInput - Input CHAP packet. */static void ChapInput(int unit, u_char *inpacket, int packet_len){	chap_state *cstate = &chap[unit];	u_char *inp;	u_char code, id;	int len;		/*	 * Parse header (code, id and length).	 * If packet too short, drop it.	 */	inp = inpacket;	if (packet_len < CHAP_HEADERLEN) {		CHAPDEBUG((LOG_INFO, "ChapInput: rcvd short header.\n"));		return;	}	GETCHAR(code, inp);	GETCHAR(id, inp);	GETSHORT(len, inp);	if (len < CHAP_HEADERLEN) {		CHAPDEBUG((LOG_INFO, "ChapInput: rcvd illegal length.\n"));		return;	}	if (len > packet_len) {		CHAPDEBUG((LOG_INFO, "ChapInput: rcvd short packet.\n"));		return;	}	len -= CHAP_HEADERLEN;		/*	 * Action depends on code (as in fact it usually does :-).	 */	switch (code) {	case CHAP_CHALLENGE:		ChapReceiveChallenge(cstate, inp, id, len);		break;		case CHAP_RESPONSE:		ChapReceiveResponse(cstate, inp, id, len);		break;		case CHAP_FAILURE:		ChapReceiveFailure(cstate, inp, id, len);		break;		case CHAP_SUCCESS:		ChapReceiveSuccess(cstate, inp, id, len);		break;		default:				/* Need code reject? */		CHAPDEBUG((LOG_WARNING, "Unknown CHAP code (%d) received.\n", code));		break;	}}/* * ChapReceiveChallenge - Receive Challenge and send Response. */static void ChapReceiveChallenge(chap_state *cstate, u_char *inp, int id, int len){	int rchallenge_len;	u_char *rchallenge;	int secret_len;	char secret[MAXSECRETLEN];	char rhostname[256];	MD5_CTX mdContext;	u_char hash[MD5_SIGNATURE_SIZE];		CHAPDEBUG((LOG_INFO, "ChapReceiveChallenge: Rcvd id %d.\n", id));	if (cstate->clientstate == CHAPCS_CLOSED ||		cstate->clientstate == CHAPCS_PENDING) {		CHAPDEBUG((LOG_INFO, "ChapReceiveChallenge: in state %d\n",			   cstate->clientstate));		return;	}		if (len < 2) {		CHAPDEBUG((LOG_INFO, "ChapReceiveChallenge: rcvd short packet.\n"));		return;

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
精品国产一区久久| 精品伊人久久久久7777人| 丝袜诱惑亚洲看片| 国产xxx精品视频大全| 欧美色倩网站大全免费| 久久久久久一级片| 日韩在线一区二区| 91污在线观看| 国产精品色噜噜| 看电视剧不卡顿的网站| 欧美午夜精品一区| 中文字幕一区不卡| 国产xxx精品视频大全| 日韩一级二级三级精品视频| 尤物在线观看一区| aaa亚洲精品一二三区| 国产日韩欧美不卡在线| 久久国产精品第一页| 欧美丰满一区二区免费视频| 亚洲日本中文字幕区| 成人免费高清视频| 国产欧美精品一区二区色综合 | 亚洲精品一线二线三线| 午夜精品久久久久久久久久| 一本色道综合亚洲| 亚洲男人电影天堂| 99re热视频这里只精品| 国产精品国产三级国产aⅴ入口| 国产在线不卡视频| 久久先锋资源网| 国内精品视频666| 2023国产一二三区日本精品2022| 免费av网站大全久久| 2020国产精品| 麻豆成人av在线| 欧美成人乱码一区二区三区| 美女尤物国产一区| 欧美草草影院在线视频| 国内成人免费视频| 国产欧美一区二区三区在线看蜜臀| 国产在线精品免费| 国产精品美女视频| 91电影在线观看| 亚洲成人激情社区| 日韩欧美资源站| 国产精品一区二区在线看| 久久久久久麻豆| 不卡视频免费播放| 亚洲福利一区二区三区| 欧美一区二区在线视频| 久久精品99国产精品日本| 国产亚洲午夜高清国产拍精品 | 亚洲精品日韩一| 欧洲亚洲国产日韩| 蜜桃精品视频在线| 亚洲国产精品传媒在线观看| 91视视频在线观看入口直接观看www | 日韩精品一区在线| 另类欧美日韩国产在线| 久久嫩草精品久久久精品一| 久久se精品一区二区| 久久精品视频一区二区三区| 91猫先生在线| 蜜桃免费网站一区二区三区 | 欧美日韩国产精选| 国产一区啦啦啦在线观看| 国产精品国产馆在线真实露脸| 色噜噜久久综合| 美日韩一级片在线观看| 国产精品久久久久三级| 欧美喷潮久久久xxxxx| 国产经典欧美精品| 亚洲国产cao| 中文在线一区二区| 欧美人狂配大交3d怪物一区| 国产丶欧美丶日本不卡视频| 亚洲综合一区二区精品导航| 久久亚洲免费视频| 欧美精品粉嫩高潮一区二区| 国产99久久久国产精品潘金| 亚洲成人免费在线| 欧美激情在线一区二区三区| 91精品国产综合久久精品图片| 成人一区二区三区视频| 日本特黄久久久高潮| 亚洲三级免费观看| 国产日韩精品视频一区| 91精品国产91久久久久久一区二区| 丁香一区二区三区| 久久99蜜桃精品| 亚洲成av人影院在线观看网| 亚洲欧美一区二区视频| 久久先锋资源网| 欧美一区二区三区视频免费播放| 99久久精品免费精品国产| 国产在线精品一区二区三区不卡| 亚洲 欧美综合在线网络| 中文字幕一区二区三中文字幕| 精品国产区一区| 日韩欧美自拍偷拍| 欧美一区二区精品| 欧美日韩高清一区二区不卡| 日本电影亚洲天堂一区| 91女人视频在线观看| 成人一道本在线| 成人性色生活片免费看爆迷你毛片| 国内偷窥港台综合视频在线播放| 日本最新不卡在线| 日韩黄色片在线观看| 亚洲成人高清在线| 亚洲成人动漫在线免费观看| 亚洲电影一区二区| 美女精品自拍一二三四| 久久成人久久鬼色| 久久精品久久久精品美女| 久久激情五月婷婷| 精品中文av资源站在线观看| 久久狠狠亚洲综合| 美脚の诱脚舐め脚责91 | 国产高清精品久久久久| 国内欧美视频一区二区| 国产精品综合在线视频| 国产成人精品一区二区三区四区 | 欧美一区二区三区人| 欧美一级精品大片| 欧美成人乱码一区二区三区| 精品国产一二三| 久久综合av免费| 国产喂奶挤奶一区二区三区| 欧美激情综合在线| 亚洲欧洲色图综合| 亚洲国产精品久久久久秋霞影院| 天堂一区二区在线| 久久99在线观看| av成人免费在线| 欧美色综合天天久久综合精品| 欧美高清www午色夜在线视频| 日韩三级视频在线看| 国产婷婷一区二区| 亚洲欧洲综合另类在线| 丝瓜av网站精品一区二区| 九色|91porny| 99精品视频中文字幕| 欧美高清视频不卡网| 久久精品一二三| 一区二区三区美女视频| 日本vs亚洲vs韩国一区三区| 国产高清不卡一区二区| 欧美亚洲综合久久| 久久精品人人做| 亚洲一区二区三区在线看| 精品综合免费视频观看| 99re6这里只有精品视频在线观看| 欧美群妇大交群中文字幕| 久久综合av免费| 亚洲午夜在线观看视频在线| 激情六月婷婷久久| 色美美综合视频| 亚洲人吸女人奶水| 免费不卡在线观看| 91麻豆视频网站| 久久精品欧美一区二区三区不卡| 亚洲国产裸拍裸体视频在线观看乱了 | 亚洲成av人**亚洲成av**| 激情五月播播久久久精品| 91影院在线观看| 久久综合色之久久综合| 亚洲国产一区二区视频| 大胆亚洲人体视频| 欧美大片国产精品| 亚洲一区二区三区中文字幕 | 日韩欧美中文一区二区| 自拍偷拍亚洲欧美日韩| 韩国v欧美v日本v亚洲v| 欧美精选在线播放| 亚洲人一二三区| 国产成人超碰人人澡人人澡| 91精品国产欧美一区二区18| 综合久久国产九一剧情麻豆| 国产精品一区二区黑丝| 日韩一区二区三区av| 亚洲国产视频直播| 91视频你懂的| 日韩理论片在线| proumb性欧美在线观看| 久久久蜜桃精品| 极品少妇xxxx偷拍精品少妇| 欧美一区二区不卡视频| 午夜电影久久久| 欧美优质美女网站| 一区二区三区四区中文字幕| av电影在线观看一区| 国产精品不卡一区| 国产.欧美.日韩| 国产亚洲综合在线| 国产成人日日夜夜| 国产欧美久久久精品影院| 国产精品1区二区.| 国产视频一区二区在线| 丁香激情综合国产|