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

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

?? derhelp.c

?? IBE是一種非對(duì)稱密碼技術(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 "derhelp.h"
#include "errorctx.h"

/* Get the tag and length octets into the given buffer. If the buffer
 * is not big enough, realloc so that it is (of course, if it is
 * already big enough, no malloc or realloc is necessary).
 * <p>This function does not check the tag, it just places what is in
 * the tag position into the buffer.
 * <p>This function will not return an error if it encounters
 * indefinite length, it will simply return the tag and len.
 * <p>This function will return an error if the first length octet is
 * not valid (such as 0xC3 or 0x8D).
 * <p>The caller passes the buffer into which the function will place
 * the result, the size of the buffer, and the number of bytes in the
 * buffer. There may have been a previous call that deposited some of
 * the tag and len bytes into the buffer, but not all.
 * <p>The caller passes the address of the size, if this function needs
 * to realloc, it will deposit at the size address the new size.
 * <p>The length arg is also an address. The function will go to that
 * address to get the current length and will deposit at that address
 * the new length.
 * <p>The function will also return the number of bytes read.
 * <p>If the call completes the tag and len, it will set the unsigned
 * int at complete to 1. If not, it will set it to 0.
 * <p>This function will not check encoding and encodingLen, it is the
 * responsibility of the caller to pass in a valid pointer of length
 * not zero.
 * <p>Because the function might realloc, pass the address of the
 * buffer, not the buffer itself.
 */
static int VOLT_CALLING_CONV CollectTagAndLenRealloc VOLT_PROTO_LIST ((
   VoltLibCtx *libCtx,
   unsigned char *encoding,
   unsigned int encodingLen,
   unsigned char **buffer,
   unsigned int *bufferSize,
   unsigned int *bufferLen,
   unsigned int *bytesRead,
   unsigned int *complete
));

/* Store the given data in the element buffer of the derElement struct.
 * If the buffer is big enough already, just store the data and set the
 * elementLen. If the buffer is not big enough, realloc and store.
 * <p>This function will append data. That is, if the elementLen is not
 * 0, the routine will keep the old data, append the new data onto the
 * end and increment elementLen. If elementLen is 0, this routine will
 * store the input as a new element buffer.
 *
 * @param libCtx
 * @param derElement
 * @param dataToStore
 * @param dataToStoreLen
 * @return an int, 0 if the function completed successfully or a
 * non-zero error code.
 */
static int VOLT_CALLING_CONV StoreElementData VOLT_PROTO_LIST ((
   VoltLibCtx *libCtx,
   VoltDerElement *derElement,
   unsigned char *dataToStore,
   unsigned int dataToStoreLen
));

int VoltDecodeTagAndLen (
   VoltLibCtx *libCtx,
   unsigned char *encoding,
   unsigned int encodingLen,
   unsigned int *theTag,
   unsigned int *lengthLen,
   UInt32 *valueLenLo,
   UInt32 *valueLenHi,
   unsigned int sizeofResult
   )
{
  int status;
  unsigned int len, index;
  UInt32 val;
  VOLT_DECLARE_FNCT_LINE (fnctLine)

  do
  {
    VOLT_SET_FNCT_LINE (fnctLine)
    status = VT_ERROR_INVALID_ENCODING;
    if (encoding == (unsigned char *)0)
      break;

    /* There must be at least 2 bytes, tag and len.
     */
    VOLT_SET_FNCT_LINE (fnctLine)
    status = VT_ERROR_INVALID_INPUT_LENGTH;
    if (encodingLen < 2)
      break;

    *theTag = (unsigned int)(encoding[0]);
    len = (unsigned int)(encoding[1]);

    *valueLenHi = (UInt32)0;

    /* If the length octet is <= 0x80, it's the only length octet and it
     * is the return value for valueLenLo.
     */
    if (len <= 0x80)
    {
      status = 0;
      *lengthLen = 1;
      *valueLenLo = (UInt32)len;
      break;
    }

    /* The 1st length octet is > 0x80, it describes how many length octets
     * there are: 0x8i where i is the number of length octets in addition
     * to the 1st length octet.
     * If the first nibble is not 8, error.
     */
    VOLT_SET_FNCT_LINE (fnctLine)
    status = VT_ERROR_INVALID_ENCODING;
    if ((len & 0xf0) != 0x80)
      break;

    len &= 0xf;

    /* If the caller put a limit on the size of the result, check to
     * see if the length exceeds that limit.
     */
    VOLT_SET_FNCT_LINE (fnctLine)
    if ( ((sizeofResult == 2) || (sizeofResult == 4)) && (len > sizeofResult) )
      break;

    /* Make sure the encoding has that many bytes (plus the tag and 1st
     * length octet).
     */
    VOLT_SET_FNCT_LINE (fnctLine)
    status = VT_ERROR_INVALID_INPUT_LENGTH;
    if (encodingLen < (len + 2))
      break;

    /* len now has the number of bytes that make up the actual length,
     * however, the lengthLen is the number of bytes needed to encode
     * the lenght, which includes the 0x8i.
     */
    *lengthLen = len + 1;

    /* Get the value length from the next len octets.
     */
    index = 2;
    val = 0;
    switch (len)
    {
      default:
        VOLT_SET_FNCT_LINE (fnctLine)
        status = VT_ERROR_INVALID_ENCODING;
        break;

      case 8:
        val = (UInt32)(encoding[index]);
        val <<= 8;
        index++;

      case 7:
        val += (UInt32)(encoding[index]);
        val <<= 8;
        index++;

      case 6:
        val += (UInt32)(encoding[index]);
        val <<= 8;
        index++;

      case 5:
        val += (UInt32)(encoding[index]);
        index++;

        *valueLenHi = val;
        val = 0;

      case 4:
        val = (UInt32)(encoding[index]);
        val <<= 8;
        index++;

      case 3:
        val += (UInt32)(encoding[index]);
        val <<= 8;
        index++;

      case 2:
        val += (UInt32)(encoding[index]);
        val <<= 8;
        index++;

      case 1:
        val += (UInt32)(encoding[index]);

        *valueLenLo = val;
        status = 0;
    }

  } while (0);

  VOLT_LOG_ERROR_INFO_COMPARE (
    status, libCtx, 0, status, 0, VT_ERROR_TYPE_PRIMARY,
    (char *)0, "VoltDecodeTagAndLen", fnctLine, (char *)0)

  return (status);
}

unsigned int VoltDetermineDerLengthLen (
   UInt32 valueLenLo,
   UInt32 valueLenHi
   )
{
  unsigned int retVal;
  UInt32 checkVal;

  retVal = 6;
  checkVal = valueLenHi;
  if (valueLenHi == 0)
  {
    if (valueLenLo <= 0x7f)
      return (1);

    retVal = 2;
    checkVal = valueLenLo;
  }

  /* Find the first byte in checkVal with something in it.
   */
  if ((checkVal & 0xffff0000) != 0)
  {
    checkVal >>= 16;
    retVal += 2;
  }
  if ((checkVal & 0xff00) != 0)
    retVal += 1;

  return (retVal);
}

unsigned int VoltWriteDerTagAndLen (
   unsigned char *buf,
   unsigned int tag,
   UInt32 valueLenLo,
   UInt32 valueLenHi
   )
{
  unsigned int count;
  UInt32 checkVal;

  buf[0] = (unsigned char)tag;

  count = 5;
  checkVal = valueLenHi;
  if (valueLenHi == 0)
  {
    if (valueLenLo <= 0x7f)
    {
      buf[1] = (unsigned char)valueLenLo;
      return (2);
    }

    count = 1;
    checkVal = valueLenLo;
  }

  /* Find the first byte in checkVal with something in it.
   */
  if ((checkVal & 0xffff0000) != 0)
  {
    checkVal >>= 16;
    count += 2;
  }
  if ((checkVal & 0xff00) != 0)
    count += 1;

  /* When the length is more than 0x7f, the first octet of length is
   * 0x8i, where i is the number of octets that make up the actual
   * length value.
   */
  buf[1] = (unsigned char)(count + 0x80);
  buf += 2;

  switch (count)
  {
    case 8:
      *buf = (unsigned char)(valueLenHi >> 24);
      buf++;

    case 7:
      *buf = (unsigned char)(valueLenHi >> 16);
      buf++;

    case 6:
      *buf = (unsigned char)(valueLenHi >> 8);
      buf++;

    case 5:
      *buf = (unsigned char)valueLenHi;
      buf++;

    case 4:
      *buf = (unsigned char)(valueLenLo >> 24);
      buf++;

    case 3:
      *buf = (unsigned char)(valueLenLo >> 16);
      buf++;

    case 2:
      *buf = (unsigned char)(valueLenLo >> 8);
      buf++;

    default:
      *buf = (unsigned char)valueLenLo;
  }

  return (count + 2);
}

#if VT_64_BIT_LENGTH == 64
#define VOLT_LEN_LIMIT 8
#else
#define VOLT_LEN_LIMIT 4
#endif

int VoltGetNextDerElement (
   VoltLibCtx *libCtx,
   unsigned char *encoding,
   unsigned  int encodingLen,
   unsigned int explicitTag,
   unsigned int expectedTag,
   unsigned int valueFlag,
   VoltDerElement *derElement,
   unsigned int *bytesRead
   )
{
  int status;
  unsigned int octetsRead, complete, lengthLen;
  UInt32 lenLo, lenHi;
  VOLT_DECLARE_ERROR_TYPE (errorType)
  VOLT_DECLARE_FNCT_LINE (fnctLine)

  /* If there's nothing to read, or if it's already captured, there's
   * nothing to do.
   */
  *bytesRead = 0;
  if ( (encodingLen == 0) || (derElement->complete != 0) )
    return (0);

  do
  {
    /* If there's an EXPLICIT tag, and it has not been collected yet,
     * collect it.

?? 快捷鍵說(shuō)明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
成人毛片老司机大片| 亚洲成人动漫一区| 国产成人av电影| 久久精品人人做人人爽人人| 国产乱码精品一区二区三| www久久精品| 国产宾馆实践打屁股91| 亚洲国产成人私人影院tom| 成人黄色综合网站| 亚洲国产精品综合小说图片区| 欧美日韩一区成人| 欧美96一区二区免费视频| 精品国精品自拍自在线| 岛国av在线一区| 一区二区三区在线影院| 欧美一区日韩一区| 国产不卡在线视频| 亚洲福利视频一区| 欧美精品一区二区久久婷婷| 成人网在线播放| 亚洲国产精品久久人人爱蜜臀| 日韩视频中午一区| av一区二区三区| 日韩电影在线免费| 日本一区二区免费在线观看视频 | 国产精品国产三级国产普通话99| 91首页免费视频| 日韩国产高清影视| 欧美极品xxx| 欧美精品tushy高清| 国产成人免费在线观看不卡| 一区二区激情视频| 2021国产精品久久精品| 欧美亚洲图片小说| 国产在线看一区| 亚洲一区二区美女| 久久久久久一级片| 欧美精品777| 99热国产精品| 国产一区在线不卡| 日韩影院在线观看| 国产精品欧美综合在线| 69精品人人人人| www.66久久| 国产另类ts人妖一区二区| 亚洲国产精品一区二区www| 国产三级欧美三级日产三级99| 日韩免费高清av| 日韩av电影天堂| 日韩中文字幕一区二区三区| 国产三级一区二区三区| 精品国产污污免费网站入口| 久久99精品一区二区三区| 一区二区国产视频| 午夜久久久久久| 久久精品国产精品亚洲红杏| 精品一区二区三区免费播放| 国产一区二区调教| kk眼镜猥琐国模调教系列一区二区 | 中文字幕亚洲精品在线观看| 国产精品女主播在线观看| 亚洲男人天堂av| 一区二区三区在线观看动漫| 亚洲bt欧美bt精品| 蜜臀av性久久久久蜜臀aⅴ流畅| 久久er99精品| 成人av在线资源网站| 色吊一区二区三区| 欧美巨大另类极品videosbest| 日韩亚洲欧美在线| 欧美激情一区三区| 亚洲午夜精品在线| 麻豆成人综合网| 波多野结衣中文字幕一区二区三区| 一本久久精品一区二区| 制服丝袜亚洲网站| 久久久无码精品亚洲日韩按摩| 亚洲图片欧美激情| 另类小说色综合网站| 成人黄色一级视频| 欧美一区二区三区四区久久| 国产午夜精品久久久久久久| 一个色在线综合| 国产精品99久久久久久久女警| 91成人网在线| 久久人人97超碰com| 亚洲一级不卡视频| 国产suv精品一区二区6| 欧美放荡的少妇| 国产精品二三区| 青青草国产精品亚洲专区无| 99久久精品费精品国产一区二区| 制服丝袜av成人在线看| 国产欧美一区二区三区在线看蜜臀 | 在线观看国产一区二区| 精品国产伦一区二区三区观看方式 | 国模套图日韩精品一区二区| 色婷婷综合久久久| 国产欧美精品国产国产专区| 日本三级亚洲精品| 色婷婷综合久久久久中文一区二区| 欧美精品一区二区三区在线 | 91久久精品国产91性色tv| 久久久精品免费免费| 亚洲成av人片一区二区| 成人av第一页| 久久亚洲一区二区三区四区| 婷婷成人综合网| 一本色道久久综合精品竹菊| 久久精品欧美日韩| 久久国产成人午夜av影院| 欧美日韩五月天| 亚洲精品国久久99热| 风间由美中文字幕在线看视频国产欧美| 91精品国产综合久久福利软件| 亚洲综合区在线| 99久久99久久免费精品蜜臀| 国产欧美日韩卡一| 国产精品77777| 2024国产精品| 国内精品伊人久久久久av影院 | 天堂一区二区在线免费观看| 91麻豆.com| 中文字幕在线不卡国产视频| 成人一级片在线观看| 久久无码av三级| 国产一区二区三区免费播放| 精品久久久久一区二区国产| 日本中文字幕一区二区视频 | 国产精品一区二区在线观看网站 | 6080yy午夜一二三区久久| 一区二区高清免费观看影视大全| 一本久久a久久免费精品不卡| 国产精品伦一区二区三级视频| 成人精品视频一区二区三区| 欧美经典三级视频一区二区三区| 国产一二三精品| 中文字幕欧美国产| 成人福利视频网站| 一区二区中文字幕在线| 91碰在线视频| 夜色激情一区二区| 欧美日韩高清一区二区三区| 午夜在线电影亚洲一区| 91精品中文字幕一区二区三区| 日韩专区欧美专区| 亚洲精品一区二区在线观看| 国产精品一区二区91| 国产精品每日更新| 91麻豆蜜桃一区二区三区| 亚洲天天做日日做天天谢日日欢| 色噜噜狠狠成人中文综合| 亚洲成人综合在线| 欧美一区二区三区性视频| 国产中文字幕精品| 国产精品第13页| 91国产福利在线| 另类小说色综合网站| 久久久www成人免费无遮挡大片| 成人免费毛片嘿嘿连载视频| 亚洲色图清纯唯美| 欧美三级中文字幕| 免费的成人av| 久久久国产一区二区三区四区小说| 成人免费三级在线| 午夜欧美视频在线观看| 亚洲精品一线二线三线无人区| 成人h版在线观看| 亚洲成av人影院| 久久精品一区二区三区av| 色综合色狠狠天天综合色| 午夜精品久久久久久久久久| 精品欧美一区二区三区精品久久| 波多野结衣一区二区三区| 亚洲国产一区二区视频| www精品美女久久久tv| 色噜噜狠狠成人中文综合| 免费的国产精品| 亚洲蜜臀av乱码久久精品 | 亚洲欧美另类图片小说| 91麻豆精品国产91| 成人av资源在线观看| 免费观看日韩电影| 综合电影一区二区三区 | 在线视频欧美精品| 激情五月婷婷综合网| 亚洲一区二区精品视频| 欧美激情一区二区| 欧美久久高跟鞋激| 不卡一区二区三区四区| 久久99国产精品久久99果冻传媒| 综合久久久久久| 2023国产精品自拍| 欧美裸体bbwbbwbbw| av成人免费在线| 韩日欧美一区二区三区| 亚洲高清免费一级二级三级| 中文字幕一区二区三区四区 | 亚洲综合精品久久| 国产精品乱码人人做人人爱|