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

? 歡迎來(lái)到蟲(chóng)蟲(chóng)下載站! | ?? 資源下載 ?? 資源專(zhuān)輯 ?? 關(guān)于我們
? 蟲(chóng)蟲(chóng)下載站

?? districtprov.c

?? IBE是一種非對(duì)稱(chēng)密碼技術(shù)
?? C
?? 第 1 頁(yè) / 共 2 頁(yè)
字號(hào):
/* Copyright 2003-2006, 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 "dsaparamsder.h"
#include "vtime.h"
#include "errorctx.h"

#if  VOLT_OS == VOLT_WINDOWS_32
#include <windows.h>
#include <wininet.h>
#endif


/* Build a VtParameterObject from the given parameters and public
 * point. The public point is the x-coordinate only.
 * <p>This call will create a new object and deposit at the address
 * given by paramObj.
 *
 * @param libraryCtx The lib ctx to use.
 * @param mpCtx
 * @param ecParams The EC params (prime, subprime, etc.) to use.
 * @param pubPoint The public point to use (x-coordinate).
 * @param paramObj The address where the function will deposit the
 * created and set parameter object.
 * @return an int, 0 if the function completed successfully or a
 * non-zero error code.
 */
static int VOLT_CALLING_CONV BuildParamObject VOLT_PROTO_LIST ((
   VtLibCtx libraryCtx,
   VoltMpIntCtx *mpCtx,
   EC_PARAMETERS *ecParams,
   ASN1_OCTET_STRING *pubPoint,
   VtParameterObject *paramObj
));

/* Extract the key schemas from the BER value and build the VtOidList
 * in the district object.
 * <p>The schemasBer is the BER encoding of the following ASN.1
 * definition.
 *
 *    SEQUENCE OF {
 *      oid           OBJECT IDENTIFIER }
 *
 * @param schemasBer The BER of the schemas, the value of the parameter
 * extension.
 * @param schemasBerLen The length, in bytes, of the input data.
 * @param obj The district object containing the VtOidList to fill with
 * the schemas.
 * @return an int, 0 if the function completed successfully or a
 * non-zero error code.
 */
static int VOLT_CALLING_CONV GetKeySchemas VOLT_PROTO_LIST ((
   unsigned char *schemasBer,
   unsigned int schemasBerLen,
   VoltDistrictObject *obj
));

/* Extract the DSA Params from the BER value and build the
 * VtDSAParamInfo struct in the district object.
 * <p>The paramsBer is the BER encoding of the following ASN.1
 * definition.
 *
 *    SEQUENCE {
 *      prime        INTEGER,
 *      subprime     INTEGER,
 *      base         INTEGER  }
 *
 * @param paramsBer The BER of the params, the value of the parameter
 * extension.
 * @param paramsBerLen The length, in bytes, of the input data.
 * @param obj The district object where the DSA params are to be
 * deposited.
 * @return an int, 0 if the function completed successfully or a
 * non-zero error code.
 */
static int VOLT_CALLING_CONV GetDSAParams VOLT_PROTO_LIST ((
   unsigned char *paramsBer,
   unsigned int paramsBerLen,
   VoltDistrictObject *obj
));

int mIcDistrictCreateObject (
   VtLibCtx libraryCtx,
   VDoHttp DoHttp,
   Pointer uiHandle,
   unsigned char *trustStore,
   unsigned long timeOut,
   mIcDistrictObject **mIcDistObj
   )
{
  mIcDistrictObject *newObj = (mIcDistrictObject *)0;
  VoltLibCtx *libCtx = (VoltLibCtx *)libraryCtx;
  VOLT_DECLARE_FNCT_LINE (fnctLine)

  /* Create an empty struct.
   */
  VOLT_SET_FNCT_LINE (fnctLine)
  newObj = (mIcDistrictObject *)Z2Malloc (sizeof (mIcDistrictObject), 0);
  if (newObj == (mIcDistrictObject *)0)
  {
    VOLT_LOG_ERROR (
      (VtLibCtx)libCtx, VT_ERROR_MEMORY, VT_ERROR_TYPE_PRIMARY, fnctLine,
      "mIcDistrictCreateObject", (char *)0)
    return (VT_ERROR_MEMORY);
  }
  Z2Memset (newObj, 0, sizeof (mIcDistrictObject));

  /* Fill in the fields.
   */
  newObj->libCtx = libCtx;
  newObj->DoHttp = mDoHTTP;
  newObj->uiHandle = uiHandle;
  newObj->trustStore = trustStore;  
  newObj->timeOut = timeOut;
  if (DoHttp != (VDoHttp)0)
    newObj->DoHttp = DoHttp;

  *mIcDistObj = newObj;

  return (0);
}

void mIcDistrictDestroyObject (
   mIcDistrictObject **mIcDistObj
   )
{
  mIcDistrictObject *obj;
  VoltLibCtx *libCtx;

  /* Anything to destroy?
   */
  if (mIcDistObj == (mIcDistrictObject **)0)
    return;
  if (*mIcDistObj == (mIcDistrictObject *)0)
    return;

  obj = *mIcDistObj;
  libCtx = obj->libCtx;

  /* If the fields are not NULL, free them.
   */
  if (obj->icParams != (icDistrictParameters *)0)
    icDistrictParametersFree (obj->icParams, libCtx);
  if (obj->paramsText != (char *)0)
    Z2Free (obj->paramsText);

  /* Free the outer shell.
   */
  Z2Free (obj);
}

int mIcDistrictRetrieveParams (
   unsigned char *domain,
   unsigned char *district,
   mIcDistrictObject *mIcDistObj,
   VtMpIntCtx mpCtx,
   VoltLibCtx *libCtx
   )
{
  int status;
  VOLT_DECLARE_FNCT_LINE (fnctLine)

  VOLT_SET_FNCT_LINE (fnctLine)
  status = icRetrieveDistrictParameters (
    &(mIcDistObj->icParams), &(mIcDistObj->paramsText), domain, district,
    mIcDistObj->DoHttp, (void *)(mIcDistObj->uiHandle), mIcDistObj->trustStore,
    mIcDistObj->timeOut, mpCtx, libCtx);

  /* If successful, we're done.
   */
  if (status == 0)
    return (0);

  /* If NETWORK_CONNECT, we couldn't find a server of the given name. Convert that
   * to UNKNOWN_DISTRICT.
   */
  if (status = VT_ERROR_NETWORK_CONNECT)
    status = VT_ERROR_UNKNOWN_DISTRICT;

  /* If error, free memory.
   */
  if (mIcDistObj->icParams != (icDistrictParameters *)0)
    icDistrictParametersFree (mIcDistObj->icParams, libCtx);
  if (mIcDistObj->paramsText != (char *)0)
    Z2Free (mIcDistObj->paramsText);
  mIcDistObj->icParams = (icDistrictParameters *)0;
  mIcDistObj->paramsText = (char *)0;

  VOLT_LOG_ERROR (
    (VtLibCtx)libCtx, status, 0, fnctLine,
    "mIcDistrictRetrieveParams", (char *)0)

  return (status);
}

int VoltSetDistFromParamsText (
   char *paramsText,
   unsigned int paramsTextLen,
   VoltDistrictObject *distObj,
   VoltMpIntCtx *mpCtx,
   VoltLibCtx *libCtx
   )
{
  int status;
  icDistrictParameters *icParams = (icDistrictParameters *)0;
  VOLT_DECLARE_FNCT_LINE (fnctLine)

  do
  {
    /* Build the icParams struct from the paramsText.
     */
    VOLT_SET_FNCT_LINE (fnctLine)
    status = icDistrictParametersNew (
      &icParams, paramsText, paramsTextLen, (VtMpIntCtx)mpCtx, libCtx);
    if (status != 0)
      break;

    /* Now set from the icParams.
     */
    VOLT_SET_FNCT_LINE (fnctLine)
    status = VoltSetDistFromIcParams (
      paramsText, paramsTextLen, icParams, mpCtx, distObj);

  } while (0);

  if (icParams != (icDistrictParameters *)0)
    icDistrictParametersFree (icParams, libCtx);

  VOLT_LOG_ERROR_COMPARE (
    status, (VtLibCtx)libCtx, status, 0, fnctLine,
    "mIcDistrictRetrieveParams", (char *)0)

  return (status);
}

int VoltSetDistFromIcParams (
   char *paramsText,
   unsigned int paramsTextLen,
   icDistrictParameters *icParams,
   VoltMpIntCtx *mpCtx,
   VoltDistrictObject *obj
   )
{
  int status, count, index;
  unsigned int certIndex, tempLen;
  VoltLibCtx *libCtx = (VoltLibCtx *)(obj->voltObject.libraryCtx);
  unsigned char *temp;
  IC_USAGE_PARAMS *usageParams;
  VtUsageParams *currentUsageParams;
  EC_PARAMETERS *paramsToUse;
  Asn1X509Extension *extension;
  VtX509Extension *currentExtension;
  VtCertObject newCert = (VtCertObject)0;  
  unsigned char *certBuffer = (unsigned char *)0;
  VtDerCoder *derCoders[1] = { VtDerCoderDSAPublicKey };
  VtCertInfo certInfo;
  unsigned char type1Oid[VoltBFType1IBECurveOidBytesLen] =
    { VoltBFType1IBECurveOidBytes };
  unsigned char keySchemaOid[VoltParamExtKeySchemaOidBytesLen] =
    { VoltParamExtKeySchemaOidBytes };
  unsigned char dsaParamsExtOid[VoltParamExtDsaParamsOidBytesLen] =
    { VoltParamExtDsaParamsOidBytes };
  VOLT_DECLARE_ERROR_TYPE (errorType)
  VOLT_DECLARE_FNCT_LINE (fnctLine)

  /* This supports only one kind of cert.
   */
  certInfo.derCoders = derCoders;
  certInfo.derCoderCount = 1;

  do
  {
    /* Make sure these are type 1 params.
     */
    tempLen = (unsigned int)(icParams->pubParams->defECParams->curve->type->length);
    temp = icParams->pubParams->defECParams->curve->type->data;

    VOLT_SET_ERROR_TYPE (errorType, VT_ERROR_TYPE_PRIMARY)
    VOLT_SET_FNCT_LINE (fnctLine)
    status = VT_ERROR_CURVE_TYPE_NOT_SUPPORTED;
    if (tempLen != VoltBFType1IBECurveOidBytesLen)
      break;
    if (Z2Memcmp (temp, type1Oid, VoltBFType1IBECurveOidBytesLen) != 0)
      break;

    /* Get the validity dates. Convert to VtTime. The time in the
     * encoding is either UTC or GeneralizedTime.
     */
    VOLT_SET_ERROR_TYPE (errorType, 0)
    temp = icParams->pubParams->validity->notBefore->data;
    tempLen = (unsigned int)
      (icParams->pubParams->validity->notBefore->length);
    if (tempLen == VOLT_UTC_LEN)
    {
      VOLT_SET_FNCT_LINE (fnctLine)
      status = VoltConvertUTCToVtTime (libCtx, temp, &(obj->validityStart));
    }
    else
    {
      VOLT_SET_FNCT_LINE (fnctLine)
      status = VoltConvertGenTimeToVtTime (
        libCtx, temp, tempLen, &(obj->validityStart));
    }
    if (status != 0)
      break;

    temp = icParams->pubParams->validity->notAfter->data;
    tempLen = (unsigned int)
      (icParams->pubParams->validity->notAfter->length);
    if (tempLen == VOLT_UTC_LEN)
    {
      VOLT_SET_FNCT_LINE (fnctLine)
      status = VoltConvertUTCToVtTime (libCtx, temp, &(obj->validityEnd));
    }
    else
    {
      VOLT_SET_FNCT_LINE (fnctLine)
      status = VoltConvertGenTimeToVtTime (
        libCtx, temp, tempLen, &(obj->validityEnd));
    }
    if (status != 0)
      break;

    /* Build the default parameter object.
     */
    VOLT_SET_FNCT_LINE (fnctLine)
    status = BuildParamObject (
      obj->voltObject.libraryCtx, mpCtx, icParams->pubParams->defECParams,
      icParams->pubParams->defReference, &(obj->paramObj));
    if (status != 0)
      break;

    /* We need the qualified district name.
     */
    VOLT_SET_FNCT_LINE (fnctLine)
    status = mIcDistParamsGetDistrictName (icParams, obj);
    if (status != 0)
      break;

    /* Get UsageParams out.
     */
    count = sk_num (icParams->pubParams->usageParams);
    if (count != 0)
    {
      /* Create the array of UsageParams structs.
       */
      VOLT_SET_ERROR_TYPE (errorType, VT_ERROR_TYPE_PRIMARY)
      VOLT_SET_FNCT_LINE (fnctLine)
      status = VT_ERROR_MEMORY;
      obj->usageParamsList.paramsList = (VtUsageParams *)Z2Malloc (
        sizeof (VtUsageParams) * count, 0);
      if (obj->usageParamsList.paramsList == (VtUsageParams *)0)
        break;
      Z2Memset (
        obj->usageParamsList.paramsList, 0, sizeof (VtUsageParams) * count);
      obj->usageParamsList.count = (unsigned int )count;

      /* Build each of the objects and copy the OID's.
       */
      for (index = 0; index < count; ++index)
      {
        usageParams = (IC_USAGE_PARAMS *)sk_value (
          icParams->pubParams->usageParams, index);
        currentUsageParams =
          (VtUsageParams *)&(obj->usageParamsList.paramsList[index]);

        /* Copy the OID.
         */
        VOLT_SET_ERROR_TYPE (errorType, VT_ERROR_TYPE_PRIMARY)
        VOLT_SET_FNCT_LINE (fnctLine)
        status = VT_ERROR_MEMORY;
        currentUsageParams->oid.data = (unsigned char *)Z2Malloc (
          usageParams->usage->length, 0);
        if (currentUsageParams->oid.data == (unsigned char *)0)
          break;
        Z2Memcpy (
          currentUsageParams->oid.data, usageParams->usage->data,
          usageParams->usage->length);
        currentUsageParams->oid.len =
          (unsigned int)(usageParams->usage->length);

        /* Build the param object. If the given usage params do not
         * include the EC Params, use the default params.
         */
        paramsToUse = usageParams->ecParams;
        if (paramsToUse == (EC_PARAMETERS *)0)
          paramsToUse = icParams->pubParams->defECParams;
        VOLT_SET_ERROR_TYPE (errorType, 0)
        VOLT_SET_FNCT_LINE (fnctLine)
        status = BuildParamObject (
          obj->voltObject.libraryCtx, mpCtx, paramsToUse,
          usageParams->reference, &(currentUsageParams->params));
        if (status != 0)
          break;
      }
      if (status != 0)
        break;
    }

    /* Get the extensions out.
     */
    count = sk_num (icParams->pubParams->extensions);
    if (count != 0)
    {
      /* Create the array of Extension structs.
       */
      VOLT_SET_ERROR_TYPE (errorType, VT_ERROR_TYPE_PRIMARY)
      VOLT_SET_FNCT_LINE (fnctLine)
      status = VT_ERROR_MEMORY;
      obj->extensionList.extensions = (VtX509Extension *)Z2Malloc (
        sizeof (VtX509Extension) * count, 0);
      if (obj->extensionList.extensions == (VtX509Extension *)0)
        break;
      Z2Memset (
        obj->extensionList.extensions, 0, sizeof (VtX509Extension) * count);
      obj->extensionList.count = (unsigned int )count;

      /* Copy each extension. At the same time, look for the supported
       * key schemas extension and the DSA params extension.
       */
      for (index = 0; index < count; ++index)
      {
        extension = (Asn1X509Extension *)sk_value (
          icParams->pubParams->extensions, index);
        currentExtension = &(obj->extensionList.extensions[index]);

        /* Copy the OID.
         */
        VOLT_SET_ERROR_TYPE (errorType, VT_ERROR_TYPE_PRIMARY)
        VOLT_SET_FNCT_LINE (fnctLine)
        status = VT_ERROR_MEMORY;
        currentExtension->oid.data = (unsigned char *)Z2Malloc (
          extension->oid->base.length, 0);
        if (currentExtension->oid.data == (unsigned char *)0)
          break;
        Z2Memcpy (
          currentExtension->oid.data, extension->oid->base.data,
          extension->oid->base.length);
        currentExtension->oid.len = (unsigned int)(extension->oid->base.length);

        /* Copy the extension data.
         */
        currentExtension->value.data = (unsigned char *)Z2Malloc (
          extension->value->length, 0);
        if (currentExtension->value.data == (unsigned char *)0)
          break;
        Z2Memcpy (
          currentExtension->value.data, extension->value->data,
          extension->value->length);
        currentExtension->value.len = (unsigned int)(extension->value->length);

        /* Set the criticality.
         */
        currentExtension->critical = 0;
        if (extension->critical != 0)
          currentExtension->critical = 1;

        status = 0;

        /* If this is the supported key schemas extension, copy the
         * OID's out.
         */
        if (currentExtension->oid.len == VoltParamExtKeySchemaOidBytesLen)
        {
          if (Z2Memcmp (
            currentExtension->oid.data, keySchemaOid,
            VoltParamExtKeySchemaOidBytesLen) == 0)
          {
            /* This is the key schema extension.
             */
            VOLT_SET_ERROR_TYPE (errorType, 0)
            VOLT_SET_FNCT_LINE (fnctLine)
            status = GetKeySchemas (
              currentExtension->value.data, currentExtension->value.len, obj);
            if (status != 0)
              break;
          }
        }

?? 快捷鍵說(shuō)明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
精品国产乱码久久久久久免费| 综合久久久久久久| 欧美一区二区三区免费在线看 | 在线综合视频播放| 欧美视频在线播放| 91久久精品午夜一区二区| 91网站最新地址| 99在线精品观看| 色综合久久九月婷婷色综合| 99精品热视频| 色素色在线综合| 欧美日韩一级视频| 91精品国产麻豆国产自产在线| 欧美精品在线观看播放| 3d动漫精品啪啪1区2区免费| 欧美一区二区三区免费观看视频| 日韩精品中文字幕在线一区| 精品国产一二三区| 国产视频亚洲色图| 欧美极品美女视频| 一区二区久久久| 三级一区在线视频先锋| 精品一区二区三区av| 国产精品18久久久久久久网站| 成人性色生活片免费看爆迷你毛片| 国产成人精品aa毛片| 亚洲日本va午夜在线电影| 亚洲综合999| 麻豆国产欧美一区二区三区| 国产精品一区一区三区| 91在线国产观看| 精品视频一区三区九区| 精品日韩在线观看| 中文字幕在线观看不卡| 亚洲国产日韩a在线播放性色| 日本不卡视频在线观看| 国产suv精品一区二区三区| 91福利资源站| 久久综合中文字幕| 亚洲色图20p| 激情久久五月天| 91久久精品一区二区| 精品人在线二区三区| 亚洲三级在线免费| 狠狠色丁香九九婷婷综合五月| 成人黄色小视频在线观看| 91麻豆精品国产91久久久| 国产精品欧美久久久久一区二区 | 久久99精品网久久| 91在线观看一区二区| 日韩一区二区免费在线电影| 国产午夜一区二区三区| 一级中文字幕一区二区| 国产精品伊人色| 欧美日韩另类一区| 国产午夜精品福利| 男人的j进女人的j一区| 99热在这里有精品免费| 精品国产乱码久久久久久久久| 亚洲色图制服诱惑| 国产精品亚洲人在线观看| 欧美欧美午夜aⅴ在线观看| 欧美高清在线一区二区| 免费欧美在线视频| 欧美性猛片aaaaaaa做受| 国产欧美日韩久久| 奇米色777欧美一区二区| 99久久国产综合精品麻豆| 精品伦理精品一区| 亚洲mv大片欧洲mv大片精品| eeuss鲁一区二区三区| 久久综合资源网| 男男成人高潮片免费网站| 色综合久久中文综合久久97| 日本一区二区免费在线观看视频| 日韩成人免费看| 在线观看三级视频欧美| 国产精品美女久久久久aⅴ | 欧美一区二区二区| 亚洲夂夂婷婷色拍ww47| 国产69精品久久777的优势| 制服丝袜亚洲播放| 一区二区三区视频在线看| 播五月开心婷婷综合| 久久免费的精品国产v∧| 欧美一区二区三区四区五区| 伊人一区二区三区| 91国产精品成人| 亚洲欧美国产毛片在线| 99精品视频一区| 中文字幕在线免费不卡| 成人av高清在线| 国产欧美一区二区精品性| 国产一区久久久| 久久综合色8888| 国产一区二区三区久久久| 欧美成人精品二区三区99精品| 青青草视频一区| 欧美电影免费观看高清完整版在线| 日本欧美一区二区在线观看| 欧美乱熟臀69xxxxxx| 日韩综合在线视频| 欧美一区三区二区| 欧美96一区二区免费视频| 日韩一区二区视频在线观看| 欧美a一区二区| 精品国产青草久久久久福利| 久久99精品久久只有精品| 久久无码av三级| 国产九色sp调教91| 成人av动漫网站| 亚洲乱码日产精品bd| 在线精品国精品国产尤物884a| 亚洲精品国产精华液| 欧美三级欧美一级| 午夜欧美一区二区三区在线播放 | 一区二区三区在线影院| 一本到高清视频免费精品| 亚洲一区影音先锋| 欧美日韩精品是欧美日韩精品| 图片区日韩欧美亚洲| 日韩免费观看2025年上映的电影| 极品瑜伽女神91| 国产精品免费视频网站| 91搞黄在线观看| 麻豆精品蜜桃视频网站| 国产午夜精品久久| 色婷婷精品久久二区二区蜜臀av| 亚洲不卡一区二区三区| 日韩精品专区在线影院观看| 国产高清精品在线| 亚洲精品福利视频网站| 91精品免费在线| 成人久久视频在线观看| 夜夜揉揉日日人人青青一国产精品| 91精品国产综合久久精品| 国产中文字幕精品| 亚洲黄色免费网站| 欧美一级一区二区| 国产99久久久久久免费看农村| 一区二区国产视频| 2021中文字幕一区亚洲| 99国产精品国产精品久久| 日韩精品一二区| 国产日韩欧美高清| 欧美放荡的少妇| 成人美女视频在线观看18| 日本最新不卡在线| 18涩涩午夜精品.www| 91精品国产aⅴ一区二区| 岛国一区二区在线观看| 日日夜夜一区二区| 国产精品久久久久久久裸模| 91精品久久久久久久99蜜桃| 成人午夜电影小说| 奇米一区二区三区| 亚洲欧美日韩国产成人精品影院 | 午夜免费久久看| 中文字幕国产一区二区| 欧美巨大另类极品videosbest | 精品伊人久久久久7777人| 亚洲免费色视频| 久久亚洲免费视频| 欧美日韩国产综合草草| www.av亚洲| 国产在线播放一区二区三区 | 97精品久久久午夜一区二区三区| 天天影视网天天综合色在线播放| 国产精品国产三级国产普通话蜜臀 | 91片在线免费观看| 国产剧情在线观看一区二区| 午夜精品在线看| 亚洲精品视频自拍| 国产嫩草影院久久久久| 在线电影一区二区三区| 91麻豆精品一区二区三区| 国产麻豆成人传媒免费观看| 视频一区中文字幕国产| 一区二区三区精品在线观看| 国产欧美日韩精品在线| 欧美mv日韩mv| 欧美一区二区三区的| 欧美日韩亚洲丝袜制服| 91老师国产黑色丝袜在线| 国产91在线观看丝袜| 国内一区二区在线| 久久精品久久综合| 视频一区二区不卡| 午夜激情久久久| 亚洲图片欧美综合| 一区二区三区在线播| 成人免费在线视频观看| 欧美激情中文字幕一区二区| 国产亚洲精品bt天堂精选| 久久久久一区二区三区四区| 精品国产91乱码一区二区三区| 91精品国产欧美一区二区成人| 911国产精品| 在线播放/欧美激情| 在线播放中文一区|