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

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

?? win32filestore.c

?? IBE是一種非對稱密碼技術(shù)
?? C
?? 第 1 頁 / 共 5 頁
字號:
  unsigned char *algId = (unsigned char *)0;
  unsigned char *salt = (unsigned char *)0;
  unsigned char *oldHmac = (unsigned char *)0;
  unsigned char *newHmac = (unsigned char *)0;
  unsigned char *passwordInfo = (unsigned char *)0;
  unsigned char *password = (unsigned char *)0;
  unsigned char *oldPassword = (unsigned char *)0;
  VOLT_DECLARE_ERROR_TYPE (errorType)
  VOLT_DECLARE_FNCT_LINE (fnctLine)

  /* Initialize to "don't delete the password file".
   */
  deletePasswordFile = 0;

  do
  {
    /* If there is info, it must be a random object.
     */
    if (info != (Pointer)0)
    {
      random = (VtRandomObject)info;
      status = VT_ERROR_INVALID_ASSOCIATED_INFO;
      VOLT_SET_ERROR_TYPE (errorType, VT_ERROR_TYPE_PRIMARY)
      VOLT_SET_FNCT_LINE (fnctLine)
      if (VOLT_OBJECT_TYPE_NOT_EQUAL (info, VOLT_OBJECT_TYPE_RANDOM))
        break;
    }

    /* Make sure we have a password manager.
     */   
    PasswordManager = (VtPasswordManager)ctx->passwordCtx.PasswordFunction;
    VOLT_SET_FNCT_LINE (fnctLine)
    status = VT_ERROR_INVALID_STORAGE_CTX;
    if (PasswordManager == (VtPasswordManager)0)
      break;

    /* Get the current password info and file handle.
     */
    VOLT_SET_ERROR_TYPE (errorType, 0)
    VOLT_SET_FNCT_LINE (fnctLine)
    status = VoltGetSaltAndHmacFromFile (
      ctx, &iterationCount, &algId, &algIdLen, &salt, &saltLen,
      &oldHmac, &oldHmacLen, &fileName, &fileHandle);
    if (status != 0)
      break;

    /* Get a DigestImpl to be used to check the password. If the info
     * was in the file, algId contains the algID. If not, algID is NULL
     * and this function will use a default algorithm, allocate a new
     * buffer, and set that buffer with the algID.
     */
    VOLT_SET_FNCT_LINE (fnctLine)
    status = VoltGetDigestImpl (libCtx, &algId, &algIdLen, &DigestImpl);
    if (status != 0)
      break;

    /* If there's no file, we're setting a new password.
     */
    if (fileHandle == (VoltFileHandle)0)
    {
      /* Get the password we'll be using.
       */
      VOLT_SET_FNCT_LINE (fnctLine)
      status = PasswordManager (
        (VtLibCtx)libCtx, ctx->passwordCtx.appData,
        VT_PASSWORD_MGR_PURPOSE_SET, &oldPassword, &oldPasswordLen,
        &password, &passwordLen);
      if (status != 0)
        break;

      /* Create the file to hold the password info.
       */
      VOLT_SET_FNCT_LINE (fnctLine)
      status = fileCtx->CtxCreateDirectories (fileCtx, fileName);
      if (status != 0)
        break;

      VOLT_SET_FNCT_LINE (fnctLine)
      status = fileCtx->CtxOpenFile (
        fileCtx, &fileHandle, fileName, VOLT_FILE_MODE_READ_OVERWRITE, 0);
      if (status != 0)
        break;      

      /* Build an empty salt buffer.
       */
      saltLen = VOLT_EXTRA_PASS_SALT_LEN;
      VOLT_SET_ERROR_TYPE (errorType, VT_ERROR_TYPE_PRIMARY)
      VOLT_SET_FNCT_LINE (fnctLine)
      status = VT_ERROR_MEMORY;
      salt = (unsigned char *)Z2Malloc (saltLen, 0);
      if (salt == (unsigned char *)0)
        break;

      /* Set the iteration count.
       */
      iterationCount = VOLT_EXTRA_PASS_ITERATION_COUNT;
      oldPassword = (unsigned char *)0;
      oldPasswordLen = 0;
    }
    else
    {
      /* If there is a file, there's an old password.
       */
      purpose = VT_PASSWORD_MGR_PURPOSE_CHANGE;
      do
      {
        /* Confirm that the old password is correct. First, get the
         * passwords.
         */
        VOLT_SET_ERROR_TYPE (errorType, 0)
        VOLT_SET_FNCT_LINE (fnctLine)
        status = PasswordManager (
        (VtLibCtx)libCtx, ctx->passwordCtx.appData, purpose,
          &oldPassword, &oldPasswordLen, &password, &passwordLen);
        if (status != 0)
          break;

        /* If the callback returned an empty old password we know it's
         * wrong. The password file is created only if there is a non
         * empty password set. So we want to retry in that case.
         */
        purpose = VT_PASSWORD_MGR_PURPOSE_CHANGE_RETRY;
        if ( (oldPassword == (unsigned char *)0) || (oldPasswordLen == 0) )
          continue;

        /* Use newHmac as a temp variable.
         */
        VOLT_SET_FNCT_LINE (fnctLine)
        status = ComputePasswordHmacAlloc (
          libCtx, random, VOLT_USE_SALT, DigestImpl,
          oldPassword, oldPasswordLen, salt, saltLen, &newHmac, &newHmacLen);
        if (status != 0)
          break;        

        /* Is the passwordHmac that we just computed the same as the HMAC
         * in the file? If so, we have the correct old password.
         */
        cmpResult = Z2Memcmp (newHmac, oldHmac, newHmacLen);

        Z2Free (newHmac);
        newHmac = (unsigned char *)0;

        if (cmpResult == 0)
          break;

      } while (1);      
      if (status != 0)
        break;
    }

    /* At this point we have both the correct old password and  the new
     * password. If the new password is empty, it means the caller
     * wants to clear any extra passwords set. So an empty password
     * should be treated as no password instead of an empty password.
     */
    if ( (password == (unsigned char *)0) || (passwordLen == 0) )
    {
      password = (unsigned char *)0;
      passwordLen = 0;
    }

    /* We now need to re-encrypt all the appropriate files serviced by
     * this storage provider with the new password.
     */
    VOLT_SET_ERROR_TYPE (errorType, 0)
    VOLT_SET_FNCT_LINE (fnctLine)
    status = VoltReEncryptFiles (
      ctx, oldPassword, oldPasswordLen, password, passwordLen);
    if (status != 0)
      break;

    /* If the new password is empty we need to delete the password file
     * indicating that no password is set.
     */
    if (passwordLen == 0)
    {
      deletePasswordFile = 1;  
      break;
    }
    
    /* Compute the password values for the new password.
     */
    VOLT_SET_FNCT_LINE (fnctLine)
    status = ComputePasswordHmacAlloc (
      libCtx, random, VOLT_COMPUTE_SALT, DigestImpl, password, passwordLen,
      salt, saltLen, &newHmac, &newHmacLen);
    if (status != 0)
      break;
    
    /* Build the block of data that is the HMAC info stored in the file.
     */
    VOLT_SET_FNCT_LINE (fnctLine)
    status = VoltBuildPasswordInfoAlloc (
      libCtx, algId, algIdLen, iterationCount, salt, saltLen,
      newHmac, newHmacLen, &passwordInfo, &passwordInfoLen);
    if (status != 0)
      break;

    /* Store the password HMAC info in the file. This is the password
     * file, so it does not take an extra password.
     */
    VOLT_SET_FNCT_LINE (fnctLine)
    status = mIcStoreData (
      ctx, passwordInfo, passwordInfoLen, (unsigned char *)0, 0,
      fileCtx, fileHandle);

  } while (0);

  if (fileHandle != (VoltFileHandle)0)
  {
    fileCtx->CtxCloseFile (fileCtx, &fileHandle);
    if (deletePasswordFile != 0)
      fileCtx->CtxDeleteFile (fileCtx, (VoltFileHandle *)0, fileName);
  }

  if ( (password != (unsigned char *)0) ||
       (oldPassword != (unsigned char *)0) )
  {
    PasswordManager (
      (VtLibCtx)libCtx, ctx->passwordCtx.appData,
      VT_PASSWORD_MGR_PURPOSE_RELEASE, &oldPassword, &oldPasswordLen,
      &password, &passwordLen);
  }

  if (fileName != (unsigned char *)0)
    Z2Free (fileName);
  if (algId != (unsigned char *)0)
    Z2Free (algId);
  if (salt != (unsigned char *)0)
    Z2Free (salt);
  if (oldHmac != (unsigned char *)0)
    Z2Free (oldHmac);
  if (newHmac != (unsigned char *)0)
    Z2Free (newHmac);
  if (passwordInfo != (unsigned char *)0)
    Z2Free (passwordInfo);

  if (status == 0)
    return status;

  VOLT_LOG_ERROR (
    (VtLibCtx)libCtx, status, errorType, fnctLine,
    "VoltWinSetExtraPassword", (char *)0)

  return (status);
}

int VoltWinClientSetExtraPassword (
   VtStorageCtx storageCtx,
   Pointer info
   )
{
  int status;
  unsigned int purpose, valueLen, passwordLen, oldPasswordLen, hmacLen, saltLen;
  VoltStorageCtx *ctx = (VoltStorageCtx *)storageCtx;
  VoltLibCtx *libCtx = (VoltLibCtx *)(ctx->voltObject.libraryCtx);
  VoltDefaultStorageCtx *localCtx =
    (VoltDefaultStorageCtx *)(ctx->localStorageCtx);  
  VtPasswordManager PasswordManager = (VtPasswordManager)0;
  VtRandomObject random = (VtRandomObject)0;
  unsigned char buffer[VOLT_EXTRA_PASS_SALT_LEN + VOLT_EXTRA_PASS_HMAC_LEN];
  unsigned char oldHmac[VOLT_EXTRA_PASS_HMAC_LEN];
  unsigned char *password = (unsigned char *)0;
  unsigned char *oldPassword = (unsigned char *)0;
  unsigned char *salt;
  unsigned char *passwordHmac;
  VOLT_DECLARE_ERROR_TYPE (errorType)
  VOLT_DECLARE_FNCT_LINE (fnctLine)

  salt = buffer;
  passwordHmac = salt + VOLT_EXTRA_PASS_SALT_LEN;
  saltLen = VOLT_EXTRA_PASS_SALT_LEN;
  hmacLen = VOLT_EXTRA_PASS_HMAC_LEN;

  do
  {
    /* If there is info, it must be a random object.
     */
    if (info != (Pointer)0)
    {
      random = (VtRandomObject)info;
      status = VT_ERROR_INVALID_ASSOCIATED_INFO;
      VOLT_SET_ERROR_TYPE (errorType, VT_ERROR_TYPE_PRIMARY)
      VOLT_SET_FNCT_LINE (fnctLine)
      if (VOLT_OBJECT_TYPE_NOT_EQUAL (info, VOLT_OBJECT_TYPE_RANDOM))
        break;
    }

    /* Make sure we have a password manager.
     */    
    PasswordManager = (VtPasswordManager)(ctx->passwordCtx.PasswordFunction);
    VOLT_SET_FNCT_LINE (fnctLine)
    status = VT_ERROR_INVALID_STORAGE_CTX;
    if (PasswordManager == (VtPasswordManager)0)
      break;

    /* Get the current password info and file handle.
     */
    VOLT_SET_ERROR_TYPE (errorType, 0)
    VOLT_SET_FNCT_LINE (fnctLine)
    status = VoltGetSaltAndHmacFromRegistry (ctx, buffer, &valueLen);
    if (status != 0)
      break;

    /* If valueLen is 0, there's no current password, we're setting a
     * new one.
     */
    if (valueLen == 0)
    {
      /* Get the password we'll be using.
       */
      VOLT_SET_FNCT_LINE (fnctLine)
      status = PasswordManager (
        (VtLibCtx)libCtx, ctx->passwordCtx.appData,
        VT_PASSWORD_MGR_PURPOSE_SET, &oldPassword, &oldPasswordLen,
        &password, &passwordLen);
      if (status != 0)
        break;

      /* Make sure oldPassword is still NULL. When we later on
       * re-encrypt, this variable has to be NULL so that we don't try
       * to use an old password with existing data. It was originally
       * NULL, but the password mgr might have reset it. The mgr should
       * not have reset it, but we'll make sure it's NULL because we
       * don't have control of the password mgr.
       */
      oldPassword = (unsigned char *)0;
      oldPasswordLen = 0;
    }
    else
    {
      /* If there is a old password info, there's an old password.
       */
      purpose = VT_PASSWORD_MGR_PURPOSE_CHANGE;
      do
      {
        /* Confirm that the old password is correct. First, get the
         * passwords.
         */
        VOLT_SET_FNCT_LINE (fnctLine)
        status = PasswordManager (
          (VtLibCtx)libCtx, ctx->passwordCtx.appData, purpose,
          &oldPassword, &oldPasswordLen, &password, &passwordLen);
        if (status != 0)
          break;

        /* If the callback returned an empty old password we know it's
         * wrong. The password file is created only if there is a non
         * empty password set. So we want to retry in that case.
         */
        purpose = VT_PASSWORD_MGR_PURPOSE_CHANGE_RETRY;
        if ( (oldPassword == (unsigned char *)0) || (oldPasswordLen == 0) )
          continue;

        VOLT_SET_FNCT_LINE (fnctLine)
        status = ComputePasswordValuesClient (
          libCtx, random, VOLT_USE_SALT, oldPassword, oldPasswordLen,
          salt, oldHmac, &hmacLen);
        if (status != 0)
          break;

        /* Is the passwordHmac that we just computed the same as the HMAC
         * in the file? If so, we have the correct old password.
         */
        if (Z2Memcmp (passwordHmac, oldHmac, hmacLen) == 0)
          break;

      } while (1);
      if (status != 0)
        break;
    }

    /* At this point we have both the correct old password and  the new
     * password. If the new password is empty, it means the caller
     * wants to clear any extra passwords set. So an empty password
     * should be treated as no password instead of an empty password.
     */
    if ( (password == (unsigned char *)0) || (passwordLen == 0) )
    {
      password = (unsigned char *)0;
      passwordLen = 0;
    }

    /* We now need to re-encrypt all the apprpriate files serviced by
     * this storage provider with the new password.
     */
    VOLT_SET_ERROR_TYPE (errorType, 0)
    VOLT_S

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日韩高清中文字幕一区| 欧美日韩在线一区二区| 国产精品一区二区免费不卡| 久久99深爱久久99精品| 蜜臀a∨国产成人精品| 日韩av电影免费观看高清完整版| 亚洲午夜精品在线| 香蕉加勒比综合久久| 视频一区欧美精品| 看片网站欧美日韩| 国产乱一区二区| 粉嫩av一区二区三区粉嫩| 成人免费毛片嘿嘿连载视频| www.欧美日韩| 欧美无乱码久久久免费午夜一区| 欧美日韩一区 二区 三区 久久精品| 欧美色图片你懂的| 日韩一区二区精品| 久久色视频免费观看| 国产精品区一区二区三| 伊人色综合久久天天人手人婷| 亚洲影院在线观看| 日韩二区三区四区| 国产成人一级电影| 97久久精品人人做人人爽| 欧美综合视频在线观看| 日韩一级在线观看| 欧美激情中文不卡| 亚洲乱码精品一二三四区日韩在线| 亚洲午夜电影在线| 精品无人区卡一卡二卡三乱码免费卡 | 久久久影院官网| 欧美高清一级片在线观看| 亚洲精品老司机| 美女看a上一区| 成人精品高清在线| 欧美日本高清视频在线观看| 欧美精品一区二区在线观看| 国产精品久久久久久久蜜臀| 亚洲综合激情小说| 国产精品综合一区二区| 91在线精品一区二区| 制服丝袜一区二区三区| 国产亚洲一区二区三区在线观看| 一区二区三区在线视频观看| 久久国产精品一区二区| 色狠狠一区二区三区香蕉| 欧美岛国在线观看| 一区二区三区鲁丝不卡| 精品亚洲国产成人av制服丝袜| 色综合天天狠狠| 久久综合色播五月| 亚洲国产综合91精品麻豆| 国产在线不卡一区| 精品视频在线免费看| 中文字幕av免费专区久久| 午夜精品久久久久久久久久久| 国产专区欧美精品| 欧美亚洲一区三区| 国产精品家庭影院| 久久se精品一区精品二区| 欧美亚洲愉拍一区二区| 国产精品高潮呻吟| 黄色日韩三级电影| 欧美福利一区二区| 亚洲精品日韩一| 国产成人av在线影院| 欧美一区二区三区性视频| 亚洲精品日韩专区silk| 成人免费视频免费观看| www久久久久| 麻豆国产精品视频| 欧美视频在线一区| 亚洲欧美一区二区三区极速播放| 国产精品主播直播| 日韩欧美一区二区在线视频| 一区二区三区精品| 91免费视频网址| 国产精品免费看片| 国产一区二区免费看| 91精品国产色综合久久| 亚洲国产一二三| 色婷婷综合久久久中文一区二区| 国产性色一区二区| 国产一区亚洲一区| 欧美不卡在线视频| 日本不卡视频在线| 欧美精品自拍偷拍| 亚州成人在线电影| 69p69国产精品| 婷婷成人综合网| 6080国产精品一区二区| 婷婷综合另类小说色区| 欧美制服丝袜第一页| 亚洲精品久久嫩草网站秘色| 色综合天天综合网天天狠天天| 1000部国产精品成人观看| 国产91丝袜在线18| 国产精品网曝门| 北条麻妃国产九九精品视频| 中文字幕不卡在线观看| 国产宾馆实践打屁股91| 国产区在线观看成人精品| 国产成人99久久亚洲综合精品| 国产亚洲成av人在线观看导航| 国产精品白丝jk白祙喷水网站| www亚洲一区| 成人h精品动漫一区二区三区| 久久久精品国产99久久精品芒果| 国产精品一二一区| 国产欧美一区二区精品性色超碰| 国产在线视频精品一区| 日本一区二区综合亚洲| 91影院在线免费观看| 亚洲综合色网站| 7777女厕盗摄久久久| 九九精品一区二区| 欧美韩国日本综合| 91丨porny丨最新| 亚洲综合网站在线观看| 欧美嫩在线观看| 九九久久精品视频| 中文字幕亚洲电影| 欧美色图免费看| 韩国v欧美v亚洲v日本v| 国产精品色噜噜| 欧美视频在线观看一区| 精品一区二区久久| 国产精品午夜久久| 欧美性猛交一区二区三区精品| 免费在线欧美视频| 国产精品少妇自拍| 精品视频在线免费| 久久国产精品99久久久久久老狼| 国产夜色精品一区二区av| 91啦中文在线观看| 蜜臀久久久久久久| 中文文精品字幕一区二区| 欧美在线观看一区二区| 蜜桃一区二区三区在线| 国产精品私人影院| 欧美绝品在线观看成人午夜影视| 国产一区二区三区免费播放| 亚洲区小说区图片区qvod| 日韩一二三四区| av电影在线观看完整版一区二区| 天堂蜜桃一区二区三区| 亚洲国产精华液网站w| 欧美另类videos死尸| 国产99久久久国产精品潘金| 亚洲国产精品久久人人爱| 久久久综合视频| 欧美日韩电影一区| 成人一区在线观看| 日本在线不卡视频| 亚洲免费在线视频一区 二区| 欧美大度的电影原声| 欧美午夜影院一区| 成人免费视频免费观看| 免费观看日韩av| 一区二区三区丝袜| 国产日韩精品一区| 日韩三级高清在线| 欧洲一区二区av| 国产iv一区二区三区| 日本视频一区二区| 亚洲精品视频在线观看免费| 久久久无码精品亚洲日韩按摩| 欧美无乱码久久久免费午夜一区| 成人综合婷婷国产精品久久| 蜜臀av一级做a爰片久久| 亚洲狠狠丁香婷婷综合久久久| 久久午夜色播影院免费高清| 91精品欧美一区二区三区综合在 | 99r精品视频| 另类小说色综合网站| 亚洲一区二区四区蜜桃| 国产精品欧美一级免费| xnxx国产精品| 日韩免费一区二区| 777久久久精品| 欧美日韩在线三区| 91成人免费电影| 99视频一区二区| 大尺度一区二区| 国产福利精品一区二区| 久久草av在线| 美腿丝袜亚洲色图| 五月婷婷欧美视频| 亚洲成人在线网站| 亚洲一区自拍偷拍| 亚洲精品成人少妇| 亚洲色图一区二区| 中文字幕一区二区三区在线不卡| 精品国产乱码久久久久久免费 | 亚洲一区在线观看免费观看电影高清| 国产精品成人一区二区艾草 | 成人福利视频在线看| 国产盗摄一区二区| 国产福利不卡视频|