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

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

?? smreadtype.c

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

int VtSecureMailImplRead (
   VtSecureMailObject *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;
  VoltSecureMailObject *obj = (VoltSecureMailObject *)(*object);
  VoltLibCtx *libCtx = (VoltLibCtx *)(obj->voltObject.libraryCtx);
  VtReadSecureMailInfo *readInfo;
  VtDerCoder **ListToUse = (VtDerCoder **)0;
  VtIdentitySchemaDecode **DecodersToUse = (VtIdentitySchemaDecode **)0;
  VtDERCoderArray *derCoderArray;
  VtSchemaDecodeArray *schemaDecodeArray;
  VtMpIntCtx mpCtxToUse = (VtMpIntCtx)0;
  unsigned char *buffer = (unsigned char *)0;
  VoltSecureMailReadCtx *readCtx = (VoltSecureMailReadCtx *)0;
  VtReadPkcs7Info p7Info;
  VtBase64Info b64Info;
  VOLT_DECLARE_ERROR_TYPE (errorType)
  VOLT_DECLARE_FNCT_LINE (fnctLine)

  do
  {
    /* Make sure this is being called appropriately.
     */
    VOLT_SET_ERROR_TYPE (errorType, VT_ERROR_TYPE_PRIMARY)
    VOLT_SET_FNCT_LINE (fnctLine)
    status = VT_ERROR_INVALID_TYPE;
    if (flag != VOLT_SECURE_MAIL_SET_TYPE_FLAG)
      break;

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

    /* Check the info. If there's no info, get it from the libCtx.
     */
    if (info != (Pointer)0)
    {
      readInfo = (VtReadSecureMailInfo *)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)
    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 (VoltSecureMailReadCtx) +
      (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 (VoltSecureMailReadCtx), pad)
      bufferSize += pad;
#endif
    buffer = (unsigned char *)Z2Malloc (bufferSize, 0);
    if (buffer == (unsigned char *)0)
      break;
    Z2Memset (buffer, 0, bufferSize);

    /* Locate the pointers.
     */
    readCtx = (VoltSecureMailReadCtx *)buffer;
    offset = sizeof (VoltSecureMailReadCtx);
#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)
    {
      readCtx->mpCtx = (VtMpIntCtx)0;
      break;
    }

    /* Initialize the contentMaterialState
     */
    readCtx->contentMaterialState = VOLT_CONTENT_MATERIAL_STATE_NONE;

    /* Build the P7 objects.
     */
    p7Info.derCoders = ListToUse;
    p7Info.derCoderCount = listToUseCount;
    p7Info.decoders = DecodersToUse;
    p7Info.decoderCount = decodersToUseCount;
    p7Info.mpCtx = mpCtxToUse;
    VOLT_SET_FNCT_LINE (fnctLine)
    status = VtCreatePkcs7Object (
      (VtLibCtx)libCtx, VtPkcs7ImplReadSignedData, (Pointer)&p7Info,
      &(obj->p7SignedData));
    if (status != 0)
      break;

    VOLT_SET_FNCT_LINE (fnctLine)
    status = VtCreatePkcs7Object (
      (VtLibCtx)libCtx, VtPkcs7ImplReadEnvelopedData, (Pointer)&p7Info,
      &(obj->p7EnvelopedData));
    if (status != 0)
      break;

    /* Build the Base64 object.
     */
    b64Info.base64BlockSize = 64;
    b64Info.newLineCharacter = VT_BASE64_NEW_LINE_CR_LF;
    b64Info.errorCheck = VT_BASE64_NO_ERROR_CHECK;
    VOLT_SET_FNCT_LINE (fnctLine)
    status = VtCreateAlgorithmObject (
      (VtLibCtx)libCtx, VtAlgorithmImplBase64, (Pointer)&b64Info,
      &(obj->base64));
    if (status != 0)
      break;

    obj->state = VOLT_SECURE_MAIL_STATE_READ_SET;
    obj->localCtx = (Pointer)readCtx;
    obj->LocalCtxDestroy = VoltReadSecureMailCtxDestroy;
    obj->ReadInit = VoltSecureMailReadInit;
    obj->ReadUpdate = VoltSecureMailReadUpdate;
    obj->ReadFinal = VoltSecureMailReadFinal;
    obj->Verify = VoltSecureMailVerify;
    obj->GetEncodeDecodeSize = VoltBase64GetEncodeDecodeSize;

    status = 0;

  } while (0);

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

  /* If there was an error, destroy what we created.
   */
  if (readCtx != (VoltSecureMailReadCtx *)0 )
    VoltReadSecureMailCtxDestroy ((Pointer)obj, (Pointer)readCtx);

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

  return (status);
}

void VoltReadSecureMailCtxDestroy (
   Pointer obj,
   Pointer ctx
   )
{
  VoltObject *voltObj = (VoltObject *)obj;
  VoltLibCtx *libCtx;
  VoltSecureMailReadCtx *readCtx = (VoltSecureMailReadCtx *)ctx;
  VoltContentMaterial *currentElement, *nextElement;

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

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

  if (readCtx->mpCtx != (VtMpIntCtx)0 )
    VtDestroyMpIntCtx (&(readCtx->mpCtx));

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

  nextElement = readCtx->contentMaterial;
  while (nextElement != (VoltContentMaterial *)0)
  {
    currentElement = nextElement;
    nextElement = (VoltContentMaterial *)(currentElement->nextElement);

    /* Free the memory in the ByteArrayObj.
     */
    if (currentElement->material.data != (unsigned char *)0)
      Z2Free (currentElement->material.data);

    /* Now free the memory that is the shell.
     */
    Z2Free (currentElement);
  }

  if (readCtx->contentDescriptors.utf8Strings != (unsigned char **)0)
    Z2Free (readCtx->contentDescriptors.utf8Strings);

  Z2Free (ctx);
}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲第一福利一区| 日韩一卡二卡三卡四卡| 国产精品亚洲视频| 狠狠网亚洲精品| 久久国产精品第一页| 日韩成人一级片| 日本亚洲一区二区| 美国毛片一区二区| 久久99国产精品麻豆| 狠狠狠色丁香婷婷综合激情| 国产成人av一区二区三区在线 | 色噜噜狠狠色综合中国| eeuss国产一区二区三区| 成人性生交大片免费看中文| 国产精品99久久久久| 不卡视频免费播放| 93久久精品日日躁夜夜躁欧美| 99久久精品久久久久久清纯| 欧美伊人精品成人久久综合97| 欧美日韩亚洲综合| 欧美tk—视频vk| 国产精品久久免费看| 亚洲精品视频在线| 日韩激情一二三区| 国产精品影视网| 色狠狠一区二区| 日韩免费视频一区二区| 中文字幕国产一区| 亚洲高清视频的网址| 蜜桃视频一区二区| 91蜜桃网址入口| 欧美一卡二卡三卡| 国产精品伦理在线| 日韩精品电影在线| 成人久久视频在线观看| 91豆麻精品91久久久久久| 欧美人妇做爰xxxⅹ性高电影| xvideos.蜜桃一区二区| 亚洲黄色小说网站| 久久99国产精品免费网站| 色狠狠桃花综合| 欧美精品一区二区在线观看| 亚洲乱码中文字幕| 国内精品在线播放| 色嗨嗨av一区二区三区| 国产日韩欧美不卡在线| 日韩国产欧美三级| 色婷婷亚洲一区二区三区| 欧美变态凌虐bdsm| 亚洲色图另类专区| 国产成人一区二区精品非洲| 在线播放亚洲一区| 一级日本不卡的影视| 成人免费视频网站在线观看| 欧美白人最猛性xxxxx69交| 亚洲综合色噜噜狠狠| 99r精品视频| 2017欧美狠狠色| 亚洲影院久久精品| 成人激情图片网| 日韩三级在线观看| 欧美高清一级片在线观看| 日本不卡视频在线| 成人18精品视频| 制服丝袜在线91| 一区二区三区在线观看国产| 国产成人在线免费观看| 久久久综合九色合综国产精品| 亚洲国产裸拍裸体视频在线观看乱了 | 日本一区二区三区免费乱视频 | 国产精品乡下勾搭老头1| 欧美人妖巨大在线| 午夜私人影院久久久久| 91同城在线观看| 亚洲男同性恋视频| av高清不卡在线| 国产精品久久久久久久久久久免费看 | 国产精品网站一区| 久久99精品国产麻豆婷婷| 日本欧美韩国一区三区| 欧美伊人久久大香线蕉综合69| 一区二区三区美女视频| 欧美三日本三级三级在线播放| 一区二区三区鲁丝不卡| 欧美专区在线观看一区| 亚洲国产人成综合网站| 911国产精品| 久久精品噜噜噜成人88aⅴ| 欧美一级国产精品| 久88久久88久久久| 国产欧美日本一区二区三区| 丁香一区二区三区| 国产精品无人区| 91麻豆国产在线观看| 亚洲国产精品麻豆| 精品国产欧美一区二区| 国产大片一区二区| 中文字幕一区二区三区精华液 | 美女视频一区在线观看| 久久伊99综合婷婷久久伊| 国产成人在线视频网址| 成人欧美一区二区三区视频网页| 99国产精品99久久久久久| 视频在线观看一区| 久久人人97超碰com| 91视频一区二区| 水蜜桃久久夜色精品一区的特点| 精品99一区二区三区| 成人午夜免费视频| 亚洲超碰精品一区二区| 国产午夜精品久久久久久免费视| 色哟哟一区二区| 国产呦精品一区二区三区网站| 中文字幕亚洲一区二区av在线| 欧美系列在线观看| 国产在线精品视频| 一区二区三区日韩| 久久久久综合网| 欧美区一区二区三区| 成人丝袜视频网| 青娱乐精品视频在线| 亚洲欧美一区二区三区极速播放 | 精品国产免费久久| 欧美日韩在线播| 国产精品亚洲第一区在线暖暖韩国| 一区二区三区国产精品| 国产欧美日韩精品一区| 91精品国产色综合久久不卡电影 | 看电视剧不卡顿的网站| 亚洲情趣在线观看| 亚洲国产精品国自产拍av| 欧美不卡视频一区| 7777精品伊人久久久大香线蕉| 成人精品电影在线观看| 麻豆精品新av中文字幕| 亚洲成人一区在线| 樱花草国产18久久久久| 国产精品美女www爽爽爽| 欧美成人在线直播| 欧美精品在线观看播放| 在线观看日韩毛片| hitomi一区二区三区精品| 精品一区二区久久久| 麻豆成人91精品二区三区| 丝袜亚洲精品中文字幕一区| 亚洲国产精品精华液网站| 亚洲精品乱码久久久久久久久 | 欧美日韩国产成人在线免费| 91视频国产观看| 91黄色小视频| 91麻豆视频网站| 欧美伊人精品成人久久综合97| 91高清视频免费看| 欧美视频在线一区二区三区| 精品视频在线免费看| 欧美性猛片aaaaaaa做受| 在线观看区一区二| 欧亚洲嫩模精品一区三区| 北条麻妃国产九九精品视频| 成人激情黄色小说| 91麻豆高清视频| 在线观看视频91| 777午夜精品视频在线播放| 欧美一级免费观看| 精品福利一二区| 欧美国产精品一区| 亚洲男人天堂av网| 亚洲成av人片一区二区| 蜜芽一区二区三区| 国产麻豆9l精品三级站| 成人一区二区三区视频在线观看 | 国产在线视频一区二区三区| 国产传媒久久文化传媒| 成人av免费观看| 欧美日韩免费高清一区色橹橹 | 欧美日韩亚洲综合一区| 日韩欧美一级二级| 国产精品视频一区二区三区不卡| 中文字幕日本不卡| 亚洲r级在线视频| 国内精品久久久久影院一蜜桃| av成人老司机| 91麻豆精品国产| 欧美激情资源网| 亚洲18女电影在线观看| 精品在线观看免费| 色综合久久精品| 久久影院视频免费| 一区二区三区在线视频观看58| 蜜臀av亚洲一区中文字幕| 成人免费电影视频| 日韩一区二区三区四区 | 欧美色精品在线视频| 亚洲精品在线观| 亚洲观看高清完整版在线观看| 国产在线播放一区三区四| 欧美日韩一区二区不卡| 国产欧美一区二区精品性| 亚洲 欧美综合在线网络| 国产成人亚洲综合a∨婷婷图片 |