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

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

?? defaultdistrict.c

?? IBE是一種非對稱密碼技術(shù)
?? C
字號:
/* Copyright 2003-2005, Voltage Security, all rights reserved.
 */
#include "vibe.h"
#include "environment.h"
#include "base.h"
#include "libctx.h"
#include "vsdistrict.h"
#include "derhelp.h"
#include "oidlist.h"
#include "ibe.h"
#include "vtime.h"
#include "errorctx.h"
#include "connectioncache.h"
#include "vtassert.h"

#if VOLT_OS != VOLT_WINDOWS_32
#if VOLT_OS != VOLT_MACOSX

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <curl/curl.h>
#include <curl/types.h>
#include <curl/easy.h>

#define VOLT_CURL_CONNECTION_TYPE 1000

typedef struct
{
  VoltLibCtx *libCtx ;
  char *memory;
  size_t size;
} VoltMemoryStruct;

static void VOLT_CALLING_CONV CurlDeleteConnection(Pointer connection, VtLibCtx libCtx)
{
  CURL* curl = (CURL*) connection;
  VT_ASSERT(curl != (CURL*)0);
  curl_easy_cleanup (curl);
}

static size_t WriteMemoryCallback (
   void *ptr,
   size_t size,
   size_t nmemb,
   void *data
   )
{
  register int realsize = size * nmemb;
  VoltMemoryStruct *mem = (VoltMemoryStruct *)data;
  VoltLibCtx *libCtx = mem->libCtx;
  VOLT_DECLARE_FNCT_LINE (fnctLine)

  VOLT_SET_FNCT_LINE (fnctLine)
  mem->memory = (char *)Z2Realloc (mem->memory, mem->size + realsize + 1);
  if (mem->memory != (char *)0)
  {
    Z2Memcpy (&(mem->memory[mem->size]), ptr, realsize);
    mem->size += realsize;
    mem->memory[mem->size] = 0;
    return (realsize);
  }

  VOLT_LOG_ERROR (
    (VtLibCtx)libCtx, VT_ERROR_MEMORY, VT_ERROR_TYPE_PRIMARY, fnctLine,
    "WriteMemoryCallback", (char *)0)

  return (0);
}

int mDoHTTP (
   VoltHttpRequestInfo *requestInfo,
   char **response,
   int *responseCode,   
   unsigned char *url,   
   int allowBadCert,
   unsigned char *trustStore,
   unsigned long timeOut,
   void *appData
   )
{
  int status, offset;
  VoltTransportCtx *transCtx = (VoltTransportCtx *)0;  
  VoltIdentityObject *idObj = (VoltIdentityObject *)0;
  VoltLibCtx *libCtx = (VoltLibCtx *)0;  
  VtUserPassCollector PasswordCollector = (VtUserPassCollector)0;
  VtConnectionCacheCtx connectionCacheCtx = (VtConnectionCacheCtx)0;
  int isCachedConnection = 0;
  unsigned char *userName = (unsigned char *)0;
  unsigned char *password = (unsigned char *)0;
  unsigned int userNameLen, passwordLen;
  unsigned long timeOutFinal;
  unsigned char *postData = (unsigned char *)0;
  VoltHttpRequestInfoPost *postInfo = (VoltHttpRequestInfoPost *)0;
  CURL *curl = (CURL *)0;
  VoltMemoryStruct mem;
  char errorBuf[CURL_ERROR_SIZE];
  char authString[128];
  VOLT_DECLARE_FNCT_LINE (fnctLine)

  /* First check the type of request and set some variables accordingly
   */
  if (requestInfo->requestType == VOLT_REQUEST_TYPE_GET)
  {
    libCtx = (VoltLibCtx *)requestInfo->requestData;
  }
  else
  {
    postInfo = (VoltHttpRequestInfoPost *)requestInfo->requestData;
    transCtx = postInfo->transCtx;     
    PasswordCollector =  transCtx->userPassCtx.UserPassFunction;
    idObj = postInfo->idObj;
    libCtx = (VoltLibCtx *)(transCtx->voltObject.libraryCtx);
    postData = postInfo->postData;
  }

  mem.libCtx = libCtx;
  mem.memory = NULL;
  mem.size = 0;
  errorBuf[0] = 0;   
  
  do
  {
    VOLT_SET_FNCT_LINE (fnctLine)
    status = VtGetLibCtxParam(libCtx, VtLibCtxParamConnectionCacheCtx,
      (Pointer*)&connectionCacheCtx);
    if ((status != 0) && (status != VT_ERROR_GET_INFO_UNAVAILABLE))
      break;

    if (connectionCacheCtx != (VtConnectionCacheCtx)0)
    {
      status = connectionCacheCtx->AcquireConnection(connectionCacheCtx,
        VOLT_CURL_CONNECTION_TYPE, (Pointer*)&curl);
      if (status == 0)
      {
        isCachedConnection = 1;
      }
      else if (status != VT_ERROR_ALL_CONNECTIONS_IN_USE)
      {
	break;
      }
    }

    if (curl == (CURL*)0)
    {
      VOLT_SET_FNCT_LINE (fnctLine)
      status = -1;
      curl = curl_easy_init ();
      if (curl == (CURL *)0)
        break;
    }

    VOLT_SET_FNCT_LINE (fnctLine)
    status = curl_easy_setopt (
    curl, CURLOPT_WRITEFUNCTION, WriteMemoryCallback);
    if (status != CURLE_OK)
      break;
    
    VOLT_SET_FNCT_LINE (fnctLine)
    status = curl_easy_setopt (curl, CURLOPT_SSL_VERIFYPEER, 1);
    if (status != CURLE_OK)
      break;
      
    VOLT_SET_FNCT_LINE (fnctLine)
    status = curl_easy_setopt (curl, CURLOPT_SSL_VERIFYHOST, 1); 
    if (status != CURLE_OK)
      break;
        
    VOLT_SET_FNCT_LINE (fnctLine)
    status = curl_easy_setopt (curl, CURLOPT_NOPROGRESS, 1); 
    if (status != CURLE_OK)
      break;

#if  LIBCURL_VERSION_NUM >= 0x070a00
    VOLT_SET_FNCT_LINE (fnctLine)
    status = curl_easy_setopt(curl, CURLOPT_NOSIGNAL, 1);
    if (status != CURLE_OK)
      break;
#endif
    
    VT_ASSERT(curl != (CURL*)0);

    VOLT_SET_FNCT_LINE (fnctLine)
    status = curl_easy_setopt (curl, CURLOPT_ERRORBUFFER, errorBuf);
    if (status != CURLE_OK)
      break;
    
    VOLT_SET_FNCT_LINE (fnctLine)
    status = curl_easy_setopt (curl, CURLOPT_URL, url);
    if (status != CURLE_OK)
      break;
    
    VOLT_SET_FNCT_LINE (fnctLine)
    status = curl_easy_setopt (curl, CURLOPT_FILE, (void *)&mem);
    if (status != CURLE_OK)
      break;
    
    if (postData != (unsigned char *)0)
    {
      VOLT_SET_FNCT_LINE (fnctLine)
      status = curl_easy_setopt (curl, CURLOPT_POSTFIELDS, postData);
      if (status != CURLE_OK)
        break;
    }

    /* Set a timeout on curl requests. For this provider the time out value
     * will be passed in VtCurlTransportInfo struct.
     */
    timeOutFinal = timeOut/1000;

    /* In curl setting a time out value of 0 actually disables the time out.
     * so in that case set the time out to the minimum possible value.
     */
    if (timeOutFinal == 0)
      timeOutFinal = 1;

    VOLT_SET_FNCT_LINE (fnctLine)
    status = curl_easy_setopt (curl, CURLOPT_CONNECTTIMEOUT, timeOutFinal);
    if (status != CURLE_OK)
      break;

    /* Have to do this because curl automatically 
     * uses a default location
     */
    if (trustStore != (unsigned char *)0 )
    {
      VOLT_SET_FNCT_LINE (fnctLine)
      status = curl_easy_setopt (curl, CURLOPT_CAINFO, NULL);
      if (status != CURLE_OK)
        break;
      
      VOLT_SET_FNCT_LINE (fnctLine)
      status = curl_easy_setopt (curl, CURLOPT_CAPATH, trustStore);
      if (status != CURLE_OK)
        break;
    }
    
    /* Now we are ready to make the network connection. After we receive
     * the response we should see what kind of response it is
     */
    VOLT_SET_FNCT_LINE (fnctLine)
    status = curl_easy_perform (curl);
    if (status == CURLE_RECV_ERROR)
    {
      VOLT_SET_FNCT_LINE (fnctLine)
      status = curl_easy_perform(curl);
    }
    if (status != CURLE_OK)
      break;

    VOLT_SET_FNCT_LINE (fnctLine)
    status = curl_easy_getinfo (curl, CURLINFO_HTTP_CODE, responseCode);
    if (status != CURLE_OK)
      break;

    /* The NTLM authentication is supported by curl only in version
     * 7.10.6 or later. Make sure this code is compiled only for
     * curl 7.10.6 or later.
     */
#if   LIBCURL_VERSION_NUM >= 0x070a0d

    /* If the responseCode is 401 it means that server needs to authenticate
     * us first in order to fulfill the request. In that case we get the
     * authentication information from the password collector function
     */
    if (*responseCode == 401)
    {
      VOLT_SET_FNCT_LINE (fnctLine)
      status = PasswordCollector (
        libCtx, transCtx->userPassCtx.appData, idObj,
        VT_USER_PASS_COLLECTOR_PURPOSE_COLLECT,
        &userName, &userNameLen, &password, &passwordLen);
      if (status != 0)
        break;      
      
      /* set the authentication mechanism to be any safe mechanism supported
       * by curl because we don't want to pass the authentication information
       * in clear over the network.7.10.6
       */    
      VOLT_SET_FNCT_LINE (fnctLine)
      status = curl_easy_setopt (curl, CURLOPT_HTTPAUTH, CURLAUTH_NTLM);
      if (status != CURLE_OK)
        break;

    while (*responseCode == 401)
    {
      /* build the authntication string first */
      offset = 0;
      Z2Memcpy (authString, userName, userNameLen);
      offset += userNameLen;
      authString[offset] = ':';
      offset++;
      Z2Memcpy (authString + offset, password, passwordLen);
      offset += passwordLen;
      authString[offset] = 0;

      VOLT_SET_FNCT_LINE (fnctLine)
      status = curl_easy_setopt (curl, CURLOPT_USERPWD, authString);
      if (status != CURLE_OK)
        break;

      VOLT_SET_FNCT_LINE (fnctLine)
      status = curl_easy_perform (curl);
      if (status != CURLE_OK)
        break;

      VOLT_SET_FNCT_LINE (fnctLine)
      status = curl_easy_getinfo (curl, CURLINFO_HTTP_CODE, responseCode);
      if (status != CURLE_OK)
        break;

      if (*responseCode == 401)
      {
        VOLT_SET_FNCT_LINE (fnctLine)
        status = PasswordCollector (
          libCtx, transCtx->userPassCtx.appData, idObj,
          VT_USER_PASS_COLLECTOR_PURPOSE_COLLECT_RETRY,
          &userName, &userNameLen, &password, &passwordLen);
        if (status != 0)
          break;      
      }

    }   
    /* release the password collector data if we successfully collected
     * the password. If either one of userName or password is NON-NULL
     * we should treat it as a successful password collection.
     */
    if ( (userName != (unsigned char *)0) ||
          (password != (unsigned char *)0 ) )
    {
      PasswordCollector (
      libCtx, transCtx->userPassCtx.appData, idObj,
      VT_USER_PASS_COLLECTOR_PURPOSE_RELEASE,
      &userName, &userNameLen, &password, &passwordLen);
    }

  }  /* if response code was 401 */
#else
#warning "The version of curl installed doesn't support NTLM authentication. \
if you use windows style authentication, please update your curl  \
to at least version 7.10.6"
#endif

  } while (0);
  
  if (curl != (CURL*)0)
  {
    if (connectionCacheCtx != (VtConnectionCacheCtx)0)
    {
      curl_easy_reset(curl);

      if (isCachedConnection)
      {
        VOLT_SET_FNCT_LINE (fnctLine)
        status = connectionCacheCtx->ReleaseConnection(connectionCacheCtx,
          VOLT_CURL_CONNECTION_TYPE, (Pointer*) &curl);
      }
      else
      {
        VOLT_SET_FNCT_LINE (fnctLine)
        status = connectionCacheCtx->AddConnection(connectionCacheCtx,
          VOLT_CURL_CONNECTION_TYPE, (Pointer) curl, CurlDeleteConnection, 0);
        if (status == 0)
          curl = (CURL*)0;
      }
    }
    
    if (curl != (CURL*)0)
      curl_easy_cleanup (curl);
  }
  
  if (status == 0)
  {
   *response = mem.memory;
    return (0);
  }

  /* If there's an error, translate the curl error to toolkit error
   */
  switch (status)
  {
    case CURLE_URL_MALFORMAT :
    case CURLE_URL_MALFORMAT_USER :
    case CURLE_COULDNT_RESOLVE_PROXY :
    case CURLE_COULDNT_RESOLVE_HOST :
    case CURLE_UNSUPPORTED_PROTOCOL :
      status = VT_ERROR_URL;
      break;

    case CURLE_COULDNT_CONNECT :        
    case CURLE_RECV_ERROR :
      status = VT_ERROR_NETWORK_CONNECT;
      break;

    case CURLE_OPERATION_TIMEOUTED :
      status = VT_ERROR_TIMEOUT;
      break;

    case CURLE_SSL_CONNECT_ERROR :
    case CURLE_SSL_PEER_CERTIFICATE :
      status = VT_ERROR_DISTRICT_NOT_VERIFIED;
      break;

    case CURLE_SSL_CACERT:
      status = VT_ERROR_CANNOT_VERIFY_CERT;

    default:
      status = VT_ERROR_DOWNLOAD_FAILURE;
      break;
  }

  VOLT_LOG_ERROR (
    (VtLibCtx)libCtx, status, VT_ERROR_TYPE_PRIMARY | VT_ERROR_TYPE_OUTSIDE,
    fnctLine, "mDoHTTP", errorBuf)

  return  status;
}

#endif  /* VOLT_OS != VOLT_MACOSX */
#endif  /* VOLT_OS != VOLT_WINDOWS_32 */

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
激情图片小说一区| 亚洲狠狠丁香婷婷综合久久久| 青青青爽久久午夜综合久久午夜| 91麻豆精品国产91久久久资源速度 | 亚洲日本一区二区| 91网址在线看| 日日欢夜夜爽一区| 精品国产一区二区三区不卡| 国产成人免费av在线| 亚洲欧美日韩国产手机在线| 欧美日韩国产综合一区二区三区| 日本不卡一区二区三区| 精品对白一区国产伦| www.欧美日韩| 天天综合色天天综合| 欧美xxxxx牲另类人与| 成人国产精品视频| 天天综合色天天| 国产网站一区二区三区| 91成人在线观看喷潮| 老司机精品视频线观看86| 欧美国产精品一区二区三区| 在线观看日韩毛片| 精品一区二区三区在线播放视频 | 欧美刺激脚交jootjob| 成人听书哪个软件好| 亚洲一区二区成人在线观看| 精品国产欧美一区二区| 91丝袜美女网| 国产一区二区主播在线| 亚洲国产精品久久人人爱蜜臀| 欧美va天堂va视频va在线| 99re在线视频这里只有精品| 日韩国产在线一| 中文字幕在线播放不卡一区| 日韩视频一区二区在线观看| 91色综合久久久久婷婷| 久久99精品久久久久久久久久久久| 国产精品麻豆一区二区| 日韩午夜在线影院| 色噜噜狠狠色综合中国| 国产毛片精品一区| 亚洲第一电影网| 亚洲欧洲成人自拍| 精品国产露脸精彩对白| 欧美日韩综合一区| 成人a区在线观看| 国产九色精品成人porny| 亚洲成a人v欧美综合天堂下载| 国产精品国产三级国产普通话三级| 欧美日韩久久久一区| 99久久精品国产毛片| 国产精品白丝jk白祙喷水网站| 日本不卡一区二区| 亚洲成a人片在线观看中文| 亚洲欧美经典视频| 国产精品久久久久久久久动漫| 精品久久国产字幕高潮| 91精品黄色片免费大全| 欧美性欧美巨大黑白大战| av一二三不卡影片| 成人午夜视频在线| 国产成人在线色| 国产精品一卡二| 精品综合免费视频观看| 免费看黄色91| 老司机精品视频导航| 理论片日本一区| 免费在线看一区| 欧美96一区二区免费视频| 日韩电影在线免费看| 日韩成人一级大片| 日本亚洲三级在线| 麻豆精品一二三| 欧美a一区二区| 美美哒免费高清在线观看视频一区二区| 亚洲影视在线观看| 午夜欧美大尺度福利影院在线看| 亚洲午夜国产一区99re久久| 亚洲va欧美va天堂v国产综合| 亚洲一区二区三区视频在线| 亚洲成a人v欧美综合天堂下载| 亚洲va中文字幕| 欧美a级理论片| 国产一本一道久久香蕉| 成人夜色视频网站在线观看| 99久久精品免费看| 欧美午夜精品久久久久久孕妇 | 日韩欧美一区二区在线视频| 欧美大胆人体bbbb| 久久久精品综合| 国产精品久久精品日日| 夜夜嗨av一区二区三区网页| 午夜精品福利一区二区三区蜜桃| 秋霞影院一区二区| 国产福利视频一区二区三区| av在线一区二区三区| 欧美最新大片在线看| 91精品视频网| 国产亚洲精品7777| 亚洲欧美日韩综合aⅴ视频| 亚洲一区国产视频| 狠狠狠色丁香婷婷综合激情| 成人美女视频在线看| 欧美亚洲精品一区| 欧美成人vps| 亚洲婷婷综合色高清在线| 日韩精品乱码免费| 成人一级片在线观看| 欧美日韩成人在线一区| 2020国产精品自拍| 一区二区三区中文字幕| 精品亚洲成a人| 91麻豆免费观看| 日韩欧美亚洲另类制服综合在线| 国产精品美女一区二区| 日韩在线一区二区| 成人一区二区三区中文字幕| 欧美精品亚洲一区二区在线播放| 国产片一区二区| 日韩在线a电影| 91美女片黄在线观看91美女| 欧美成人伊人久久综合网| 亚洲日本一区二区三区| 国产一区免费电影| 欧美群妇大交群的观看方式| 中文字幕巨乱亚洲| 免费在线观看一区| 色狠狠色噜噜噜综合网| 国产日产欧产精品推荐色| 日韩精品成人一区二区在线| av在线一区二区| 久久亚洲捆绑美女| 婷婷久久综合九色国产成人| 成人高清免费在线播放| 2欧美一区二区三区在线观看视频| 一区二区三区不卡视频| 夫妻av一区二区| 精品国产乱码久久久久久影片| 亚洲已满18点击进入久久| 福利一区福利二区| 久久免费电影网| 久久精品国产一区二区| 欧美日韩高清在线| 洋洋成人永久网站入口| 成人高清av在线| 国产丝袜欧美中文另类| 九九精品视频在线看| 欧美一级xxx| 丝袜美腿亚洲综合| 91成人看片片| 一区二区三区在线视频免费| 97精品国产露脸对白| 欧美国产日韩在线观看| 国产精品自拍毛片| 久久看人人爽人人| 激情五月婷婷综合| 精品福利视频一区二区三区| 美女一区二区三区在线观看| 欧美二区在线观看| 日韩成人免费看| 日韩欧美中文字幕一区| 免费美女久久99| 日韩精品一区二区三区三区免费 | 亚洲一区二区美女| 欧美日韩中字一区| 三级一区在线视频先锋| 欧美精品粉嫩高潮一区二区| 天堂午夜影视日韩欧美一区二区| 欧美老肥妇做.爰bbww视频| 亚洲6080在线| 欧美一区二区大片| 精品在线播放午夜| 国产亚洲精品免费| 不卡的电影网站| 亚洲黄色av一区| 欧美日韩国产综合一区二区| 亚洲成人tv网| 日韩欧美国产综合| 国产91清纯白嫩初高中在线观看| 中文字幕中文字幕一区| 99精品视频一区二区三区| 亚洲黄色av一区| 欧美一区二区三区系列电影| 精品中文字幕一区二区小辣椒| 国产亚洲制服色| 色婷婷国产精品| 日韩高清不卡一区二区| 久久综合国产精品| 不卡电影免费在线播放一区| 一区二区三区欧美| 日韩一区二区在线播放| 国产精品1区2区| 亚洲精品亚洲人成人网在线播放| 欧美日韩精品一区二区三区蜜桃| 久草在线在线精品观看| 午夜欧美2019年伦理| 久久天天做天天爱综合色| 99精品欧美一区二区蜜桃免费 | 久久精品国产999大香线蕉|