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

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

?? readenvtype.c

?? IBE是一種非對稱密碼技術
?? C
字號:
/* Copyright 2003-2006, Voltage Security, all rights reserved.
 */
#include "vibe.h"
#include "environment.h"
#include "base.h"
#include "libctx.h"
#include "p7obj.h"
#include "idobj.h"
#include "derhelp.h"
#include "oidlist.h"
#include "errorctx.h"

int VtPkcs7ImplReadEnvelopedData (
   VtPkcs7Object *object,
   Pointer info,
   unsigned int flag
   )
{
  int status;
#if VOLT_ALIGNMENT != 1
  unsigned int pad;
#endif
  unsigned int index, bufferSize, offset;
  unsigned int listToUseCount = 0, decodersToUseCount = 0;
  VoltPkcs7Object *obj = (VoltPkcs7Object *)(*object);
  VoltLibCtx *libCtx = (VoltLibCtx *)(obj->voltObject.libraryCtx);
  VtReadPkcs7Info *readInfo;
  VtDerCoder **ListToUse = (VtDerCoder **)0;
  VtIdentitySchemaDecode **DecodersToUse = (VtIdentitySchemaDecode **)0;
  VtDERCoderArray *derCoderArray;
  VtSchemaDecodeArray *schemaDecodeArray;
  VtMpIntCtx mpCtxToUse = (VtMpIntCtx)0;
  unsigned char *buffer = (unsigned char *)0;
  VoltPkcs7ReadEnvCtx *readCtx;
  VOLT_DECLARE_ERROR_TYPE (errorType)
  VOLT_DECLARE_FNCT_LINE (fnctLine)

  do
  {
    VOLT_SET_ERROR_TYPE (errorType, VT_ERROR_TYPE_PRIMARY)
    VOLT_SET_FNCT_LINE (fnctLine)
    status = VT_ERROR_INVALID_TYPE;
    if (flag != VOLT_PKCS7_SET_TYPE_FLAG)
      break;

    /* Make sure the object is empty.
     */
    VOLT_SET_FNCT_LINE (fnctLine)
    status = VT_ERROR_INVALID_P7_OBJ;
    if ( (obj->contentType != 0) || (obj->localCtx != (Pointer)0) )
      break;

    /* Check the info. If there's no info, get it from the libCtx.
     */
    VOLT_SET_FNCT_LINE (fnctLine)
    status = VT_ERROR_INVALID_ASSOCIATED_INFO;
    if (info != (Pointer)0)
    {
      readInfo = (VtReadPkcs7Info *)info;
      ListToUse = readInfo->derCoders;
      listToUseCount = readInfo->derCoderCount;
      DecodersToUse = readInfo->decoders;
      decodersToUseCount = readInfo->decoderCount;
      mpCtxToUse = readInfo->mpCtx;
    }

    /* If we don't have any DerCoder's get the ones in the libCtx. If
     * there are none there, break, that's an error.
     */
    if ( (ListToUse == (VtDerCoder **)0) || (listToUseCount == 0) )
    {
      derCoderArray = (VtDERCoderArray *)VoltGetLibCtxInfo (
        obj->voltObject.libraryCtx, VOLT_LIB_CTX_INFO_TYPE_DER_CODERS);

      VOLT_SET_FNCT_LINE (fnctLine)
      status = VT_ERROR_NO_DER_CODERS;
      if (derCoderArray == (VtDERCoderArray *)0)
        break;

      ListToUse = derCoderArray->derCoders;
      listToUseCount = derCoderArray->derCoderCount;
    }

    /* If we don't have any SchemaDecode's get the ones in the libCtx.
     * If there are none there, break, that's an error.
     */
    if ( (DecodersToUse == (VtIdentitySchemaDecode **)0) ||
         (decodersToUseCount == 0) )
    {
      schemaDecodeArray = (VtSchemaDecodeArray *)VoltGetLibCtxInfo (
        obj->voltObject.libraryCtx, VOLT_LIB_CTX_INFO_TYPE_SCHEMA_DECODES);

      VOLT_SET_FNCT_LINE (fnctLine)
      status = VT_ERROR_NO_SCHEMA_DECODERS;
      if (schemaDecodeArray == (VtSchemaDecodeArray *)0)
        break;

      DecodersToUse = schemaDecodeArray->decoders;
      decodersToUseCount = schemaDecodeArray->decoderCount;
    }

    /* If we don't have an mpCtx, get one from the libCtx. If there is
     * not one there, break, that's an error.
     */
    if (mpCtxToUse == (VtMpIntCtx)0)
    {
      mpCtxToUse = (VtMpIntCtx)VoltGetLibCtxInfo (
        obj->voltObject.libraryCtx, VOLT_LIB_CTX_INFO_TYPE_MP_CTX);

      VOLT_SET_FNCT_LINE (fnctLine)
      status = VT_ERROR_NO_MATH_LIBRARY;
      if (mpCtxToUse == (VtMpIntCtx)0)
        break;
    }

    /* Paranoid programming check.
     */
    VOLT_SET_FNCT_LINE (fnctLine)
    status = VT_ERROR_INVALID_MP_INT_CTX;
    if (VOLT_OBJECT_TYPE_NOT_EQUAL (mpCtxToUse, VOLT_OBJECT_TYPE_MP_INT_CTX))
      break;

    /* Build a buffer big enough to hold the readCtx, the coder array,
     * and the schema decode's. Assume that the array of DerCoder
     * pointers will not throw off the pad.
     */
    VOLT_SET_FNCT_LINE (fnctLine)
    status = VT_ERROR_MEMORY;
    bufferSize =
      sizeof (VoltPkcs7ReadEnvCtx) + (listToUseCount * sizeof (VtDerCoder *)) +
      decodersToUseCount * sizeof (VtIdentitySchemaDecode *);
#if VOLT_ALIGNMENT != 1
    /* If the alignment is 1, there's no need to pad. If not, compute
     * the pad length.
     */
    VOLT_COMPUTE_ALIGN_PAD (
      VOLT_ALIGNMENT, sizeof (VoltPkcs7ReadEnvCtx), pad)
      bufferSize += pad;
#endif
    buffer = (unsigned char *)Z2Malloc (bufferSize, 0);
    if (buffer == (unsigned char *)0)
      break;
    Z2Memset (buffer, 0, bufferSize);

    /* Locate the pointers.
     */
    readCtx = (VoltPkcs7ReadEnvCtx *)buffer;
    offset = sizeof (VoltPkcs7ReadEnvCtx);
#if VOLT_ALIGNMENT != 1
    offset += pad;
#endif

    /* Copy the DerCoders array.
     */
    readCtx->DerCoders = (VtDerCoder **)(buffer + offset);
    for (index = 0; index < listToUseCount; ++index)
      readCtx->DerCoders[index] = ListToUse[index];
    readCtx->derCoderCount = listToUseCount;

    /* Copy the schemaDecode's.
     */
    offset += listToUseCount * sizeof (VtDerCoder *);
    readCtx->Decoders = (VtIdentitySchemaDecode **)(buffer + offset);
    for (index = 0; index < decodersToUseCount; ++index)
      readCtx->Decoders[index] = DecodersToUse[index];
    readCtx->decoderCount = decodersToUseCount;

    /* Clone the mpCtx.
     */
    VOLT_SET_ERROR_TYPE (errorType, 0)
    VOLT_SET_FNCT_LINE (fnctLine)
    status = VtCloneObject (
      (Pointer)mpCtxToUse, (Pointer *)&(readCtx->mpCtx));
    if (status != 0)
      break;

    /* This must be initialized to a negative number so we know it has
     * not been determined yet.
     */
    readCtx->chosenRecipient = -1;

    obj->state = VOLT_P7_STATE_ENV_READ_SET;
    obj->localCtx = (Pointer)readCtx;
    obj->LocalCtxDestroy = VoltReadEnvCtxDestroy;
    obj->contentType = VOLT_PKCS7_ENVELOPED_DATA_READ;
    obj->ReadInit = VoltP7ReadEnvelopedInit;
    obj->ReadUpdate = VoltP7ReadEnvelopedUpdate;
    obj->ReadFinal = VoltP7ReadEnvelopedFinal;

    status = 0;

  } while (0);

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

  /* If there was an error, destroy what we created.
   */
  if (buffer != (unsigned char *)0)
    Z2Free (buffer);

  VOLT_LOG_ERROR_INFO (
    0, *object, status, 0, errorType,
    (char *)0, "VtPkcs7ImplReadEnvelopedData", fnctLine, (char *)0)

  return (status);
}

void VoltReadEnvCtxDestroy (
   Pointer obj,
   Pointer ctx
   )
{
  unsigned int index;
  VoltObject *voltObj = (VoltObject *)obj;
  VoltLibCtx *libCtx;
  VoltPkcs7ReadEnvCtx *readCtx = (VoltPkcs7ReadEnvCtx *)ctx;

  /* Anything to destroy?
   */
  if ( (obj == (Pointer)0) || (ctx == (Pointer)0) )
    return;

  libCtx = (VoltLibCtx *)(voltObj->libraryCtx);

  if (readCtx->symKeyData.data != (unsigned char *)0)
    Z2Free (readCtx->symKeyData.data);

  if (readCtx->symAlgID != (unsigned char *)0)
    Z2Free (readCtx->symAlgID);

  if (readCtx->currentElement.element != (unsigned char *)0)
    Z2Free (readCtx->currentElement.element);

  for (index = 0; index < readCtx->recipInfoCount; ++index)
  {
    if (readCtx->recipInfoList[index] != (Asn1RecipientInfo *)0)
      Asn1RecipientInfo_free (readCtx->recipInfoList[index]);
  }
  if (readCtx->recipInfoList != (Asn1RecipientInfo **)0)
    Z2Free (readCtx->recipInfoList);

  VtDestroyMpIntCtx (&(readCtx->mpCtx));
  VtDestroyIdentityList (&(readCtx->recipList));
  VtDestroyAlgorithmObject (&(readCtx->decryptor));
  VtDestroyAlgorithmObject (&(readCtx->base64));
  VtDestroyKeyObject (&(readCtx->priKey));
  VtDestroyIdentityObject (&(readCtx->specifiedIdentity));
  VtDestroyRecipientInfoList (&(readCtx->rInfoList));

  Z2Free (ctx);
}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲另类在线制服丝袜| 亚洲欧美日韩国产另类专区| 国产精品久久久久一区二区三区共| 亚洲日本韩国一区| 精品无人区卡一卡二卡三乱码免费卡 | 国产在线精品一区二区夜色 | 综合久久国产九一剧情麻豆| 视频一区视频二区中文| 99re热这里只有精品视频| 日韩久久精品一区| 性做久久久久久免费观看欧美| 成人av网站在线| 欧美videos大乳护士334| 亚洲第一久久影院| av电影在线观看不卡| 久久视频一区二区| 六月丁香综合在线视频| 91精品国产综合久久国产大片| 国产suv精品一区二区三区| 欧美不卡视频一区| 蜜臀精品久久久久久蜜臀| 欧美日韩视频不卡| 亚洲一级电影视频| 9i看片成人免费高清| 欧美国产日韩亚洲一区| 美女看a上一区| 欧美电视剧在线观看完整版| 日韩在线一区二区| 91麻豆精品国产综合久久久久久 | 国产一区二区三区最好精华液| 欧美日韩一区不卡| 亚洲综合在线电影| 欧美在线色视频| 夜夜嗨av一区二区三区| 色狠狠一区二区| 亚洲一区二区三区影院| 欧美性生活久久| 婷婷综合在线观看| 91精品国产综合久久小美女| 日本vs亚洲vs韩国一区三区| 日韩欧美一级特黄在线播放| 久久99久久99小草精品免视看| 日韩欧美中文字幕一区| 狠狠色狠狠色综合| 国产欧美一区二区三区鸳鸯浴 | 国产在线一区观看| xfplay精品久久| 国产综合色在线| 欧美高清在线精品一区| 91天堂素人约啪| 亚洲一区二区精品视频| 欧美一级黄色大片| 成人综合激情网| 亚洲黄一区二区三区| 欧美一区二区三区在线看| 国产一区 二区 三区一级| 国产精品私人影院| 91久久精品网| 玖玖九九国产精品| 中文字幕制服丝袜一区二区三区 | 日韩电影免费在线观看网站| 精品久久久久久久久久久院品网| 国产一区二区精品久久99| 国产精品天美传媒| 欧美日韩一区国产| 国产一区二区三区国产| 亚洲精品国产a久久久久久| 91精品国模一区二区三区| 国产精品自拍av| 一区二区三区在线免费播放| 欧美电视剧在线看免费| 91麻豆高清视频| 捆绑变态av一区二区三区| 亚洲欧美在线高清| 日韩精品一区二区三区蜜臀 | 国内精品第一页| 亚洲欧洲精品一区二区三区不卡| 欧美日韩成人一区| 成人永久aaa| 舔着乳尖日韩一区| 中文字幕在线不卡一区| 欧美美女一区二区| 成人av第一页| 免费黄网站欧美| 亚洲自拍偷拍欧美| 国产精品视频免费| 精品欧美黑人一区二区三区| 国产精品三级av| 极品销魂美女一区二区三区| 一区二区三区四区在线免费观看| 精品国产第一区二区三区观看体验| 色哟哟精品一区| 成人福利视频在线看| 久久精品99国产精品| 亚洲黄色小视频| 久久美女艺术照精彩视频福利播放| 欧美在线你懂得| 91影院在线观看| 丁香婷婷综合五月| 国产一区在线看| 久久精品99国产精品| 青青青伊人色综合久久| 亚洲成va人在线观看| 中文字幕综合网| 国产精品久久久久影院色老大| 久久亚洲精品国产精品紫薇| 日韩一区和二区| 欧美精品xxxxbbbb| 欧美色涩在线第一页| 欧美日韩在线播| 69久久99精品久久久久婷婷| 在线区一区二视频| 欧美性大战久久久久久久| 日本高清不卡视频| 在线免费精品视频| 欧美又粗又大又爽| 欧美三区在线视频| 欧美一区二区国产| 日韩欧美你懂的| 2020国产精品自拍| 久久久美女毛片| 欧美国产精品一区二区三区| 欧美国产精品久久| 亚洲人妖av一区二区| 亚洲精品videosex极品| 亚洲综合色区另类av| 天堂影院一区二区| 久久99国产精品免费| 国产精品白丝jk黑袜喷水| 成人性视频网站| 97se亚洲国产综合在线| 欧美体内she精高潮| 91精品国产综合久久久蜜臀图片 | 一本大道久久a久久综合| 色老汉av一区二区三区| 欧美日本视频在线| 日韩精品一区二区三区蜜臀 | 久久亚洲免费视频| 国产精品福利一区二区| 一区二区三区不卡视频在线观看 | 欧美一级生活片| 久久一日本道色综合| 中文字幕五月欧美| 亚洲国产欧美一区二区三区丁香婷| 亚洲成人一区在线| 国产综合久久久久影院| 波多野结衣中文字幕一区二区三区 | 自拍偷拍亚洲激情| 午夜精品久久久久久久99樱桃| 久久精品二区亚洲w码| 欧美一区二区三区色| 欧美三级在线看| 国产亚洲精品7777| 亚洲国产wwwccc36天堂| 国内久久婷婷综合| 91国产免费看| 国产精品天干天干在线综合| 日韩欧美一区电影| 亚洲精品乱码久久久久久久久 | 亚洲视频图片小说| 日日夜夜免费精品| eeuss国产一区二区三区| 91精品国产一区二区三区蜜臀| 国产亚洲综合性久久久影院| 亚洲综合偷拍欧美一区色| 国产精品影音先锋| 欧美日韩亚洲不卡| 国产精品看片你懂得| 蜜臀av性久久久久蜜臀aⅴ四虎| 成人av资源下载| 日韩欧美第一区| 亚洲一区在线视频| 成人蜜臀av电影| 欧美一二三区在线| 亚洲大片免费看| 99精品视频在线观看| 国产色婷婷亚洲99精品小说| 日本不卡一区二区| 在线免费观看成人短视频| 国产精品久久久久久久久晋中 | 亚洲一卡二卡三卡四卡| 国产成人av一区二区三区在线| 91精品免费观看| 亚洲mv大片欧洲mv大片精品| 99精品欧美一区二区三区综合在线| 精品成人一区二区三区四区| 亚洲一区二区在线视频| 99久久婷婷国产综合精品| 久久女同精品一区二区| 狠狠色综合色综合网络| 91精品国产入口| 亚洲国产中文字幕在线视频综合| 成a人片亚洲日本久久| 国产精品视频一二三| 国产91精品一区二区麻豆亚洲| 日韩欧美电影一区| 激情五月婷婷综合| 久久午夜电影网| 韩国精品免费视频| 久久精品一区四区|