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

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

?? sm2read.c

?? IBE是一種非對稱密碼技術
?? C
?? 第 1 頁 / 共 4 頁
字號:
/* Copyright 2005-2006, Voltage Security, all rights reserved.
 */
#include "vibe.h"
#include "environment.h"
#include "base.h"
#include "libctx.h"
#include "securemail.h"
#include "errorctx.h"
#include "vtassert.h"
#include "stringutil.h"
#include "zdm2common.h"
#include "sacommon.h"

#define VOLT_SECURE_MAIL_WRAPPER_TYPE_UNKNOWN         1
#define VOLT_SECURE_MAIL_WRAPPER_TYPE_PLAIN           2
#define VOLT_SECURE_MAIL_WRAPPER_TYPE_HTML            3
#define VOLT_SECURE_MAIL_WRAPPER_TYPE_INVALID         4

int VoltSecureMail2ReadInit (
  VtSecureMailObject secureMailObj
)
{
  int status = 0;
  VoltSecureMail2ReadCtx* readCtx = (VoltSecureMail2ReadCtx*)0;
  VtLibCtx libCtx = (VtLibCtx)0;
  VOLT_DECLARE_FNCT_LINE(fnctLine)
  VOLT_DECLARE_ERROR_TYPE(errorType)
  
  VOLT_SET_ERROR_TYPE(errorType, 0)
  
  VT_ASSERT(secureMailObj != (VtSecureMailObject)0);
  
  readCtx = (VoltSecureMail2ReadCtx*)secureMailObj->localCtx;
  VT_ASSERT(readCtx != (VoltSecureMail2ReadCtx*)0);
  libCtx = secureMailObj->voltObject.libraryCtx;
  VT_ASSERT(libCtx != (VtLibCtx)0);
  
  do
  {
    /* The state must be VOLT_SECURE_MAIL_STATE_READ_SET, if not,
     * we're not allowed to call ReadInit.
     */
    if (secureMailObj->state != VOLT_SECURE_MAIL_STATE_READ_SET)
    {
      VOLT_SET_ERROR_TYPE(errorType, VT_ERROR_TYPE_PRIMARY)
      VOLT_SET_FNCT_LINE(fnctLine)
      status = VT_ERROR_INVALID_CALL_ORDER;
      break;
    }
    
    VOLT_SET_FNCT_LINE(fnctLine)
    status = VtPkcs7ReadInit(secureMailObj->p7SignedData);
    if (status != 0)
      break;

    VOLT_SET_FNCT_LINE(fnctLine)
    status = VtPkcs7ReadInit(secureMailObj->p7EnvelopedData);
    if (status != 0)
      break;

    VOLT_SET_FNCT_LINE(fnctLine)
    status = VtDecodeInit(secureMailObj->base64);
    if (status != 0)
      break;

    readCtx->wrapperType = VOLT_SECURE_MAIL_WRAPPER_TYPE_UNKNOWN;
    secureMailObj->state = VOLT_SECURE_MAIL_STATE_READ_HTML;
  }
  while (0);
  
  VOLT_LOG_ERROR_COMPARE(status, libCtx, status, errorType,
    fnctLine, "VoltSecureMail2ReadInit", (unsigned char*)0)
  
  return status;
}

static const unsigned char* VoltSecureMail2SkipQuotedString(
  const unsigned char* p,
  const unsigned char* end,
  unsigned char quoteChar
)
{
  unsigned char c;
  
  VT_ASSERT(p != (unsigned char*)0);
  VT_ASSERT(end != (unsigned char*)0);
  
  while (p < end)
  {
    c = *p++;
    
    if (c == quoteChar)
    {
      break;
    }
    else if (p == end)
    {
      p = (unsigned char*)0;
      break;
    }
    else if (c == '\\')
    {
      p++;
    }
  }
  
  return p;
}

static const unsigned char* VoltSecureMail2SkipHTMLTag(
  const unsigned char* p,
  const unsigned char* end
)
{
  unsigned char c;
  const unsigned char* tagEnd = (unsigned char*)0;
  
  VT_ASSERT(p != (unsigned char*)0);
  VT_ASSERT(end != (unsigned char*)0);
  
  while ((p != (unsigned char*)0) && (p < end))
  {
    c = *p++;
    
    if (c == '>')
    {
      tagEnd = p;
      break;
    }
    else if ((c == '\'') || (c == '\"'))
    {
      p = VoltSecureMail2SkipQuotedString(p, end, c);
    }
  }
  
  return tagEnd;
}

static const unsigned char* VoltSecureMail2SkipWhitespace(
  const unsigned char* p,
  const unsigned char* end
)
{
  unsigned char c;
  
  VT_ASSERT(p != (unsigned char*)0);
  VT_ASSERT(end != (unsigned char*)0);
  
  while (p < end)
  {
    c = *p;
    if ((c != ' ') && (c != '\t') && (c != '\n') && (c != '\r'))
      break;
    p++;
  }
  
  return p;
}

static const unsigned char* VoltSecureMail2SkipHTMLComment(
  const unsigned char* p,
  const unsigned char* end
)
{
  VT_ASSERT(p != (unsigned char*)0);
  VT_ASSERT(end != (unsigned char*)0);
  
  for (;;)
  {
    if (p + 3 > end)
    {
      p = (unsigned char*)0;
      break;
    }
    
    if ((p[0] == '-') && (p[1] == '-') && (p[2] == '>'))
    {
      p += 3;
      break;
    }
    
    p++;
  }
  
  return p;
}

static int VoltSecureMail2MatchTagName(
  const unsigned char* p,
  const unsigned char* end,
  const unsigned char* tagName,
  VtLibCtx libCtx
)
{
  const unsigned char* startTagName;
  unsigned int tagLength;
  unsigned char c;
  int isAlnum;
  int tagMatches;
  
  VT_ASSERT(p != (unsigned char*)0);
  VT_ASSERT(end != (unsigned char*)0);
  VT_ASSERT(tagName != (unsigned char*)0);
  
  tagLength = Z2Strlen(tagName);
  
  p = VoltSecureMail2SkipWhitespace(p, end);
  startTagName = p;
  
  while (p < end)
  {
    c = *p;
    isAlnum = ((c >= 'a') && (c <= 'z')) ||
      ((c >= 'A') && (c <= 'Z')) || ((c >= '0') && (c <= '9'));
    if (!isAlnum)
      break;
    p++;
  }
  
  tagMatches = (VoltCaseInsensitiveCompareBuffers(startTagName,
    p - startTagName, tagName, tagLength, libCtx) == 0);
  
  return tagMatches;
}


static int VoltSecureMail2FindHTML(
  VtSecureMailObject secureMailObj,
  const unsigned char* input,
  unsigned int inputLength,
  unsigned int* inputRead,
  unsigned int* pendingInputLength
)
{
  int status = 0;
  VoltSecureMail2ReadCtx* readCtx = (VoltSecureMail2ReadCtx*)0;
  VtLibCtx libCtx = (VtLibCtx)0;
  const unsigned char* p;
  const unsigned char* end;
  const unsigned char* tagStart;
  int foundHTML;
  VOLT_DECLARE_FNCT_LINE(fnctLine)
  
  VT_ASSERT(secureMailObj != (VtSecureMailObject)0);
  VT_ASSERT(inputRead != (unsigned int*)0);
  VT_ASSERT(pendingInputLength != (unsigned int*)0);

  *pendingInputLength = 0;
  *inputRead = inputLength;
  
  if (inputLength == 0)
    return 0;
    
  readCtx = (VoltSecureMail2ReadCtx*)secureMailObj->localCtx;
  VT_ASSERT(readCtx != (VoltSecureMail2ReadCtx*)0);
  libCtx = secureMailObj->voltObject.libraryCtx;
  VT_ASSERT(libCtx != (VtLibCtx)0);
  
  p = input;
  end = input + inputLength;
  
  do
  {
    p = VoltSecureMail2SkipWhitespace(p, end);
    
    if (p == end)
      break;
    
    if (*p != '<')
    {
      readCtx->wrapperType = VOLT_SECURE_MAIL_WRAPPER_TYPE_PLAIN;
      secureMailObj->state = VOLT_SECURE_MAIL_STATE_READ_HEADER_1;
      break;
    }
    
    tagStart = p;
    p++;
    
    if (p == end)
    {
      p = (unsigned char*)0;
    }
    else if (*p == '?')
    {
      p = VoltSecureMail2SkipHTMLTag(p, end);
    }
    else if (*p == '!')
    {
      if ((p + 2 < end) && (p[1] == '-') && (p[2] == '-'))
      {
        p += 3;
        p = VoltSecureMail2SkipHTMLComment(p, end);
      }
      else
      {
        p = VoltSecureMail2SkipHTMLTag(p, end);
      }
    }
    else if (VoltSecureMail2MatchTagName(p, end, "meta", libCtx))
    {
      p = VoltSecureMail2SkipHTMLTag(p, end);
    }
    else
    {
      foundHTML = VoltSecureMail2MatchTagName(p, end, "html", libCtx);
      p = VoltSecureMail2SkipHTMLTag(p, end);
      if (p != (unsigned char*)0)
      {
        if (foundHTML)
        {
          secureMailObj->state = VOLT_SECURE_MAIL_STATE_READ_BODY;
        }
        else
        {
          readCtx->wrapperType = VOLT_SECURE_MAIL_WRAPPER_TYPE_INVALID;
          secureMailObj->state = VOLT_SECURE_MAIL_STATE_READ_COMPLETE;
          VOLT_SET_FNCT_LINE(fnctLine)
          status = VT_ERROR_INVALID_SECURE_MAIL_MSG;
        }
        break;
      }
    }
  }
  while (p != (unsigned char*)0);

  if (p != (unsigned char*)0)
  {
    *inputRead = p - input;
  }
  else
  {
    VT_ASSERT(tagStart != (unsigned char*)0);
    *pendingInputLength = end - tagStart;
  }
  
  VOLT_LOG_ERROR_COMPARE(status, libCtx, status, VT_ERROR_TYPE_PRIMARY,
    fnctLine, "VoltSecureMail2FindHTML", (unsigned char*)0)
  
  return status;
}

static void VoltSecureMail2FindHTMLBody(
  VtSecureMailObject secureMailObj,
  const unsigned char *input,
  unsigned int inputLength,
  unsigned int* inputRead,
  unsigned int* pendingInputLength
)
{
  VoltSecureMail2ReadCtx* readCtx = (VoltSecureMail2ReadCtx*)0;
  VtLibCtx libCtx = (VtLibCtx)0;
  const unsigned char* p;
  const unsigned char* end;
  const unsigned char* tagStart;
  unsigned char c;
  int isBody;

  VT_ASSERT(secureMailObj != (VtSecureMailObject)0);
  VT_ASSERT(inputRead != (unsigned int*)0);
  VT_ASSERT(pendingInputLength != (unsigned int*)0);
  
  readCtx = (VoltSecureMail2ReadCtx*)secureMailObj->localCtx;
  VT_ASSERT(readCtx != (VoltSecureMail2ReadCtx*)0);
  libCtx = secureMailObj->voltObject.libraryCtx;
  VT_ASSERT(libCtx != (VtLibCtx)0);
  
  *inputRead = inputLength;
  *pendingInputLength = 0;
  
  if (inputLength == 0)
    return;
    
  p = input;
  end = input + inputLength;
  
  while ((p != (unsigned char*)0) && (p < end))
  {
    c = *p;
    
    if (c == '<')
    {
      tagStart = p++;
      
      if ((p + 2 < end) && (p[0] == '!') && (p[1] == '-') && (p[2] == '-'))
      {
        p = VoltSecureMail2SkipHTMLComment(p + 3, end);
      }
      else
      {
        isBody = VoltSecureMail2MatchTagName(p, end, "body", libCtx);
        p = VoltSecureMail2SkipHTMLTag(p, end);
        if (p == (unsigned char*)0)
          break;
        if (isBody)
        {
          readCtx->wrapperType = VOLT_SECURE_MAIL_WRAPPER_TYPE_HTML;
          secureMailObj->state = VOLT_SECURE_MAIL_STATE_READ_HEADER_1;
          break;
        }
      }
    }
    else
    {
      p++;
    }
  }
  
  if (p != (unsigned char*)0)
  {
    *inputRead = p - input;
  }
  else
  {
    VT_ASSERT(tagStart != (unsigned char*)0);
    *pendingInputLength = end - tagStart;
  }
}

static int VoltSecureMail2FindMessageStart(
  VtSecureMailObject secureMailObj,
  const unsigned char *input,
  unsigned int inputLength,
  unsigned int* inputRead,
  unsigned int* pendingInputLength
)
{
  int status = 0;
  VoltSecureMail2ReadCtx* readCtx = (VoltSecureMail2ReadCtx*)0;
  VtLibCtx libCtx = (VtLibCtx)0;
  int isHTML;
  int foundTag;
  unsigned char* tag = (unsigned char*)0;
  unsigned int maxTagLength;
  unsigned int tagLength;
  const unsigned char* p;
  const unsigned char* end;
  int i;
  VOLT_DECLARE_FNCT_LINE(fnctLine)

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
91福利在线看| 久久综合狠狠综合久久综合88 | 九九**精品视频免费播放| 国产成人在线免费观看| 欧美色网一区二区| 欧美国产精品久久| 美女一区二区三区| 欧美日韩一区三区| 亚洲欧美色一区| 国产成人精品aa毛片| 日韩欧美国产一区二区三区| 亚洲综合在线免费观看| 成人国产在线观看| 欧美v亚洲v综合ⅴ国产v| 亚洲成人av一区二区三区| 91在线小视频| 国产精品成人免费在线| 国产一区二区三区久久久| 日韩女优电影在线观看| 日韩vs国产vs欧美| 欧美精品一二三区| 亚洲a一区二区| 欧美亚州韩日在线看免费版国语版| 国产精品视频免费| 成人高清伦理免费影院在线观看| 久久久不卡网国产精品一区| 国内精品伊人久久久久av一坑| 日韩视频在线你懂得| 日本不卡免费在线视频| 欧美一二三在线| 麻豆国产欧美日韩综合精品二区| 91精品国产综合久久久蜜臀图片 | 中文字幕第一区综合| 精品一区二区三区在线观看国产| 日韩一区二区三区在线| 午夜精品成人在线视频| 欧美久久久久中文字幕| 天使萌一区二区三区免费观看| 欧美亚洲综合网| 激情国产一区二区| 精品国产露脸精彩对白| 国产在线观看免费一区| 国产日本欧洲亚洲| 97se亚洲国产综合自在线不卡| 亚洲欧美一区二区三区久本道91| 日本韩国一区二区三区| 日韩精品欧美精品| 26uuu国产一区二区三区| 粉嫩av一区二区三区在线播放| 国产精品成人午夜| 欧美午夜精品久久久| 免费不卡在线观看| 久久日韩粉嫩一区二区三区| av在线综合网| 亚洲主播在线观看| 精品久久久久久久久久久久包黑料 | 亚洲激情成人在线| 欧美在线免费观看视频| 蜜桃视频一区二区三区在线观看| 久久中文娱乐网| 色综合一个色综合| 秋霞电影网一区二区| 亚洲国产成人自拍| 欧美亚洲国产怡红院影院| 久久99深爱久久99精品| 国产精品福利电影一区二区三区四区| 色婷婷av一区二区三区大白胸| 日韩avvvv在线播放| 国产精品青草综合久久久久99| 欧美亚洲国产bt| 国产成人在线影院| 亚洲高清不卡在线| 欧美国产激情一区二区三区蜜月| 欧美亚洲尤物久久| 成人综合激情网| 日产欧产美韩系列久久99| 亚洲欧美综合另类在线卡通| 91精品国产一区二区三区| 成人av资源网站| 久久aⅴ国产欧美74aaa| 一区二区三区四区在线播放 | 欧美视频三区在线播放| 国产精品自拍三区| 日韩精品电影在线| 夜夜嗨av一区二区三区| 中文字幕欧美区| 欧美xxxx在线观看| 欧美性一区二区| eeuss国产一区二区三区| 麻豆91小视频| 香蕉加勒比综合久久| 综合激情成人伊人| 国产精品日韩成人| 国产日韩欧美不卡在线| 日韩亚洲欧美在线观看| 欧美日韩国产在线观看| 91在线观看高清| 国产91精品免费| 国产在线播放一区二区三区| 青娱乐精品在线视频| 亚洲亚洲人成综合网络| 亚洲精品视频免费观看| 国产精品色在线| 国产人妖乱国产精品人妖| 精品国产成人系列| 18成人在线视频| 国产欧美日韩一区二区三区在线观看| 日韩欧美一级二级| 日韩精品专区在线影院重磅| 69堂精品视频| 91精品欧美福利在线观看| 欧美卡1卡2卡| 欧美一级高清大全免费观看| 91精品国产综合久久小美女| 7777精品伊人久久久大香线蕉经典版下载 | 精品国精品国产| 欧美一区二区三区四区五区| 制服丝袜av成人在线看| 69成人精品免费视频| 91精品国产综合久久久蜜臀图片| 欧美精品自拍偷拍动漫精品| 制服.丝袜.亚洲.中文.综合| 日韩欧美亚洲国产另类| 日韩精品一区二区三区中文不卡| 欧美一区二区三区色| 欧美电影免费观看高清完整版| 91精品国产综合久久久久久久久久 | 精品久久久久一区二区国产| 精品剧情在线观看| 国产校园另类小说区| 中文字幕高清不卡| 亚洲最大的成人av| 免费av成人在线| 国产精品羞羞答答xxdd| 不卡的av网站| 欧美日韩一卡二卡三卡| 日韩午夜精品电影| 日本一区二区成人| 亚洲综合成人在线视频| 免费在线观看精品| 成人中文字幕电影| 欧美系列一区二区| 久久综合五月天婷婷伊人| 最新日韩在线视频| 日韩精品91亚洲二区在线观看| 国内成人免费视频| 91福利在线观看| 欧美草草影院在线视频| 亚洲国产精品99久久久久久久久 | 在线观看视频欧美| 亚洲精品一区二区三区在线观看| 成人免费视频在线观看| 日本中文字幕一区二区视频| 成人三级在线视频| 777久久久精品| 亚洲视频在线一区| 精品亚洲免费视频| 欧美在线你懂的| 国产欧美一区二区三区在线老狼| 亚洲综合免费观看高清完整版| 极品少妇一区二区三区精品视频 | 丁香婷婷综合激情五月色| 欧美图区在线视频| 中文字幕免费不卡| 久久国产精品99精品国产 | 99久久免费视频.com| 日韩欧美亚洲国产另类| 夜夜精品视频一区二区| 国产精品123| 欧美一区二区在线播放| 亚洲美女精品一区| 国产成人无遮挡在线视频| 欧美一区二区播放| 亚洲综合偷拍欧美一区色| 成人激情午夜影院| 精品久久久网站| 日本麻豆一区二区三区视频| 色综合久久88色综合天天6 | 欧美日韩国产综合视频在线观看 | 日韩黄色片在线观看| 91色porny| 亚洲天堂网中文字| 国产成人超碰人人澡人人澡| 日韩午夜在线影院| 青青草伊人久久| 欧美精品久久99久久在免费线| 亚洲综合男人的天堂| 91丨国产丨九色丨pron| 中文字幕av不卡| 成人污视频在线观看| 久久久久久久久久久黄色| 激情久久久久久久久久久久久久久久| 欧美麻豆精品久久久久久| 亚洲午夜精品17c| 91福利在线导航| 一区二区三区蜜桃| 色婷婷国产精品久久包臀| 亚洲欧美激情视频在线观看一区二区三区| 国产成人高清视频| 国产精品伦理一区二区|