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

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

?? xauth.c

?? This a good VPN source
?? C
?? 第 1 頁 / 共 4 頁
字號:
	if (!out_struct(&hdr, &isakmp_hdr_desc, &reply, &rbody))	{	    return STF_INTERNAL_ERROR;	}    }    START_HASH_PAYLOAD(rbody, ISAKMP_NEXT_ATTR);    /* ATTR out */    {	struct  isakmp_mode_attr attrh;	struct isakmp_attribute attr;	pb_stream strattr;	attrh.isama_np = ISAKMP_NEXT_NONE;	attrh.isama_type = ISAKMP_CFG_REQUEST;	attrh.isama_identifier = 0;	if(!out_struct(&attrh, &isakmp_attr_desc, &rbody, &strattr))	    return STF_INTERNAL_ERROR;	/* ISAKMP attr out (name) */	attr.isaat_af_type = XAUTH_USER_NAME;	attr.isaat_lv = 0;	out_struct(&attr, &isakmp_xauth_attribute_desc, &strattr, NULL);		/* ISAKMP attr out (password) */	attr.isaat_af_type = XAUTH_USER_PASSWORD;	attr.isaat_lv = 0;	out_struct(&attr, &isakmp_xauth_attribute_desc, &strattr, NULL);	close_message(&strattr);    }    xauth_mode_cfg_hash(r_hashval,r_hash_start,rbody.cur,st);        close_message(&rbody);    close_output_pbs(&reply);    init_phase2_iv(st, &st->st_msgid);    encrypt_message(&rbody, st);    clonetochunk(st->st_tpacket, reply.start, pbs_offset(&reply)	, "XAUTH: req");    /* Transmit */    send_packet(st, "XAUTH: req");    /* RETRANSMIT if Main, SA_REPLACE if Aggressive */    if(st->st_event->ev_type != EVENT_RETRANSMIT)    {		delete_event(st);	event_schedule(EVENT_RETRANSMIT,EVENT_RETRANSMIT_DELAY_0 * 3,st);    }    return STF_OK;}/** Send modecfg IP address request (IP4 address) * @param st State * @return stf_status */stf_status modecfg_send_request(struct state *st){    pb_stream reply;    pb_stream rbody;    char buf[256];    u_char *r_hash_start,*r_hashval;    /* set up reply */    init_pbs(&reply, buf, sizeof(buf), "xauth_buf");    openswan_log("modecfg: Sending IP request (MODECFG_I1)");    /* this is the beginning of a new exchange */    st->st_msgid = generate_msgid(st);    st->st_state = STATE_MODE_CFG_I1;    /* HDR out */    {	struct isakmp_hdr hdr;	zero(&hdr);	/* default to 0 */	hdr.isa_version = ISAKMP_MAJOR_VERSION << ISA_MAJ_SHIFT | ISAKMP_MINOR_VERSION;	hdr.isa_np = ISAKMP_NEXT_HASH;	hdr.isa_xchg = ISAKMP_XCHG_MODE_CFG;	hdr.isa_flags = ISAKMP_FLAG_ENCRYPTION;	memcpy(hdr.isa_icookie, st->st_icookie, COOKIE_SIZE);	memcpy(hdr.isa_rcookie, st->st_rcookie, COOKIE_SIZE);	hdr.isa_msgid = st->st_msgid;	if (!out_struct(&hdr, &isakmp_hdr_desc, &reply, &rbody))	{	    return STF_INTERNAL_ERROR;	}    }    START_HASH_PAYLOAD(rbody, ISAKMP_NEXT_ATTR);    /* ATTR out */    {	struct  isakmp_mode_attr attrh;	struct isakmp_attribute attr;	pb_stream strattr;	attrh.isama_np = ISAKMP_NEXT_NONE;	attrh.isama_type = ISAKMP_CFG_REQUEST;	attrh.isama_identifier = 0;	if(!out_struct(&attrh, &isakmp_attr_desc, &rbody, &strattr))	    return STF_INTERNAL_ERROR;	/* ISAKMP attr out (ipv4) */	attr.isaat_af_type = INTERNAL_IP4_ADDRESS;	attr.isaat_lv = 0;	out_struct(&attr, &isakmp_xauth_attribute_desc, &strattr, NULL);		/* ISAKMP attr out (netmask) */	attr.isaat_af_type = INTERNAL_IP4_NETMASK;	attr.isaat_lv = 0;	out_struct(&attr, &isakmp_xauth_attribute_desc, &strattr, NULL);	close_message(&strattr);    }    xauth_mode_cfg_hash(r_hashval,r_hash_start,rbody.cur,st);        close_message(&rbody);    close_output_pbs(&reply);    init_phase2_iv(st, &st->st_msgid);    encrypt_message(&rbody, st);    clonetochunk(st->st_tpacket, reply.start, pbs_offset(&reply)	, "modecfg: req");    /* Transmit */    send_packet(st, "modecfg: req");    /* RETRANSMIT if Main, SA_REPLACE if Aggressive */    if(st->st_event->ev_type != EVENT_RETRANSMIT)    {		delete_event(st);	event_schedule(EVENT_RETRANSMIT,EVENT_RETRANSMIT_DELAY_0 * 3,st);    }    st->hidden_variables.st_modecfg_started = TRUE;    return STF_OK;}/** Send XAUTH status to client * * @param st State * @param status Status code * @return stf_status */stf_status xauth_send_status(struct state *st, int status){    pb_stream reply;    pb_stream rbody;    char buf[256];    u_char *r_hash_start,*r_hashval;    /* set up reply */    init_pbs(&reply, buf, sizeof(buf), "xauth_buf");    /* pick a new message id */    st->st_msgid = generate_msgid(st);    /* HDR out */    {	struct isakmp_hdr hdr;	zero(&hdr);	/* default to 0 */	hdr.isa_version = ISAKMP_MAJOR_VERSION << ISA_MAJ_SHIFT | ISAKMP_MINOR_VERSION;	hdr.isa_np = ISAKMP_NEXT_HASH;	hdr.isa_xchg = ISAKMP_XCHG_MODE_CFG;	hdr.isa_flags = ISAKMP_FLAG_ENCRYPTION;	memcpy(hdr.isa_icookie, st->st_icookie, COOKIE_SIZE);	memcpy(hdr.isa_rcookie, st->st_rcookie, COOKIE_SIZE);	hdr.isa_msgid = st->st_msgid;	if (!out_struct(&hdr, &isakmp_hdr_desc, &reply, &rbody))	{	    return STF_INTERNAL_ERROR;	}    }    START_HASH_PAYLOAD(rbody, ISAKMP_NEXT_ATTR);    /* ATTR out */    {	struct  isakmp_mode_attr attrh;	struct isakmp_attribute attr;	pb_stream strattr;	attrh.isama_np = ISAKMP_NEXT_NONE;	attrh.isama_type = ISAKMP_CFG_SET;	attrh.isama_identifier = 0;	if(!out_struct(&attrh, &isakmp_attr_desc, &rbody, &strattr))	    return STF_INTERNAL_ERROR;	/* ISAKMP attr out (status) */#if 1	attr.isaat_af_type = XAUTH_STATUS | ISAKMP_ATTR_AF_TV;	attr.isaat_lv = status;	out_struct(&attr, &isakmp_xauth_attribute_desc, &strattr, NULL);#else	attr.isaat_af_type = XAUTH_STATUS | ISAKMP_ATTR_AF_TLV;	out_struct(&attr, &isakmp_xauth_attribute_desc, &strattr, &val);	status = htonl(status);	out_raw(&status,4,&val,"Status");	close_output_pbs(&val);#endif	close_message(&strattr);    }    xauth_mode_cfg_hash(r_hashval,r_hash_start,rbody.cur,st);        close_message(&rbody);    close_output_pbs(&reply);    init_phase2_iv(st, &st->st_msgid);    encrypt_message(&rbody, st);    /* free previous transmit packet */    freeanychunk(st->st_tpacket);    clonetochunk(st->st_tpacket, reply.start, pbs_offset(&reply)	, "XAUTH: status");    /* Set up a retransmission event, half a minute henceforth */    /* Schedule retransmit before sending, to avoid race with master thread */    delete_event(st);    event_schedule(EVENT_RETRANSMIT, EVENT_RETRANSMIT_DELAY_0, st);    /* Transmit */    send_packet(st, "XAUTH: status");    st->st_state = STATE_XAUTH_R1;    return STF_OK;}#ifdef XAUTH_USEPAM/** XAUTH PAM conversation * * @param num_msg Int. * @param msgm Pam Message Struct * @param response Where PAM will put the results * @param appdata_ptr Pointer to data struct (as we are using threads) * @return int Return Code */staticint xauth_pam_conv(int num_msg, const struct pam_message **msgm,	       struct pam_response **response, void *appdata_ptr){    struct thread_arg *arg = appdata_ptr;    int count=0;    struct pam_response *reply;    if (num_msg <= 0)        return PAM_CONV_ERR;    reply = (struct pam_response *) calloc(num_msg,                                           sizeof(struct pam_response));    if (reply == NULL) {        return PAM_CONV_ERR;    }    for (count=0; count < num_msg; ++count) {        char *string=NULL;        switch (msgm[count]->msg_style) {        case PAM_PROMPT_ECHO_OFF:	    string = malloc(arg->password.len+1);	    strcpy(string,arg->password.ptr);            break;        case PAM_PROMPT_ECHO_ON:	    string = malloc(arg->name.len+1);	    strcpy(string,arg->name.ptr);            break;        }	        if (string) { /* must add to reply array */           /* add string to list of responses */            reply[count].resp_retcode = 0;            reply[count].resp = string;            string = NULL;        }    }    *response = reply;    reply = NULL;    return PAM_SUCCESS;}#endif#ifdef XAUTH_USEPAM/** Do authentication via PAM (Plugable Authentication Modules) * * We open a PAM session via pam_start, and try to authenticate the user * * @return int Return Code */staticint do_pam_authentication(void *varg){    struct thread_arg	*arg = varg;    pam_handle_t *pamh=NULL;    int retval;    conv.appdata_ptr = varg;    retval = pam_start("pluto", arg->name.ptr, &conv, &pamh);    /*  Two factor authentication - Check that the user is valid, 	and then check if they are permitted access */    if (retval == PAM_SUCCESS)        retval = pam_authenticate(pamh, PAM_SILENT);    /* is user really user? */    if (retval == PAM_SUCCESS)        retval = pam_acct_mgmt(pamh, 0);       /* permitted access? */    pam_end(pamh, PAM_SUCCESS);    if(retval == PAM_SUCCESS)      return TRUE;    else      return FALSE;}#else /* XAUTH_USEPAM *//** Do authentication via /etc/ipsec.d/passwd file using MD5 passwords * * password file structure does not compensate for * extra garbage so don't leave any! we do allows for #'s * as first char for comments just because I hate conf * files like .htaccess that don't support it * * /etc/ipsec.d/passwd * username:md5sum:connectioname\n * * can be made with, htpasswd: * * htpasswd -c -m -b /etc/ipsec.d/passwd road roadpass * * @return int Return Code */staticint do_md5_authentication(void *varg){    struct thread_arg	*arg = varg;    int len;    char szline[1024]; /* more than enough */    FILE *fp;    char *szuser;    char *szpass;    char *szconnid;    char *sztemp;    int loc = 0;    size_t pwlen = strlen(ipsec_dir) + sizeof("/passwd") + 1;    verify_path_space(&pwdfile, pwlen, "xauth passwd file path");    snprintf(pwdfile.path, pwdfile.path_space, "%s/passwd", ipsec_dir);    fp = fopen(pwdfile.path, "r");    if( fp == (FILE *)0)    {        /* unable to open the password file */        openswan_log("XAUTH: unable to open password file (%s) for verification", pwdfile.path);        return FALSE;    }    openswan_log("XAUTH: password file (%s) open.", pwdfile.path);    /** simple stuff read in a line then go through positioning     * szuser ,szpass and szconnid at the begining of each of the     * memory locations of our real data and replace the ':' with '\0'     */    while( fgets( szline, sizeof(szline), fp) != (char *)0)    {        len = strlen( szline );        loc = 0; /* reset our index */        if(szline[0] == '#') /* comment line move on */           continue;        /* get userid */        sztemp = strchr(szline, ':');        if (sztemp == (char *)0 )          continue; /* we found no tokens bad line so just skip it */        *sztemp++ = '\0'; /* put a null where the ':' was */        szuser = &szline[loc]; /* szline now contains our null terminated data */        loc+=strlen(szuser)+1; /* move past null into next section */        /* get password */                sztemp = strchr(&szline[loc], ':');        if (sztemp == (char *)0 )          continue; /* we found no tokens bad line so just skip it */        *sztemp++ = '\0'; /* put a null where the ':' was */        szpass = &szline[loc]; /* szline now contains our null terminated data */        loc+=strlen(szpass)+1; /* move past null into next section */        /* get connection id */                sztemp = strchr(&szline[loc], '\n'); /* last \n */                if (sztemp == (char *)0 )          continue; /* we found no tokens bad line so just skip it */        *sztemp++ = '\0'; /* put a null where the ':' was */                szconnid = &szline[loc]; /* szline now contains our null terminated data */                        /* it is possible that szconnid will be null so don't bother         * checking it. If it is null then this is to say it applies         * to all connection classes         */        DBG(DBG_CONTROL,	    DBG_log("XAUTH: found user(%s/%s) pass(%s) connid(%s/%s)"		    , szuser, arg->name.ptr		    , szpass, szconnid, arg->connname.ptr));        if ( strcasecmp(szconnid, arg->connname.ptr) == 0	     && strcmp( szuser, arg->name.ptr ) == 0 ) /* user correct ?*/        {	    char *cp;	    cp = crypt( arg->password.ptr, szpass);	    if(DBGP(DBG_CRYPT))	    {		DBG_log("XAUTH: checking user(%s:%s) pass %s vs %s" , szuser, szconnid, cp, szpass);	    }	    else	    {		openswan_log("XAUTH: checking user(%s:%s) " , szuser, szconnid);	    }           /* Ok then now password check */           if ( strcmp(cp, szpass ) == 0 )             {             /* we have a winner */             fclose( fp );             return TRUE;           }	   openswan_log("XAUTH: nope");        }    }    fclose( fp );        return FALSE;}#endif/** Main authentication routine will then call the actual compiled in  *  method to verify the user/password */static void * do_authentication(void *varg){    struct thread_arg	*arg = varg;    struct state *st = arg->st;    int results=FALSE;    openswan_log("XAUTH: User %s: Attempting to login" , arg->name.ptr);        #ifdef XAUTH_USEPAM    openswan_log("XAUTH: pam authentication being called to authenticate user %s",arg->name.ptr);    results=do_pam_authentication(varg);#else    openswan_log("XAUTH: md5 authentication being called to authenticate user %s",arg->name.ptr);    results=do_md5_authentication(varg);#endif    if(results)    {        openswan_log("XAUTH: User %s: Authentication Successful", arg->name.ptr);        xauth_send_status(st,1);        if(st->quirks.xauth_ack_msgid) {	  st->st_msgid = 0;	}            } else    {	/** Login attempt failed, display error, send XAUTH status to client         *  and reset state to XAUTH_R0 */        openswan_log("XAUTH: User %s: Authentication Failed: Incorrect Username or Password", arg->name.ptr);        xauth_send_status(st,0);	        st->st_state = STATE_XAUTH_R0;            }           freeanychunk(arg->password);    freeanychunk(arg->name);    freeanychunk(arg->connname);    pfree(varg);        return NULL;}/** Launch an authenication prompt * * @param st State Structure * @param name Usernamd * @param password password * @param connname conn name, from ipsec.conf * @return int Return Code - always 0. */int xauth_launch_authent(struct state *st			 , chunk_t name			 , chunk_t password			 , chunk_t connname){#ifdef HAVE_THREADS    pthread_attr_t pattr;    pthread_t tid;#endif    struct thread_arg	*arg;    arg = alloc_thing(struct thread_arg,"ThreadArg");    arg->st = st;    arg->password = password;    arg->name = name;    arg->connname = connname;#ifdef HAVE_THREADS    pthread_attr_init(&pattr);    pthread_attr_setdetachstate(&pattr,PTHREAD_CREATE_DETACHED);    pthread_create(&tid,&pattr,do_authentication, (void*) arg);    pthread_attr_destroy(&pattr);#else    do_authentication(arg);#endif    return 0;}/** STATE_XAUTH_R0: *  First REQUEST sent, expect for REPLY *  HDR*, HASH, ATTR(REPLY,PASSWORD) --> HDR*, HASH, ATTR(STATUS) * * @param md Message Digest * @return stf_status */stf_statusxauth_inR0(struct msg_digest *md){    pb_stream *attrs = &md->chain[ISAKMP_NEXT_ATTR]->pbs;    struct state *const st = md->st;    chunk_t name, password, connname;    bool gotname, gotpassword;    gotname = gotpassword = FALSE;    CHECK_QUICK_HASH(md,xauth_mode_cfg_hash(hash_val,hash_pbs->roof, md->message_pbs.roof, st)	, "XAUTH-HASH", "XAUTH R0");    {        struct isakmp_attribute attr;        pb_stream strattr;	if (md->chain[ISAKMP_NEXT_ATTR]->payload.attribute.isama_type != ISAKMP_CFG_REPLY)	{	    openswan_log("Expecting MODE_CFG_REPLY, got %s instead."		 , enum_name(&attr_msg_type_names, md->chain[ISAKMP_NEXT_ATTR]->payload.attribute.isama_type));	    return STF_IGNORE;	}	while(pbs_left(attrs) > sizeof(struct isakmp_attribute))

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
福利一区二区在线观看| 久久99九九99精品| 日韩欧美久久久| 99在线精品观看| 久草热8精品视频在线观看| 国产精品美女久久久久久| 欧美丰满一区二区免费视频| 成人亚洲一区二区一| 日本欧美大码aⅴ在线播放| 亚洲欧洲日本在线| 2024国产精品| 欧美日韩一区中文字幕| 成人av午夜电影| 韩国女主播一区二区三区| 亚洲综合网站在线观看| 亚洲欧洲三级电影| 国产女主播视频一区二区| 日韩精品在线一区| 欧美乱妇23p| 色偷偷久久一区二区三区| 成人免费毛片嘿嘿连载视频| 另类综合日韩欧美亚洲| 亚洲成av人片在线观看| 亚洲欧美日韩国产综合| 欧美激情一区二区三区| 精品国产乱码久久久久久闺蜜 | 亚洲欧美日韩电影| 久久久五月婷婷| 欧美大片在线观看一区二区| 欧美日韩国产大片| 欧美日韩视频专区在线播放| 色老汉一区二区三区| 91在线视频免费观看| 粗大黑人巨茎大战欧美成人| 国产麻豆精品视频| 国产精选一区二区三区| 国内精品写真在线观看| 久久99精品国产.久久久久久| 热久久免费视频| 日日摸夜夜添夜夜添精品视频| 亚洲自拍偷拍麻豆| 亚洲一区二区三区在线| 一区二区三区成人| 亚洲伊人伊色伊影伊综合网| 亚洲乱码国产乱码精品精小说| 综合分类小说区另类春色亚洲小说欧美 | 蜜桃91丨九色丨蝌蚪91桃色| 免费成人在线观看视频| 美女尤物国产一区| 国产综合久久久久久鬼色 | 在线观看亚洲一区| 欧美亚洲自拍偷拍| 7777精品伊人久久久大香线蕉 | 欧美日韩一区二区在线观看 | 欧美视频完全免费看| 欧美中文字幕亚洲一区二区va在线| 欧日韩精品视频| 91精品国产91热久久久做人人| 日韩欧美国产一区二区在线播放| 精品成人在线观看| 国产精品乱子久久久久| 亚洲色图一区二区三区| 亚洲国产精品久久一线不卡| 日本一道高清亚洲日美韩| 激情另类小说区图片区视频区| 成人免费av资源| 在线亚洲一区二区| 欧美一级片在线看| 中文字幕精品一区二区精品绿巨人 | 国产日韩欧美亚洲| 亚洲精品伦理在线| 日韩一区欧美二区| 国产精品中文字幕日韩精品 | 欧美一级高清片| 久久久久久麻豆| 一区二区三区中文免费| 热久久一区二区| 99久久精品国产麻豆演员表| 欧美高清精品3d| 国产精品免费免费| 午夜精品福利久久久| 精品亚洲国产成人av制服丝袜| jizzjizzjizz欧美| 日韩一二在线观看| 亚洲天堂免费在线观看视频| 日本成人在线看| 成人av电影免费观看| 最新国产成人在线观看| 一区二区三区在线免费| 麻豆成人91精品二区三区| eeuss鲁片一区二区三区| 884aa四虎影成人精品一区| 中日韩免费视频中文字幕| 肉肉av福利一精品导航| 波多野结衣的一区二区三区| 91精品国产福利在线观看| 中文字幕五月欧美| 久久国产视频网| 欧美在线看片a免费观看| 久久精品人人做人人综合 | 亚洲女同一区二区| 国产在线播放一区三区四| 在线中文字幕一区| 国产免费观看久久| 久久成人综合网| 欧美午夜精品电影| 亚洲欧洲精品一区二区三区| 另类成人小视频在线| 欧美日韩免费一区二区三区| 国产精品女主播av| 国产精品18久久久久| 欧美电影影音先锋| 亚洲一区二区三区在线看| 成人国产精品视频| 久久久国际精品| 看国产成人h片视频| 9191精品国产综合久久久久久 | 国产精品视频免费看| 久久se这里有精品| 欧美丰满美乳xxx高潮www| 亚洲一区二区四区蜜桃| 91丝袜呻吟高潮美腿白嫩在线观看| 久久久精品日韩欧美| 美女视频免费一区| 777xxx欧美| 免费的成人av| 日韩欧美激情四射| 久久精品国产色蜜蜜麻豆| 欧美一区二区三区免费| 天堂午夜影视日韩欧美一区二区| 色天使色偷偷av一区二区| 亚洲老妇xxxxxx| 色婷婷狠狠综合| 依依成人综合视频| 在线观看日韩av先锋影音电影院| 中文字幕日本不卡| 成人av免费在线观看| 国产精品理论片| 一区二区在线观看免费| 欧美日韩精品欧美日韩精品| 亚洲欧洲精品天堂一级| 成人小视频在线| 欧美经典三级视频一区二区三区| 国产又黄又大久久| 久久综合国产精品| 国产一区二区美女| 精品久久久久久最新网址| 捆绑紧缚一区二区三区视频| 精品国产百合女同互慰| 国产成人自拍网| 亚洲视频资源在线| 在线观看欧美黄色| 日本视频中文字幕一区二区三区| 日韩视频免费观看高清完整版在线观看 | 日本精品一区二区三区四区的功能| 国产精品国产三级国产普通话三级| 成人高清视频免费观看| 亚洲日本在线观看| 欧美日韩在线电影| 韩国毛片一区二区三区| 国产女人aaa级久久久级| 91污在线观看| 图片区小说区区亚洲影院| 欧美成人精品二区三区99精品| 国产电影一区在线| 亚洲精品v日韩精品| 91精品久久久久久久99蜜桃| 国产一区二区三区电影在线观看| 国产精品视频一区二区三区不卡| 91美女视频网站| 日本免费新一区视频| 欧美激情一区二区三区蜜桃视频 | 欧美日韩中字一区| 精品一区免费av| 亚洲色图.com| 制服丝袜亚洲色图| 国产a久久麻豆| 亚洲成av人**亚洲成av**| 精品久久久久久综合日本欧美| 99久久婷婷国产综合精品电影 | 国内精品国产三级国产a久久| 国产精品视频免费| 欧美精品乱码久久久久久| 国产精品一区二区在线看| 一区二区三区日韩精品| 久久亚洲影视婷婷| 欧美性三三影院| 成人国产免费视频| 麻豆精品视频在线观看免费| 中文字幕一区三区| 精品美女在线播放| 欧美性猛交一区二区三区精品| 精品亚洲国产成人av制服丝袜 | 国产精品护士白丝一区av| 欧美日韩视频专区在线播放| 成人免费三级在线| 蜜臀a∨国产成人精品| 亚洲激情在线播放| 亚洲国产精华液网站w| 欧美一区二区三区四区在线观看|