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

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

?? htaabrow.c

?? www工具包. 這是W3C官方支持的www支撐庫. 其中提供通用目的的客戶端的WebAPI: complete HTTP/1.1 (with caching, pipelining, PUT, POS
?? C
?? 第 1 頁 / 共 3 頁
字號:
PRIVATE BOOL digest_credentials (HTRequest * request, HTDigest * digest){    if (request && digest && digest->realm)    {        char * realm = (char *) digest->realm;	char * uri;	char * method = (char *) HTMethod_name (HTRequest_method (request));	char * cleartext = NULL;	char nc[9];	HASHHEX HA1;        HASHHEX HA2;	HASHHEX response;	/* @@ maybe optimize all my reallocs by preallocating the memory */	if (digest->proxy)	    uri = HTRequest_proxy(request);	else {	     char * tmp;	     /* we get the absolute URL */	     tmp = HTAnchor_address( (HTAnchor*)HTRequest_anchor(request));	     /* and then remove what makes it absolute, to be backwards		compatible */	     uri = HTParse (tmp, "", PARSE_PATH | PARSE_PUNCTUATION);	     HT_FREE(tmp);	}	/* increment the nonce counter */	digest->nc++;	sprintf (nc, "%08lx", digest->nc);	add_param (&cleartext, "username", digest->uid, YES);	add_param (&cleartext, "realm", realm, YES);	add_param (&cleartext, "nonce", digest->nonce, YES);	add_param (&cleartext, "uri", uri, YES);	/* @@@  no support for auth-int yet */	if (digest->qop) {	    add_param (&cleartext, "qop", "auth", NO);	    add_param (&cleartext, "nc", nc, NO);	    add_param (&cleartext, "cnonce", digest->cnonce, YES);	}	/* compute the response digest */	/* @@@ md5 hard coded, change it to something from the answer, 	   md5-sess, etc */	DigestCalcHA1 (digest->algorithm, "md5", digest->uid, realm, digest->pw, digest->nonce,		       digest->cnonce, HA1);	DigestCalcResponse (digest->algorithm, HA1, digest->nonce, nc, digest->cnonce,			    digest->qop, method, uri, HA2, response);	add_param (&cleartext, "response", response, NO);	add_param (&cleartext, "opaque", digest->opaque, NO);	/* Create the credentials and assign them to the request object */	{ 	    int cr_len = strlen ("Digest") + strlen (cleartext) + 3;	    char * cookie = (char *) HT_MALLOC(cr_len+1);	    if (!cookie) HT_OUTOFMEM("digest_credentials");	    strcpy(cookie, "Digest ");	    strcat (cookie, cleartext);	    HTTRACE(AUTH_TRACE, "Digest Cookie `%s\'\n" _ cookie);	    /* Check whether it is proxy or normal credentials */	    if (digest->proxy)		HTRequest_addCredentials(request, "Proxy-Authorization",					 cookie);	    else		HTRequest_addCredentials(request, "Authorization", cookie);	    HT_FREE(cookie);	}	if (!digest->proxy)	  HT_FREE(uri);	HT_FREE(cleartext);	return HT_OK;    }    return HT_ERROR;}/*	HTDigest_generate**	----------------**	This function generates "digest" credentials for the challenge found in**	the authentication information base for this request. The result is**	stored as an association list in the request object.**	This is a callback function for the AA handler.*/PUBLIC int HTDigest_generate (HTRequest * request, void * context, int mode){     HTDigest * digest = (HTDigest *) context;    BOOL proxy = mode==HT_NO_PROXY_ACCESS ? YES : NO;    if (request) {	const char * realm = HTRequest_realm(request);	/*	**  If we were asked to explicitly ask the user again	*/	if (mode == HT_REAUTH || mode == HT_PROXY_REAUTH)	    digest->retry = YES;	/*	** If we don't have a digest context then add a new one to the tree.	** We use different trees for normal and proxy authentication	*/	if (!digest) {	    digest = HTDigest_new();	    if (proxy) {		char * url = HTRequest_proxy(request);		digest->proxy = YES;		HTAA_updateNode(proxy, DIGEST_AUTH, realm, url, digest);	    } else {		char * url = HTAnchor_address((HTAnchor*)HTRequest_anchor(request));		HTAA_updateNode(proxy, DIGEST_AUTH, realm, url, digest);		HT_FREE(url);	    }	}	/*	** If we have a set of credentials (or the user provides a new set)	** then store it in the request object as the credentials	*/	if ((digest->retry && 	     prompt_digest_user(request, realm, digest) == HT_OK) ||	    (!digest->retry && digest->uid)) {	/* @@@ here we should generate a new cnonce value */	    HTSACopy (&(digest->cnonce), "012345678");	    digest->retry = NO;	    return digest_credentials(request, digest);	} else {	    char * url = HTAnchor_address((HTAnchor*)HTRequest_anchor(request));	    if (proxy)		HTAA_deleteNode(proxy, DIGEST_AUTH, realm, url);	    else		HTAA_deleteNode(proxy, DIGEST_AUTH, realm, url);	    HT_FREE(url);	    return HT_ERROR;	}    }    return HT_OK;}/***	Evaluates the existing authentication info (nonce, uid, pwd) and**      returns TRUE if we evaluate that the nonce is stale, FALSE**      otherwise.*/PRIVATE BOOL nonce_is_stale (HTRequest *request, HTDigest * digest, char * old_nonce){  if (!digest->uid || !digest->pw)      return FALSE;  if (!digest->nonce || !old_nonce)     return FALSE;  if (strcmp (digest->nonce, old_nonce))     return TRUE;  /* because of a pipelining implementation bug, we don't send any good     credentials on requests following the first one in the pipeline  */  if (!HTRequest_credentials (request) && HTRequest_AAretrys (request) == 1)     return TRUE;    return FALSE;}/*	HTDigest_parse**	-------------**	This function parses the contents of a "digest" challenge **	and stores the challenge in our authentication information datebase.**	We also store the realm in the request object which will help finding**	the right set of credentials to generate.**	The function is a callback function for the AA handler.*/PUBLIC int HTDigest_parse (HTRequest * request, HTResponse * response,			   void * context, int status){    HTAssocList * challenge = HTResponse_challenge(response);    HTDigest * digest = NULL;        BOOL proxy = status==HT_NO_PROXY_ACCESS ? YES : NO;    if (request && challenge) {	char * p = HTAssocList_findObject(challenge, DIGEST_AUTH);	char * realm =  HTNextField(&p);	char * rm    =  HTNextField(&p);	char * value = NULL;	char * token = NULL;	char * uris = NULL;	/* the value of the previous nonce in case the server has changed its	   challenge */	char * old_nonce = NULL;	/*	** If valid challenge then make a template for the resource and	** store this information in our authentication URL Tree	*/	if (realm && !strcasecomp(realm, "realm") && rm) {	    HTTRACE(AUTH_TRACE, "Digest Parse. Realm `%s\' found\n" _ rm);	    HTRequest_setRealm(request, rm);	    /*	    **  If we are in proxy mode then add the proxy - not the final URL	    */	    if (proxy) {		char * url = HTRequest_proxy(request);		HTTRACE(AUTH_TRACE, "Digest Parse. Proxy authentication\n");		digest = (HTDigest *) HTAA_updateNode(proxy, DIGEST_AUTH, rm,						      url, NULL);		/* if the previous authentication failed, then try again */		if (HTRequest_AAretrys (request) > 1 		    && status == HT_NO_ACCESS && digest)		  digest->retry = YES;	    } else {		char * url = HTAnchor_address((HTAnchor *)					      HTRequest_anchor(request));		char * tmplate = make_template(url);		digest = (HTDigest *) HTAA_updateNode(proxy, DIGEST_AUTH, rm,						      tmplate, NULL);		/* if the previous authentication failed, then try again */		if (HTRequest_AAretrys (request) > 1 		    && status == HT_NO_ACCESS && digest)		  digest->retry = YES;		HT_FREE(tmplate);		HT_FREE(url);	    }	} else {	    HTTRACE(AUTH_TRACE, "Digest Parse. Missing or incomplete realm\n");	    return HT_ERROR;	}	/* if we get here it's because there's no digest */	/* we parse the digest parameters from the challenge */	if (digest) {	    /* it's an old digest, so we clean all in it except for the	       uid and the password, hoping that the server send back	       that data */	    old_nonce = digest->nonce;	    digest->nonce = NULL;	    HTDigest_reset (digest);	} else {	    /* it's a brand new digest */	    digest = HTDigest_new();	    StrAllocCopy (digest->realm, rm);	}	/*	**  Search through the set of parameters in the digest header.	**  If valid challenge then make a template for the resource and	**  store this information in our authentication URL Tree	*/	while ((token = HTNextField(&p))) {	    if (!strcasecomp(token, "domain")) {		if ((value = HTNextField(&p)))		    uris = value;	    } else if (!strcasecomp(token, "nonce")) {		if ((value = HTNextField(&p)))		    StrAllocCopy(digest->nonce, value);	    } else if (!strcasecomp(token, "opaque")) {		if ((value = HTNextField(&p)))		    StrAllocCopy(digest->opaque, value);	    } else if (!strcasecomp(token, "qop")) {		/* split the qop */		if ((value = HTNextField(&p)))		    StrAllocCopy(digest->qop, value);	    } else if (!strcasecomp(token, "stale")) {		if ((value = HTNextField(&p)) && !strcasecomp(value, "true")) {		    /* only true if we already had a digest with uid and pw info */		    if (digest->uid && digest->pw) {			digest->stale = YES;				    }		}	    } else if (!strcasecomp(token, "algorithm")) {		if ((value = HTNextField(&p)) && strcasecomp(value, "md5")) {		    /*		    **  We only support MD5 for the moment		    */		    HTTRACE(AUTH_TRACE, "Digest Parse Unknown algorithm `%s\'\n" _ value);		    HTDigest_delete(digest);		    if (old_nonce)		      HT_FREE (old_nonce);		    return HT_ERROR;		} else		    digest->algorithm = HTDaMD5;	    }	}	/* Pipelining support. If a nonce becomes stale When sending 	** several requests thru the pipeline, we may miss the stale	** reply in the server's answer. To avoid this, we keep a copy	** of the nonce in each request. If the nonce wasn't explicitly	** marked stale and if it's the same that we sent, then we 	** consider that the uid/pwd pairs were false. Otherwise, we	** assume the stole went stale before 	*/	if (!digest->stale && nonce_is_stale (request, digest, old_nonce))	    digest->stale = YES;	if (old_nonce)	  HT_FREE (old_nonce);	if (digest->stale) {	    digest->stale = NO;	    digest->retry = NO;	    return HT_OK;	}	else if (digest->uid || digest->pw) {	    /*	    ** For some reason there was no stale nonce header and the	    ** authentication failed so we have to ask the user if we should	    ** try again. It may be because the user typed the wrong user name	    ** and password	    */	    HTAlertCallback * prompt = HTAlert_find(HT_A_CONFIRM);	    /*	    ** Do we have a method registered for prompting the user whether	    ** we should retry	    */	    if (prompt) {		int code = proxy ?		    HT_MSG_RETRY_PROXY_AUTH : HT_MSG_RETRY_AUTHENTICATION;		if ((*prompt)(request, HT_A_CONFIRM, code,			      NULL, NULL, NULL) != YES)		    return HT_ERROR;		return HT_OK;	    }	    return HT_ERROR;	}	/*	** It's the first time we go this way, so we check the domain field to 	** create the digest node entries for each URI.	*/	if (!uris) {	    if (proxy) {		/* we ignore the domain */		char * location = HTRequest_proxy(request);		HTTRACE(AUTH_TRACE, "Digest Parse Proxy authentication\n");		HTAA_updateNode(proxy, DIGEST_AUTH, rm, location, digest);	    } else {		char * url = HTAnchor_address((HTAnchor *) HTRequest_anchor(request));		char * tmplate = make_template(url);		HTAA_updateNode(proxy, DIGEST_AUTH, rm, tmplate, digest);		HT_FREE(url);		HT_FREE(tmplate);	    }	} else {	    char * base_url =		HTAnchor_address((HTAnchor *) HTRequest_anchor(request));	    char * domain_url;	    char * full_url;	    while ((domain_url = HTNextField (&uris))) {		/* complete the URL if it's an absolute one */		full_url = HTParse (domain_url, base_url, PARSE_ALL);		digest->references++;		if (proxy) {		    HTTRACE(AUTH_TRACE, "Digest Parse Proxy authentication\n");		    HTAA_updateNode(proxy, DIGEST_AUTH, rm, full_url, digest);		} else {		    char * tmplate = make_template(full_url);		    HTAA_updateNode (proxy, DIGEST_AUTH, rm, tmplate, digest);		    HT_FREE (tmplate);		}		HT_FREE (full_url);	    }	    HT_FREE (base_url);	}	return HT_OK;    }	    HTTRACE(AUTH_TRACE, "Auth........ No challenges found\n");    return HT_ERROR;}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲欧美怡红院| 免费美女久久99| 亚洲色欲色欲www| 日韩美女久久久| 日韩一级成人av| 国产欧美精品一区aⅴ影院 | 日韩美女视频19| 亚洲欧美日韩系列| 日本91福利区| 99精品在线免费| 欧美伊人精品成人久久综合97| 欧美电影在线免费观看| 日韩欧美国产电影| 国产精品高潮久久久久无| 一区二区三区资源| 狠狠色狠狠色综合日日91app| 99r精品视频| 91精品中文字幕一区二区三区| 久久九九国产精品| 成人av在线一区二区三区| 欧美影院一区二区| 国产欧美精品一区aⅴ影院| 亚洲夂夂婷婷色拍ww47| 国产91丝袜在线播放九色| 精品视频在线看| 最新国产精品久久精品| 六月婷婷色综合| 欧美在线观看你懂的| 欧美高清在线一区| 国产一区在线看| 日韩情涩欧美日韩视频| 日日摸夜夜添夜夜添精品视频| 国产成人免费视频网站高清观看视频| 欧美日韩视频一区二区| 亚洲国产你懂的| 欧亚洲嫩模精品一区三区| 亚洲欧美日韩系列| 不卡的av网站| 亚洲色图欧美激情| 91无套直看片红桃| 亚洲麻豆国产自偷在线| 成人av免费在线| 亚洲欧美日韩一区| 欧美性色黄大片手机版| 亚洲黄色片在线观看| 色菇凉天天综合网| 一级女性全黄久久生活片免费| 国产成人精品免费在线| 亚洲一区二区美女| 欧美日韩免费视频| 久久精品噜噜噜成人av农村| 欧美α欧美αv大片| 国产精品一二三四区| 国产精品久久久久久久久快鸭| 国产不卡免费视频| 亚洲一区av在线| 日韩欧美国产高清| 91免费国产在线| 午夜精品久久久久久久99水蜜桃| 日韩欧美中文字幕制服| 国产福利精品一区| 亚洲第一久久影院| 欧美精品一区二区久久久| 91免费视频观看| 国产露脸91国语对白| 亚洲人成人一区二区在线观看| 91精品国产高清一区二区三区 | 一本色道亚洲精品aⅴ| 久久99热这里只有精品| 亚洲高清免费观看| 国产精品电影一区二区| 精品国产一区二区精华| 91高清视频免费看| a级精品国产片在线观看| 乱中年女人伦av一区二区| 亚洲影院免费观看| 亚洲啪啪综合av一区二区三区| 久久看人人爽人人| 欧美一级二级三级蜜桃| 欧美性猛交xxxx乱大交退制版 | 日韩欧美二区三区| 欧美日韩一级黄| 欧美日韩中字一区| 欧美午夜精品理论片a级按摩| 国产99精品视频| 成人av网站在线观看| 国产成a人亚洲精| 播五月开心婷婷综合| 99re在线视频这里只有精品| 国产99精品在线观看| 成人高清在线视频| 一本色道综合亚洲| 欧美最新大片在线看| 69久久99精品久久久久婷婷| 欧美精品在线观看一区二区| 精品视频在线免费观看| 91精品欧美综合在线观看最新 | 亚洲欧美国产高清| 亚洲乱码国产乱码精品精小说 | www.日韩精品| 91久久奴性调教| 日韩欧美国产1| 国产精品成人免费在线| 亚洲免费看黄网站| 麻豆成人综合网| 91香蕉视频污| 久久综合色8888| 夜夜嗨av一区二区三区| 美国精品在线观看| 色综合网色综合| 久久久久久免费网| 奇米影视7777精品一区二区| 成人av在线看| 日韩精品最新网址| 三级不卡在线观看| 91女人视频在线观看| 久久先锋影音av鲁色资源网| 亚洲第一av色| 99久久777色| 中文字幕一区二区5566日韩| 蜜桃视频第一区免费观看| 欧美三区在线视频| 亚洲精选一二三| 北岛玲一区二区三区四区| 久久久久久夜精品精品免费| 午夜精品久久久久久久久| 欧美自拍偷拍一区| 亚洲欧美日韩中文播放 | 这里只有精品视频在线观看| 中文字幕在线观看一区| 成人网男人的天堂| 欧美激情在线观看视频免费| 国产激情91久久精品导航 | 日韩精品亚洲一区| 日韩亚洲欧美高清| 国产真实乱子伦精品视频| 精品免费一区二区三区| 九一久久久久久| 中文字幕二三区不卡| 色综合天天性综合| 亚洲一区欧美一区| 精品88久久久久88久久久| 国产一区二区三区久久久| 欧美—级在线免费片| 91日韩一区二区三区| 视频精品一区二区| 国产三区在线成人av| 欧美在线视频你懂得| 青椒成人免费视频| 亚洲色图欧洲色图婷婷| 日韩视频免费观看高清完整版在线观看| 青青草原综合久久大伊人精品优势 | 韩国一区二区三区| 亚洲三级在线看| 日韩一区二区免费在线电影| 不卡大黄网站免费看| 午夜精品影院在线观看| 久久久美女毛片| 欧美午夜精品免费| 国产精品18久久久久久久久| 亚洲精品第1页| 久久精品人人做人人综合| 精品污污网站免费看| 成人精品免费看| 国精品**一区二区三区在线蜜桃 | 国产一区二区三区在线看麻豆| 亚洲国产精品成人综合| 日韩一区二区麻豆国产| 色拍拍在线精品视频8848| 粉嫩13p一区二区三区| 日本少妇一区二区| 亚洲 欧美综合在线网络| 中文字幕一区二区三区av | 首页国产欧美久久| 亚洲国产日韩综合久久精品| 日韩理论片中文av| 成人免费在线播放视频| 日本一区二区不卡视频| 欧美精品一区二区在线观看| 日韩精品一区二区三区中文不卡| 欧美视频自拍偷拍| 欧美日韩一区二区三区四区| 在线精品视频小说1| 欧美日精品一区视频| 欧美性视频一区二区三区| 欧美日韩成人高清| 日韩西西人体444www| 精品久久一区二区三区| 国产亚洲一区字幕| 亚洲愉拍自拍另类高清精品| 亚洲精品大片www| 久久精品国产免费| a在线欧美一区| 欧美一区中文字幕| 久久久久国产成人精品亚洲午夜| 国产精品久久久一区麻豆最新章节| 国产精品成人免费| 另类小说色综合网站| 成人av网站大全| 日韩免费视频一区二区|