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

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

?? p7read.c

?? IBE是一種非對稱密碼技術(shù)
?? C
?? 第 1 頁 / 共 2 頁
字號:
/* Copyright 2003-2006, Voltage Security, all rights reserved.
 */
#include "vibe.h"
#include "environment.h"
#include "base.h"
#include "libctx.h"
#include "p7obj.h"
#include "derhelp.h"
#include "oidlist.h"
#include "reciplist.h"
#include "errorctx.h"

ASN1_SEQUENCE (Asn1Pkcs7Message) =
{
  ASN1_SIMPLE (Asn1Pkcs7Message, contentType, Asn1ObjectId),
  ASN1_EXP (Asn1Pkcs7Message, content, Asn1Encoded, 0)
} ASN1_SEQUENCE_END (Asn1Pkcs7Message);

IMPLEMENT_ASN1_FUNCTIONS (Asn1Pkcs7Message)

ASN1_SEQUENCE (Asn1RecipientInfo) =
{
  ASN1_SIMPLE (Asn1RecipientInfo, version, ASN1_INTEGER),
  ASN1_SIMPLE (Asn1RecipientInfo, issuerSerial, Asn1Encoded),
  ASN1_SIMPLE (Asn1RecipientInfo, keyEncAlg, Asn1Encoded),
  ASN1_SIMPLE (Asn1RecipientInfo, encryptedKey, ASN1_OCTET_STRING)
} ASN1_SEQUENCE_END (Asn1RecipientInfo);

IMPLEMENT_ASN1_FUNCTIONS (Asn1RecipientInfo)

ASN1_SEQUENCE (Asn1RecipInfoExtract) =
{
  ASN1_SIMPLE (Asn1RecipInfoExtract, version, ASN1_INTEGER),
  ASN1_SET_OF (Asn1RecipInfoExtract, recipInfo, Asn1RecipientInfo),
  ASN1_SIMPLE (Asn1RecipInfoExtract, ignore1, Asn1Encoded),
  ASN1_OPT (Asn1RecipInfoExtract, ignore2, Asn1Encoded),
  ASN1_OPT (Asn1RecipInfoExtract, ignore3, Asn1Encoded),
  ASN1_OPT (Asn1RecipInfoExtract, ignore4, Asn1Encoded),
  ASN1_OPT (Asn1RecipInfoExtract, ignore5, Asn1Encoded),
} ASN1_SEQUENCE_END (Asn1RecipInfoExtract);

IMPLEMENT_ASN1_FUNCTIONS (Asn1RecipInfoExtract)

/* Extract the issuerSerial from the recipInfo, it should contain the
 * encoded identity, Base64 encoded. Build an Identity object from the
 * encoded identity and add it to the identity list.
 * <p>If the recipient info does not contain an encoded identity, this
 * function does nothing and returns 0 (no error).
 *
 * @param p7Obj The P7 object involved in this transaction.
 * @param recipients The identityList to which the identity will be
 * added.
 * @param recipInfo The struct containing the issuerSerial.
 * @param decoders An array of VtIdentitySchemaDecode's used to decode
 * the encoded identity.
 * @param decoderCount The number of decoders in the array.
 * @return an int, 0 if the function completed successfully or a
 * non-zero error code.
 */
int VOLT_CALLING_CONV AddIdFromIssuerSerial VOLT_PROTO_LIST ((
   VoltLibCtx *libCtx,
   VtIdentityList recipients,
   Asn1RecipientInfo *recipInfo,
   VtIdentitySchemaDecode **decoders,
   unsigned int decoderCount
));

int VoltReadP7ContentType (
   VoltLibCtx *libCtx,
   unsigned char *message,
   unsigned int messageLen,
   unsigned int *contentType
   )
{
  int status;
  unsigned int bytesRead, offset, oidLastByte;
  unsigned char p7DataOid[VoltP7DataOidBytesLen] = { VoltP7DataOidBytes };
  VoltDerElement derElement;
  VOLT_DECLARE_ERROR_TYPE (errorType)
  VOLT_DECLARE_FNCT_LINE (fnctLine)

  *contentType = 0;
  Z2Memset (&derElement, 0, sizeof (derElement));

  do
  {
    /* Collect the SEQUENCE and OID of a P7 message.
     * This call will collect an element. We'll "cheat" by setting the
     * explicitTag to the SEQUENCE tag. That way the function will
     * collect the SEQUENCE and the first thing after the SEQUENCE,
     * which is the OID.
     */
    VOLT_SET_ERROR_TYPE (errorType, 0)
    VOLT_SET_FNCT_LINE (fnctLine)
    status = VoltGetNextDerElement (
      libCtx, message, messageLen, VOLT_SEQUENCE_TAG, VOLT_OID_TAG, 1,
      &derElement, &bytesRead);
    if (status != 0)
      break;

    VOLT_SET_ERROR_TYPE (errorType, VT_ERROR_TYPE_PRIMARY)
    VOLT_SET_FNCT_LINE (fnctLine)
    status = VT_ERROR_INVALID_INPUT_LENGTH;
    if (derElement.complete == 0)
      break;

    /* Check the OID. All P7 contentType's are the same length.
     */
    VOLT_SET_FNCT_LINE (fnctLine)
    status = VT_ERROR_INVALID_ENCODING;
    offset = (unsigned int)(derElement.elementLen - derElement.valueLen);
    if (derElement.valueLen != VoltP7DataOidBytesLen)
      break;

    /* Check all but the last byte of the OID, all P7 contentType's
     * have the same first bytes.
     */
    VOLT_SET_FNCT_LINE (fnctLine)
    if (Z2Memcmp (
      derElement.element + offset, p7DataOid, VoltP7DataOidBytesLen - 1) != 0)
      break;

    /* Look at the last byte of OID.
     */
    VOLT_SET_FNCT_LINE (fnctLine)
    offset = derElement.elementLen - 1;
    oidLastByte = (unsigned int)(derElement.element[offset]);
    if ( (oidLastByte < VOLT_P7_OID_BYTE_DATA) ||
         (oidLastByte > VOLT_P7_OID_BYTE_ENCRYPTED_DATA) )
      break;

    *contentType = oidLastByte;

    status = 0;

  } while (0);

  if (derElement.element != (unsigned char *)0)
    Z2Free (derElement.element);

  VOLT_LOG_ERROR_INFO_COMPARE (
    status, libCtx, 0, status, 0, errorType,
    (char *)0, "VoltReadP7ContentType", fnctLine, (char *)0)

  return (status);
}

int VoltReadP7Recipients (
   VoltLibCtx *libCtx,
   Asn1Pkcs7Message *p7Msg,
   unsigned int contentType,
   VtIdentitySchemaDecode **decoders,
   unsigned int decoderCount,
   VtIdentityList recipients
   )
{
  int status, count, index;
  unsigned char *temp;
  Asn1RecipInfoExtract *extractor;
  Asn1RecipientInfo *nextEntry;
  VOLT_DECLARE_ERROR_TYPE (errorType)
  VOLT_DECLARE_FNCT_LINE (fnctLine)

  do
  {
    /* Use the Asn1RecipInfoExtract object to extract the recipients.
     */
    VOLT_SET_ERROR_TYPE (errorType, VT_ERROR_TYPE_PRIMARY)
    VOLT_SET_FNCT_LINE (fnctLine)
    status = VT_ERROR_MEMORY;
    extractor = Asn1RecipInfoExtract_new ();
    if (extractor == (Asn1RecipInfoExtract *)0)
      break;

    Asn1SetObjectCopyFlag (
      extractor->ignore1, VOLT_ASN1_COPY_REFERENCE);

    /* If this is SignedAndEnvelopedData, create the other ignore
     * Asn1Encoded's.
     */
    if (contentType != VT_PKCS7_ENVELOPED_DATA)
    {
      VOLT_SET_FNCT_LINE (fnctLine)
      extractor->ignore2 = Asn1Encoded_new ();
      if (extractor->ignore2 == (Asn1Encoded *)0)
        break;

      VOLT_SET_FNCT_LINE (fnctLine)
      extractor->ignore3 = Asn1Encoded_new ();
      if (extractor->ignore3 == (Asn1Encoded *)0)
        break;

      VOLT_SET_FNCT_LINE (fnctLine)
      extractor->ignore4 = Asn1Encoded_new ();
      if (extractor->ignore4 == (Asn1Encoded *)0)
        break;

      VOLT_SET_FNCT_LINE (fnctLine)
      extractor->ignore5 = Asn1Encoded_new ();
      if (extractor->ignore5 == (Asn1Encoded *)0)
        break;

      Asn1SetObjectCopyFlag (
        extractor->ignore2, VOLT_ASN1_COPY_REFERENCE);
      Asn1SetObjectCopyFlag (
        extractor->ignore3, VOLT_ASN1_COPY_REFERENCE);
      Asn1SetObjectCopyFlag (
        extractor->ignore4, VOLT_ASN1_COPY_REFERENCE);
      Asn1SetObjectCopyFlag (
        extractor->ignore5, VOLT_ASN1_COPY_REFERENCE);
    }

    VOLT_SET_FNCT_LINE (fnctLine)
    status = VT_ERROR_UNKNOWN_BER;
    temp = p7Msg->content->base.data;
    d2i_Asn1RecipInfoExtract (&extractor, &temp, p7Msg->content->base.length);
    if (extractor == (Asn1RecipInfoExtract *)0)
      break;

    /* We now have a stack of RecipientInfo's. Each of the issuerSerial
     * fields contains the identity.
     */
    count = sk_num (extractor->recipInfo);

    status = 0;
    VOLT_SET_ERROR_TYPE (errorType, 0)
    for (index = 0; index < count; ++index)
    {
      nextEntry = (Asn1RecipientInfo *)sk_value (extractor->recipInfo, index);
      VOLT_SET_FNCT_LINE (fnctLine)
      status = AddIdFromIssuerSerial (
        libCtx, recipients, nextEntry, decoders, decoderCount);
      if (status != 0)
        break;
    }

  } while (0);

  if (extractor != (Asn1RecipInfoExtract *)0)
    Asn1RecipInfoExtract_free (extractor);

  VOLT_LOG_ERROR_INFO_COMPARE (
    status, libCtx, 0, status, 0, errorType,
    (char *)0, "VoltReadP7Recipients", fnctLine, (char *)0)

  return (status);
}

int AddIdFromIssuerSerial (
   VoltLibCtx *libCtx,
   VtIdentityList recipients,
   Asn1RecipientInfo *recipInfo,
   VtIdentitySchemaDecode **decoders,
   unsigned int decoderCount
   )
{
  int status;
  unsigned int encodingLen, schemaType, index;
  VtIdentityObject idObj = (VtIdentityObject)0;
  unsigned char *encoding = (unsigned char *)0;
  VOLT_DECLARE_FNCT_LINE (fnctLine)

  do
  {
    /* Get the encoded ID out of the RecipientInfo.
     * If the RecipientInfo does not contain an encoded ID, just return
     * 0 (we didn't add an ID to the IdentityList, but that's not an
     * error we need to halt production over).
     */
    VOLT_SET_FNCT_LINE (fnctLine)
    status = VoltGetEncodedIdFromRecipInfoAlloc (
      libCtx, recipInfo, &encoding, &encodingLen);
    if (status != 0)
    {

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
精品女同一区二区| 91麻豆蜜桃一区二区三区| 777xxx欧美| 日产精品久久久久久久性色| 欧美日本一道本在线视频| 婷婷丁香久久五月婷婷| 欧美一区二区三区婷婷月色| 精品一区二区三区在线播放视频| 久久综合五月天婷婷伊人| 丁香激情综合五月| 亚洲欧美激情一区二区| 欧美日韩精品福利| 九九**精品视频免费播放| 国产视频一区在线观看| 99精品久久免费看蜜臀剧情介绍| 一区二区国产视频| 日韩精品中文字幕在线不卡尤物| 国产盗摄女厕一区二区三区| 亚洲男女毛片无遮挡| 欧美肥妇free| 成人在线综合网| 婷婷成人激情在线网| 久久亚洲综合av| 91麻豆成人久久精品二区三区| 亚洲午夜免费福利视频| 久久这里只有精品6| 色综合久久久久| 久久精品99国产国产精| 亚洲精品国产成人久久av盗摄| 欧美日韩国产精品自在自线| 国产91精品欧美| 亚洲国产欧美一区二区三区丁香婷 | 日韩三区在线观看| 成人综合婷婷国产精品久久蜜臀 | 亚洲国产aⅴ天堂久久| 亚洲精品在线网站| 91黄色免费看| 国产成人自拍高清视频在线免费播放| 亚洲精品老司机| 久久久久久一级片| 欧美日本一区二区三区四区| www.亚洲精品| 免费成人av资源网| 一区二区三区精品在线观看| 国产日韩影视精品| 欧美日韩成人综合天天影院| av在线一区二区| 国内成人自拍视频| 日韩精品五月天| 日韩中文字幕区一区有砖一区| 国产精品女同一区二区三区| 日韩视频123| 欧美精品色综合| 在线观看成人小视频| 成人黄色在线网站| 国产酒店精品激情| 麻豆精品视频在线观看免费| 亚洲午夜国产一区99re久久| 亚洲欧美自拍偷拍色图| 国产日本一区二区| 精品国产成人在线影院| 日韩一二三区不卡| 欧美一区二区在线不卡| 欧美日韩亚洲另类| 色综合久久综合中文综合网| 成人国产在线观看| 国产久卡久卡久卡久卡视频精品| 蜜桃91丨九色丨蝌蚪91桃色| 午夜精品久久久久久久久久 | 欧美疯狂做受xxxx富婆| 在线观看91精品国产入口| 99久久国产综合色|国产精品| 国产91丝袜在线播放0| 国产精品77777| 成人小视频免费观看| 成人免费看黄yyy456| 国产成人在线电影| 国产99久久久国产精品潘金| 国产精品亚洲视频| 国产成人午夜视频| 成人精品gif动图一区| 91小视频在线观看| 一本色道a无线码一区v| 在线精品视频免费观看| 欧美人妇做爰xxxⅹ性高电影 | 日韩欧美一级二级三级| 日韩一区二区三| 精品久久久网站| 国产日韩综合av| 亚洲嫩草精品久久| 亚洲一区二区精品久久av| 国产精品一区在线| 国产99久久久国产精品免费看| 国产成人午夜电影网| bt7086福利一区国产| 一本大道综合伊人精品热热| 欧洲视频一区二区| 91精品婷婷国产综合久久性色| 欧美一级日韩一级| 久久久久久久久97黄色工厂| 欧美国产一区在线| 亚洲欧美日韩成人高清在线一区| 亚洲大型综合色站| 激情亚洲综合在线| 9i在线看片成人免费| 欧洲精品一区二区| 欧美成人欧美edvon| 国产精品国产三级国产aⅴ无密码 国产精品国产三级国产aⅴ原创 | 狠狠色综合日日| 高清av一区二区| 欧美影院午夜播放| 欧美大片一区二区| 国产精品伦理一区二区| 亚洲高清视频中文字幕| 久草中文综合在线| 一本色道亚洲精品aⅴ| 欧美一二三四区在线| 日韩毛片在线免费观看| 日日夜夜免费精品| 99精品国产热久久91蜜凸| 在线成人小视频| 国产精品沙发午睡系列990531| 成人影视亚洲图片在线| 欧美日韩黄色一区二区| 久久九九99视频| 亚洲成人免费在线观看| 成人免费视频视频| 在线综合亚洲欧美在线视频| 国产精品视频一区二区三区不卡 | 亚洲成人黄色小说| 成人性生交大片免费看视频在线| 欧美亚洲国产一区在线观看网站| 久久精品一二三| 婷婷成人综合网| 色视频欧美一区二区三区| 久久久综合激的五月天| 亚洲成av人片在www色猫咪| 成人av电影免费在线播放| 欧美一区二区视频在线观看2022| 中文字幕一区二区三区乱码在线| 久久成人免费网站| 6080午夜不卡| 一区二区三区在线免费播放| 丁香五精品蜜臀久久久久99网站| 欧美一级在线免费| 一区av在线播放| 成人av在线一区二区| 国产色产综合色产在线视频| 日本少妇一区二区| 欧美日韩免费在线视频| 亚洲精品亚洲人成人网| 成人av电影在线网| 中文字幕av不卡| 国产寡妇亲子伦一区二区| 精品久久99ma| 免费av成人在线| 欧美精三区欧美精三区 | 日本不卡一区二区三区| 欧美在线看片a免费观看| 亚洲青青青在线视频| 99国产精品久久| 日韩毛片精品高清免费| 99久久久国产精品| 一区精品在线播放| 91麻豆视频网站| 国产91精品露脸国语对白| 精品va天堂亚洲国产| 久久精品国产99国产| 亚洲精品一区二区三区蜜桃下载 | 男女性色大片免费观看一区二区| 欧美男人的天堂一二区| 午夜精品福利视频网站| 欧美三片在线视频观看| 亚洲成av人综合在线观看| 欧美久久久影院| 麻豆成人久久精品二区三区小说| 欧美成人性福生活免费看| 国产专区综合网| 久久久777精品电影网影网| 成人免费观看男女羞羞视频| 国产精品丝袜91| 在线亚洲精品福利网址导航| 亚洲国产综合在线| 日韩免费福利电影在线观看| 精品一区二区三区在线观看| 国产午夜久久久久| www.爱久久.com| 亚洲国产视频一区| 91精品国产综合久久精品app| 久久国产精品免费| 久久久久国产免费免费| av在线不卡网| 亚洲电影第三页| 精品va天堂亚洲国产| 99九九99九九九视频精品| 亚洲成av人片在线观看无码| 亚洲精品一区二区三区影院| 9i看片成人免费高清| 日韩国产精品91| 国产精品久久久久久久久免费相片|