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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? htaabrow.c

?? www工具包. 這是W3C官方支持的www支撐庫. 其中提供通用目的的客戶端的WebAPI: complete HTTP/1.1 (with caching, pipelining, PUT, POS
?? C
?? 第 1 頁 / 共 3 頁
字號:
/* 								     HTAABrow.c**	BROWSER SIDE ACCESS AUTHORIZATION MODULE****	(c) COPYRIGHT MIT 1995.**	Please first read the full copyright statement in the file COPYRIGH.**	@(#) $Id: HTAABrow.c,v 2.60 2001/03/14 16:25:50 kahan Exp $****	Contains code for parsing challenges and creating credentials for **	basic authentication schemes. See also the HTAAUtil module**	for how to handle other authentication schemes. You don't have to use**	this code at all.**** AUTHORS:**	AL	Ari Luotonen	luotonen@dxcern.cern.ch**	HFN	Henrik Frystyk**      JKO     Jose Kahan      **** HISTORY:**	Oct 17	AL	Made corrections suggested by marca:**			Added  if (!realm->username) return NULL;**			Changed some ""s to NULLs.**			Now doing HT_CALLOC() to init uuencode source;**			otherwise HTUU_encode() reads uninitialized memory**			every now and then (not a real bug but not pretty).**			Corrected the formula for uuencode destination size.**	Feb 96 HFN	Rewritten to make it scheme independent and based on**			callback functions and an info structure**      Nov 98 JKO      Added support for message digest authentication**    Jun 2000 JKO      Changed the buffer size for HTUU_encode in order**                      to avoid a potential SIGSEV when calling that **                      function (as advised by Heiner Kallweit).**    Mar 2001 JKO      When doing pipelining digest requests, the stale**                      nonce reply appears only for one of such requests,**                      all the following ones in the pipe will receive a **                      401. I added some code to take into account these cases**                      by trying to infer if a nonce is stale. ***//* Portions of this code (as indicated) are derived from the Internet Draft** draft-ietf-http-authentication-03 and are covered by the following** copyright:** Copyright (C) The Internet Society (1998). All Rights Reserved.** This document and translations of it may be copied and furnished to** others, and derivative works that comment on or otherwise explain it or** assist in its implmentation may be prepared, copied, published and** distributed, in whole or in part, without restriction of any kind,** provided that the above copyright notice and this paragraph are included** on all such copies and derivative works. However, this document itself** may not be modified in any way, such as by removing the copyright notice** or references to the Internet Society or other Internet organizations,** except as needed for the purpose of developing Internet standards in** which case the procedures for copyrights defined in the Internet** Standards process must be followed, or as required to translate it into** languages other than English.** The limited permissions granted above are perpetual and will not be** revoked by the Internet Society or its successors or assigns.** This document and the information contained herein is provided on an "AS** IS" basis and THE INTERNET SOCIETY AND THE INTERNET ENGINEERING TASK** FORCE DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT** LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION HEREIN WILL NOT** INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF MERCHANTABILITY OR** FITNESS FOR A PARTICULAR PURPOSE.**//* Library include files */#include "WWWLib.h"#include "HTAAUtil.h"#include "HTParse.h"#include "HTAABrow.h"					 /* Implemented here */#include "HTDigest.h"#define BASIC_AUTH	"basic"#define DIGEST_AUTH	"digest"#define DIGEST_AI       "authentication-info"#define PROXY_DIGEST_AI "proxy-authentication-info"typedef struct _HTBasic {		  /* Basic challenge and credentials */    char *	uid;    char *	pw;    BOOL	retry;			    /* Should we ask the user again? */    BOOL	proxy;				     /* Proxy authentication */} HTBasic;typedef struct _HTDigest {		 /* Digest challenge and credentials */  /* digest info can be shared by one or more UT entries */    int         references;                /* client authentication data */    char *	uid;    char *	pw;    char *      realm;    char *      cnonce;    long        nc;  /* server authentication data */    char *	nonce;    char *	opaque;  /* session authentication data */    int         algorithm;    char *      qop;    BOOL	stale;    BOOL	retry;			    /* Should we ask the user again? */    BOOL	proxy;				     /* Proxy authentication */} HTDigest;#define HASHLEN 16typedef char HASH[HASHLEN+1];#define HASHHEXLEN 32typedef char HASHHEX[HASHHEXLEN+1];/* ------------------------------------------------------------------------- *//***	Create a protection template for the files**	in the same directory as the given file**	Returns	a template matching docname, and other files in that directory.****		E.g.  /foo/bar/x.html  =>  /foo/bar/ ***						    ^**				Space only to prevent it from**				being a comment marker here,**				there really isn't any space.*/PRIVATE char * make_template (const char * docname){    char * tmplate = NULL;    if (docname) {	char * host = HTParse(docname, "", PARSE_ACCESS|PARSE_HOST|PARSE_PUNCTUATION);	char * path = HTParse(docname, "", PARSE_PATH|PARSE_PUNCTUATION);	char * slash = strrchr(path, '/');	if (slash) {#if 0	    if (*(slash+1)) {				strcpy(slash, "*");		StrAllocCat(host, path);	    } else		StrAllocCat(host, "/*");#else	    if (*(slash+1)) {		strcpy(slash + 1, "*");		StrAllocCat(host, path);	    } else {                StrAllocCat(host, path);                StrAllocCat(host, "*");	    }#endif	}	HT_FREE(path);	tmplate = host;    } else	StrAllocCopy(tmplate, "*");    HTTRACE(AUTH_TRACE, "Template.... Made template `%s' for file `%s'\n" _ 		tmplate _ docname ? docname : "<null>");    return tmplate;}/* ------------------------------------------------------------------------- *//*				Basic Authentication                         *//* ------------------------------------------------------------------------- *//***	Prompt the user for username and password.**	Returns	YES if user name was typed in, else NO*/PRIVATE int prompt_user (HTRequest * request, const char * realm,			 HTBasic * basic){    HTAlertCallback * cbf = HTAlert_find(HT_A_USER_PW);    /* If no method for prompting the user then we might as well give up */    if (!cbf) return HT_ERROR;    /* Otherwise go ahead and ask the user */    if (request) {	HTAlertPar * reply = HTAlert_newReply();	int msg = basic->proxy ? HT_MSG_PROXY_UID : HT_MSG_UID;	BOOL res = (*cbf)(request, HT_A_USER_PW, msg,			  basic->uid, (char *) realm, reply);	if (res) {	    HT_FREE(basic->uid);	    HT_FREE(basic->pw);	    basic->uid = HTAlert_replyMessage(reply);	    basic->pw = HTAlert_replySecret(reply);	}	HTAlert_deleteReply(reply);	return res ? HT_OK : HT_ERROR;    }    return HT_OK;}PRIVATE HTBasic * HTBasic_new(){    HTBasic * me = NULL;    if ((me = (HTBasic *) HT_CALLOC(1, sizeof(HTBasic))) == NULL)	HT_OUTOFMEM("HTBasic_new");    me->retry = YES;			       /* Ask the first time through */    return me;}/*	HTBasic_delete**	--------------**	Deletes a "basic" information object*/PUBLIC int HTBasic_delete (void * context){    HTBasic * basic = (HTBasic *) context;    if (basic) {	HT_FREE(basic->uid);	HT_FREE(basic->pw);	HT_FREE(basic);	return YES;    }    return NO;}/***	Make basic authentication scheme credentials and register this**	information in the request object as credentials. They will then**	be included in the request header. An example is ****		"Basic AkRDIhEF8sdEgs72F73bfaS=="****	The function can both create normal and proxy credentials**	Returns	HT_OK or HT_ERROR*/PRIVATE BOOL basic_credentials (HTRequest * request, HTBasic * basic){    if (request && basic) {	char * cleartext = NULL;	char * cipher = NULL;	int cl_len = strlen(basic->uid ? basic->uid : "") +	    strlen(basic->pw ? basic->pw : "") + 5;	int ci_len = 5 + 4 * (cl_len/3);	if ((cleartext = (char *) HT_CALLOC(1, cl_len)) == NULL)	    HT_OUTOFMEM("basic_credentials");	*cleartext = '\0';	if (basic->uid) strcpy(cleartext, basic->uid);	strcat(cleartext, ":");	if (basic->pw) strcat(cleartext, basic->pw);	if ((cipher = (char *) HT_CALLOC(1, ci_len + 3)) == NULL)	    HT_OUTOFMEM("basic_credentials");	HTUU_encode((unsigned char *) cleartext, strlen(cleartext), cipher);	/* Create the credentials and assign them to the request object */	{	    int cr_len = strlen("basic") + ci_len + 3;	    char * cookie = (char *) HT_MALLOC(cr_len+1);	    if (!cookie) HT_OUTOFMEM("basic_credentials");	    strcpy(cookie, "Basic ");	    strcat(cookie, cipher);	    HTTRACE(AUTH_TRACE, "Basic Cookie `%s\'\n" _ cookie);	    /* Check whether it is proxy or normal credentials */	    if (basic->proxy)		HTRequest_addCredentials(request, "Proxy-Authorization", cookie);	    else		HTRequest_addCredentials(request, "Authorization", cookie);	    HT_FREE(cookie);	}	HT_FREE(cleartext);	HT_FREE(cipher);	return HT_OK;    }    return HT_ERROR;}/*	HTBasic_generate**	----------------**	This function generates "basic" 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 HTBasic_generate (HTRequest * request, void * context, int mode){     HTBasic * basic = (HTBasic *) 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)	    basic->retry = YES;	/*	** If we don't have a basic context then add a new one to the tree.	** We use different trees for normal and proxy authentication	*/	if (!basic) {		basic = HTBasic_new();	    if (proxy) {		char * url = HTRequest_proxy(request);		basic->proxy = YES;		HTAA_updateNode(proxy, BASIC_AUTH, realm, url, basic);	    } else {		char * url = HTAnchor_address((HTAnchor*)HTRequest_anchor(request));		HTAA_updateNode(proxy, BASIC_AUTH, realm, url, basic);		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 ((basic->retry && prompt_user(request, realm, basic) == HT_OK) ||	    (!basic->retry && basic->uid)) {	    basic->retry = NO;	    return basic_credentials(request, basic);	} else {	    char * url = HTAnchor_address((HTAnchor*)HTRequest_anchor(request));	    HTAA_deleteNode(proxy, BASIC_AUTH, realm, url);	    HT_FREE(url);	    return HT_ERROR;	}    }    return HT_OK;}/*	HTBasic_parse**	-------------**	This function parses the contents of a "basic" 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 HTBasic_parse (HTRequest * request, HTResponse * response,			  void * context, int status){    HTAssocList * challenge = HTResponse_challenge(response);    HTBasic * basic = NULL;    BOOL proxy = status==HT_NO_PROXY_ACCESS ? YES : NO;    if (request && challenge) {	char * p = HTAssocList_findObject(challenge, BASIC_AUTH);	char * realm = HTNextField(&p);	char * rm = HTNextField(&p);	/*	** 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, "Basic 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, "Basic Parse. Proxy authentication\n");		basic = (HTBasic *) HTAA_updateNode(proxy, BASIC_AUTH, rm,						    url, NULL);		/* if the previous authentication failed, then try again */		if (HTRequest_AAretrys (request) > 1 		    && status == HT_NO_ACCESS && basic)		  basic->retry = YES;	    } else {		char * url = HTAnchor_address((HTAnchor *)					      HTRequest_anchor(request));

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
成人v精品蜜桃久久一区| 久久亚洲捆绑美女| 一区二区三区加勒比av| 91麻豆swag| 亚洲成人激情自拍| 日韩一区二区三免费高清| 免费看日韩精品| 久久久久9999亚洲精品| 成人午夜av电影| 亚洲大片精品永久免费| 日韩视频在线一区二区| 国产一区二区三区黄视频| 中文字幕不卡在线观看| 成a人片国产精品| 中文字幕亚洲视频| 欧美日韩一级二级三级| 日本不卡的三区四区五区| 久久久久久久久久久久久女国产乱| 福利电影一区二区| 一区二区三区鲁丝不卡| 日韩免费看的电影| av不卡一区二区三区| 亚洲成av人影院| 精品美女在线观看| 色猫猫国产区一区二在线视频| 日本欧美加勒比视频| 国产欧美精品日韩区二区麻豆天美| 色视频欧美一区二区三区| 免费成人av资源网| 中文字幕一区二| 91久久香蕉国产日韩欧美9色| 国产欧美一区二区精品忘忧草| 成人免费在线观看入口| 久久国产精品72免费观看| 91麻豆免费观看| 国产精品进线69影院| 爽好久久久欧美精品| 91免费观看视频| 亚洲日本韩国一区| 韩国av一区二区三区四区| 欧美日韩亚洲综合在线 欧美亚洲特黄一级| 久久蜜桃av一区二区天堂| 亚洲6080在线| 欧美日韩免费高清一区色橹橹| 青青草国产精品97视觉盛宴| 99精品视频在线观看| 国产精品久久久久久久裸模| 麻豆中文一区二区| 国产成人自拍网| 欧美三级日韩三级| 亚洲国产精品国自产拍av| 奇米影视7777精品一区二区| 国产欧美日韩在线观看| 欧美精品一区二区三区蜜桃 | 国模娜娜一区二区三区| 亚洲一区二区三区影院| 亚洲国产高清aⅴ视频| 欧美一卡2卡三卡4卡5免费| 日本韩国精品在线| av日韩在线网站| 亚洲国产精品精华液2区45| 国产伦精品一区二区三区免费迷 | 国产在线不卡一区| 欧美日韩一级片网站| 五月天国产精品| 中文字幕一区免费在线观看| 国产精品久久久久久久久搜平片| 视频一区欧美精品| 91精品国产色综合久久| 欧美日韩一卡二卡三卡 | 色狠狠av一区二区三区| 一区二区不卡在线播放| 日韩欧美国产麻豆| 视频一区二区三区中文字幕| 亚洲精品乱码久久久久久久久| 国产欧美日韩在线| 国产蜜臀av在线一区二区三区| 26uuu色噜噜精品一区| 精品入口麻豆88视频| 精品国产乱码久久久久久牛牛| 欧美成人精精品一区二区频| 欧美va亚洲va国产综合| 久久亚区不卡日本| 久久精品男人天堂av| 欧美激情一区二区| 国产日韩精品一区| 中文字幕永久在线不卡| 亚洲欧美激情小说另类| 一区二区三区中文字幕电影| 亚洲一区二区不卡免费| 午夜精品久久久久久久99水蜜桃| 日韩av一区二区三区| 久久精品国产一区二区三 | 中文字幕不卡的av| 亚洲色图视频免费播放| 亚洲一本大道在线| 欧美亚洲禁片免费| 亚洲国产一区二区在线播放| 国产精品国产成人国产三级| 亚洲免费在线看| 亚洲一级片在线观看| 日韩成人av影视| 国内不卡的二区三区中文字幕 | 国产精品灌醉下药二区| 国产一区二区三区在线观看免费 | 成人视屏免费看| 色偷偷一区二区三区| 91精品欧美久久久久久动漫| 日韩视频123| 国产精品毛片久久久久久| 亚洲午夜精品一区二区三区他趣| 日本va欧美va精品发布| 懂色av中文字幕一区二区三区| 日本高清不卡aⅴ免费网站| 欧美精品99久久久**| 国产日韩综合av| 亚洲愉拍自拍另类高清精品| 国产在线精品免费| 91免费视频网| 欧美videos大乳护士334| 亚洲欧美日韩系列| 精品一区二区成人精品| 色综合视频在线观看| 欧美精品一区二区三| 一区二区国产盗摄色噜噜| 国产精品综合一区二区| 欧美日韩一区 二区 三区 久久精品| 欧美精品一区二区精品网| 一区二区三区在线免费播放 | 国产精品久久久久久妇女6080| 亚洲v精品v日韩v欧美v专区| 成人免费观看男女羞羞视频| 91精品国产91久久久久久一区二区 | 婷婷六月综合网| 不卡的av中国片| 久久美女艺术照精彩视频福利播放 | 性做久久久久久久久| 99久久久精品免费观看国产蜜| 日韩欧美一区二区不卡| 亚洲国产你懂的| 99久久精品国产观看| 国产三级精品三级| 久久精品国产免费| 欧美日韩一级片网站| 亚洲久本草在线中文字幕| 成人一区二区三区视频在线观看| 91麻豆精品国产91久久久久久久久| 17c精品麻豆一区二区免费| 国产高清亚洲一区| 日韩欧美国产一区二区三区| 一区二区成人在线观看| 99久久99久久久精品齐齐| 中文字幕成人av| 国产成人精品亚洲777人妖| 欧美精品一区二区三区视频| 狂野欧美性猛交blacked| 欧美日高清视频| 亚洲大片精品永久免费| 在线观看视频91| 亚洲一区二区三区四区五区黄| av电影天堂一区二区在线观看| 久久久一区二区三区捆绑**| 精品无人码麻豆乱码1区2区| 欧美mv和日韩mv的网站| 麻豆一区二区三| 精品久久久久久久久久久久包黑料| 免费成人深夜小野草| 精品国产人成亚洲区| 国产伦精品一区二区三区视频青涩| 精品国精品自拍自在线| 美女视频一区在线观看| 欧美xxxxxxxx| 国产福利不卡视频| 中文字幕国产一区| 成人免费看视频| 亚洲精品免费在线观看| 在线视频国内一区二区| 欧美日韩亚洲综合一区二区三区| 久久99精品国产麻豆婷婷洗澡| 国产性天天综合网| 欧美日韩一区高清| 成人av网址在线| 久久国内精品自在自线400部| 一区二区三区在线视频观看| 国产欧美一区二区三区鸳鸯浴| 欧美日韩中文字幕精品| av在线一区二区| 国产尤物一区二区在线| 日韩电影在线一区| 亚洲成人精品影院| 一区二区三区在线观看视频| 国产午夜一区二区三区| 精品国产露脸精彩对白| 91精品国产91综合久久蜜臀| 在线播放国产精品二区一二区四区| 成人高清视频在线观看| 91一区二区三区在线观看| 国产一区二区在线看| 色妞www精品视频| 欧美日韩一区二区三区不卡|