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

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

?? browsertoken.cpp

?? IBE是一種非對稱密碼技術
?? CPP
?? 第 1 頁 / 共 3 頁
字號:
/* Copyright 2003-2005, Voltage Security, all rights reserved.
 */
#include "browsertoken.h"
#include "getkeys.h"
#include "idobj.h"
#include "defaultstore.h"
#include "voltfile.h"
#include "vsstore.h"
#include "vtime.h"
#include "arbitrarystore.h"
#include "PassDialog.h"
#include "passwordmanager.h"
#include <string.h>
#include <stdio.h>

#define VT_BROWSER_TOKEN_ARG1      "storetoken"
#define VT_BROWSER_TOKEN_ARG1_LEN  10
#define MAX_DISTRICT_NAME_LEN 100
#define MAX_PASSWORD_SIZE 64
#define APP_LABEL  "Toolkit TokenHandler"

#ifdef __cplusplus
extern "C"  {
#endif

VtIdentitySchemaDecode *decoders[1] = {
  VtIdentitySchemaDecode822Email
};
unsigned int decoderCount = 1;
VtDerCoder *derCoders[] = {VtDerCoderDSAPublicKey };
unsigned int coderCount = 1;

/* This "application" opens a file containing the XML structure
 * containing an identity and an associated auth token. It parses the
 * XML, stores the auth token in the given location in the request infos,
 * then downloads the IBE private key and cert for the identity. The token
 * Handler tries to fulfill all the requests pending. In order to interface 
 * this application with browsers (ex. Internet explorer) certain 
 * entries has to be stored in the registry. This application is invoked when
 * any file with .vat extension is double clicked. The main purpose of this application
 * is to handle and store crypto data when clients don't have Voltage SecureMail
 * installed on their machines. Below are the registry values that should exist
 * for this application to work as token handler. Copy the text below in a file with 
 * extension .reg and run it. The entries will be stored properly.
 *   
 Windows Registry Editor Version 5.00

 [HKEY_CLASSES_ROOT\.vat]
 @="vatfile"
 "Content Type"="application/x-vs-authtoken"

 [HKEY_CLASSES_ROOT\vatfile]
 @="Voltage Authentication Token"
 "EditFlags"=hex:00,00,01,00

 [HKEY_CLASSES_ROOT\vatfile\shell]

 [HKEY_CLASSES_ROOT\vatfile\shell\open]

 [HKEY_CLASSES_ROOT\vatfile\shell\open\command]
 @="C:\\toolkit\\lib\\TokenHandler\\Debug\\TokenHandler.exe storetoken \"%1\""

 [HKEY_CLASSES_ROOT\MIME\Database\Content Type\application/x-vs-authtoken]
 "Extension"=".vat"
 */


/* Initialize the icServerResponseData
*/
void InitializeResponseData (
  icServerResponseData *responseData,
  VoltLibCtx *libCtx ) 
{
    /* Initialize to null
    */
    Z2Memset(responseData, 0, sizeof(icServerResponseData) );
}

/* This is the routine to free a icServerResponseData object. 
*/
void FreeResponseData (
  icServerResponseData *responseData,
  VoltLibCtx *libCtx) 
{

  if(responseData ==(icServerResponseData *)0 )
    return;

  /* A server response has following components to free.
   */
  if (responseData->authToken != (void*) 0)  
  {
    Z2Free(responseData->authToken);
    responseData->authToken = (char *) 0;
  }
  if (responseData->privateKey != (void*) 0) 
  {
    Z2Free(responseData->privateKey);
    responseData->privateKey = (unsigned char *) 0;
  }
  if (responseData->id != (void*) 0)  
  {
    Z2Free(responseData->id);
    responseData->id = (unsigned char *) 0;
  }
  if (responseData->asn1Cert != (void*) 0)  
  {
    Asn1X509Cert_free (responseData->asn1Cert);
    responseData->asn1Cert = (Asn1X509Cert *) 0;
  }
  if (responseData->url != (void*) 0)  
  {
    Z2Free(responseData->url);
    responseData->url = (char *) 0;
  }
}

/* This will get the full path of the storage location.
 */
unsigned char *getStorageLocation (VtLibCtx libCtx, unsigned char *location)
{
  static unsigned char buff[256];

  if (location != (unsigned char *)0)
    return (location);

  getICDirectory ((VoltLibCtx *)libCtx, buff, 256);
  return (buff);
}

/* This is The main Token handler function
*/
int APIENTRY _tWinMain(HINSTANCE hInstance,
                     HINSTANCE hPrevInstance,
                     LPTSTR    lpCmdLine,
                     int       nCmdShow)
{
  int status=0, icRet, code, clientRequest;  
  unsigned int contentsLen;
  unsigned int deleteRequest, reqStatus;
  unsigned int bufferSize;
  unsigned int decoderIndex, storageIndex;
  VtLibCtx libraryCtx = (VtLibCtx)0;
  VtMpIntCtx mpIntCtx = (VtMpIntCtx)0;
  VoltLibCtx *libCtx = (VoltLibCtx *)0;
  VtFileCtx fCtx = (VtFileCtx)0;
  VoltFileCtx *fileCtx = (VoltFileCtx *)0;
  VoltFileHandle fileHandle = (VoltFileHandle)0;
  VtStorageCtx storageCtx = (VtStorageCtx)0;   
  VtStorageCtx clientStorage = (VtStorageCtx)0;
  VtStorageCtx toolkitStorage = (VtStorageCtx)0;
  VtTransportCtx transportCtx = (VtTransportCtx)0;
  VtArbitraryStorageObject arbitObj = (VtArbitraryStorageObject)0;
  VoltArbitraryStorageHandle *arbitHandle = (VoltArbitraryStorageHandle *)0;  
  VtIdentityObject idObj = (VtIdentityObject)0;  
  VoltIdentityObject *obj = (VoltIdentityObject *)0;   
  VtKeyObject ibePriKey = (VtKeyObject)0;    
  VtCertRequestObject certReq = (VtCertRequestObject)0;
  VtCertObject signingCert = (VtCertObject)0;     
  VtWinINetTransportInfo winTransInfo;
  VtFileCtxUseInfo storageInfo;  
  VtCertRequestInfo certInfo;  
  VoltRequestInfoData *getEntry;
  VtPasswordManagerCallback passwordInfo;
  unsigned char *contents = (unsigned char *)0;  
  unsigned char *fileName = (unsigned char *)0; 
  char errorString[512];    
  char *usage = "\nUsage: tokenhandler.exe storetoken <filename>..exiting\n";
  StorageStatus *storeList = (StorageStatus *)0;
  
  /* We need a server response data struct to store the response from the
   * Key server and parse it later.
   */
  icServerResponseData responseData ;  

  /* First, make sure the argument count is correct. We're expecting
   * three args (argv[0] is the conventional command, argv[1] should be
   * "storetoken", and argv[2] should be the file name.
   */    
  if (__argc != 3) {
    MessageBox (NULL, usage , "Toolkit Token Handler", MB_OK);
    printf(usage);
    return 0;
  }

  /* Check the args, the second arg should be "storetoken".
  */    
  if (strcmp (__argv[1], "storetoken") != 0) {
    printf("\n Invalid argument %s \n",__argv[1]);
    printf(usage);
    return 0;
  }   
  
  do
  {    
    /* We'll need a libCtx.
     */     
    status = VtCreateLibCtx (
      VtMemoryImplWin32, (Pointer)0,
      VtThreadImplDefaultSingle, (Pointer)0, &libraryCtx);
    if (status != 0)
      break;

    libCtx = (VoltLibCtx *)libraryCtx;

    /* initialize the server response data struct
    */
    InitializeResponseData (&responseData, libCtx);
  
    /*create Multi Precision Int context and set it onto the lib ctx.
     */
    status= VtCreateMpIntCtx (
      libraryCtx,VtMpIntImplOpenSSL, (Pointer) 0,&mpIntCtx);
    if (status != 0)
      break;
    status = VtSetLibCtxParam (
      libCtx, VtLibCtxParamMpCtx, (Pointer)mpIntCtx);
    if (status != 0)
      break;

    /* To store the token in a file system 
    *  We need a file ctx
    */
    status = VtCreateFileCtx (libCtx, VtFileImplWin32, (Pointer)0, &fCtx);
    if (status != 0)
      break;

    fileCtx = (VoltFileCtx *)fCtx;  

    /* Create a client compatible storage ctx
     */
    status = VtCreateStorageCtx (
      libCtx, VtStorageImplBasic, (Pointer)0, &clientStorage);
    if (status != 0)
      break;      
    status = VtAddStorageProvider (
      clientStorage, VtStorageFileWin32Client, (Pointer)fCtx);
    if (status != 0)
      break;

    /* Set up password information on the client storage
     */
    passwordInfo.PasswordFunction = PasswordManager;
    passwordInfo.appData = (Pointer)0;
    passwordInfo.AppDataCopy = (VtPasswordAppDataCopy)0;
    passwordInfo.AppDataFree = (VtPasswordAppDataFree)0;
    status = VtSetStorageParam (
      clientStorage, VtStorageParamPasswordManager, (Pointer)&passwordInfo);
    if (status != 0)
      break;

    winTransInfo.uiHandle = (Pointer)GetDesktopWindow ();    
    winTransInfo.asyncFlag = VT_ASYNC_RESPONSE_ALERT;    
    status = VtCreateTransportCtx (
      libCtx, VtTransportImplHttpsWinINet, (Pointer)&winTransInfo, &transportCtx);    
    if (status != 0)
      break;

    /* Create the arbitrary storage ctx
    */
    status = VoltCreateArbitraryStorageObject (
      libCtx, VtArbitraryStorageImplRequestInfo, (Pointer)0, &arbitObj);
    if (status != 0)
      break;

    /* The third arg should be a filename. Try to open that file.
     */
    fileName = (unsigned char *)__argv[2];
    status = fileCtx->CtxOpenFile (
      fileCtx, &fileHandle, (const unsigned char*)fileName,
      VOLT_FILE_MODE_READ_ONLY, 0);
    if (status != 0)
      break;

    /* How big is the file?
     */
   status = fileCtx->CtxGetFileSize (
     fileCtx, fileHandle, (const unsigned char *)0, (VoltFileInt *)&bufferSize);
    if (status != 0)
      break;

    /* Add an extra byte for a NULL-terminating character.
     */
    status = VT_ERROR_MEMORY;
    contents = (unsigned char *)Z2Malloc (bufferSize + 1, VOLT_MEMORY_SENSITIVE);
    if (contents == (unsigned char *)0)
      break;

    /* Read the file, make sure the data is NULL-terminated.
     */
    status = fileCtx->CtxReadFile (
      fileCtx, fileHandle, bufferSize, contents, &contentsLen);
    if (status != 0)
      break;
    contents[contentsLen] = 0;   
    fileCtx->CtxCloseFile(fileCtx, &fileHandle);

    /* Break the XML into the components.
     */    
    icRet = icParseServerResponse(&code, &responseData, (char *)contents,libCtx);    
    if (icRet != 0) 
    {
      status = VT_ERROR_INVALID_INPUT;
      break;
    }
    Z2Free (contents);   
    contents = (unsigned char *)0;

    /* We are expecting the code to be
     * IC_SERVER_TOKEN_RETURNED_RESPONSE.
     */
    if (code != IC_SERVER_TOKEN_RETURNED_RESPONSE)
      break;    

    /* Now create an identity object to use in requests and set it with the 
     * encoding that we got in the response from the server.
     */
    status = VtCreateIdentityObject (
      libraryCtx, VtIdentityImplMpCtx, (Pointer)mpIntCtx, &idObj);
    if (status != 0)
      break;
    status = VtDecodeIdentity (
      responseData.id, responseData.idLen, 
      decoders, decoderCount, &decoderIndex, idObj);
    if (status != 0)
      break;
    obj = (VoltIdentityObject *)idObj; 

    /* We'll need to store the auth token. Use the default storage
     * provider to store the token.
     */
    storageInfo.fileCtx = fCtx;
    storageInfo.path = (Pointer)0;    

    /* First check if there is a request from the client pending for
     * the same identity. If yes fulfill it first.
     */
    status = isClientRequestPending (
      libCtx, clientStorage, idObj, &clientRequest);
    if (status != 0)
    {
      MessageBox (
      NULL, ERROR_FIND_CLIENT_REQUEST_MSG, "Toolkit Token Handler", MB_OK);
    }

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
色综合天天综合狠狠| 免费人成网站在线观看欧美高清| 国产成人激情av| 国产欧美日韩三区| 成人av免费网站| 亚洲欧美经典视频| 欧美军同video69gay| 美女视频一区在线观看| 337p日本欧洲亚洲大胆色噜噜| 国产精品一区二区黑丝| 国产精品久久久久久久久图文区| 色就色 综合激情| 午夜免费欧美电影| 久久你懂得1024| www.久久精品| 日韩影院精彩在线| 国产色一区二区| 欧美自拍偷拍午夜视频| 久草精品在线观看| 亚洲色图视频免费播放| 911精品产国品一二三产区| 国产精品一区在线观看你懂的| 中文字幕视频一区二区三区久| 欧美日韩一级大片网址| 国产最新精品免费| 亚洲一二三专区| 337p粉嫩大胆噜噜噜噜噜91av| 色偷偷成人一区二区三区91| 美女视频一区在线观看| 亚洲精品免费一二三区| 精品三级av在线| 91搞黄在线观看| 国产福利一区在线观看| 午夜精品一区二区三区电影天堂| 久久精品免视看| 欧美精品一级二级| a在线播放不卡| 捆绑紧缚一区二区三区视频| 亚洲你懂的在线视频| 亚洲精品一区二区三区影院 | 亚洲色图欧美激情| 欧美成人性福生活免费看| 91在线视频18| 国内精品伊人久久久久av影院 | 欧美mv日韩mv亚洲| 在线观看国产日韩| 福利电影一区二区| 精品一区二区免费| 天天色 色综合| 一区av在线播放| 国产精品亲子伦对白| 精品国产在天天线2019| 欧美精品日韩一本| 91成人看片片| av午夜精品一区二区三区| 国产一区二区三区四区五区美女| 青青草国产成人99久久| 午夜精彩视频在线观看不卡| 伊人夜夜躁av伊人久久| 亚洲视频资源在线| 国产精品午夜在线| 国产欧美精品日韩区二区麻豆天美| 日韩小视频在线观看专区| 欧美日韩免费视频| 欧美视频一区二| 一本大道av一区二区在线播放| 成人深夜视频在线观看| 丁香桃色午夜亚洲一区二区三区| 激情久久久久久久久久久久久久久久| 五月婷婷综合网| 视频精品一区二区| 午夜精品福利一区二区蜜股av | 视频一区中文字幕国产| 亚洲一区二区美女| 亚洲一区二区视频| 亚洲第一电影网| 无码av免费一区二区三区试看| 亚洲国产一区视频| 午夜精品在线看| 蜜桃av一区二区| 精品在线观看免费| 国产曰批免费观看久久久| 国产一区二区三区在线观看精品 | 国产精品亚洲人在线观看| 国产一区二区毛片| 豆国产96在线|亚洲| 国产91富婆露脸刺激对白| 成人精品高清在线| 色综合久久中文综合久久牛| 欧美亚洲一区二区在线| 91精品一区二区三区久久久久久| 欧美精品日韩综合在线| 精品国产乱码久久| 国产精品美女久久久久久久| 亚洲蜜臀av乱码久久精品| 午夜精品在线视频一区| 久久99日本精品| 成人晚上爱看视频| 欧美日韩久久久一区| 日韩午夜av电影| 欧美激情一区二区三区| 亚洲视频小说图片| 日本视频在线一区| 国产精品一区二区x88av| 94-欧美-setu| 91精品国产麻豆| 中文字幕成人网| 亚洲无线码一区二区三区| 老司机免费视频一区二区| 成人av综合在线| 欧美高清你懂得| 国产三级三级三级精品8ⅰ区| 一区二区三区日韩精品视频| 秋霞电影网一区二区| 成人黄色在线网站| 欧美精选一区二区| 欧美国产禁国产网站cc| 香蕉av福利精品导航| 丰满少妇久久久久久久| 欧美精品久久久久久久久老牛影院| 日韩欧美一区二区视频| 樱桃国产成人精品视频| 国产在线看一区| 欧美婷婷六月丁香综合色| 精品播放一区二区| 亚洲午夜影视影院在线观看| 国产精品自在欧美一区| 欧美欧美午夜aⅴ在线观看| 国产日韩欧美在线一区| 免费在线看成人av| 91黄色小视频| 国产日韩欧美a| 日韩成人dvd| 91在线视频网址| 久久久精品2019中文字幕之3| 性久久久久久久| 在线日韩国产精品| 国产精品网曝门| 国产在线观看一区二区| 日韩视频不卡中文| 亚洲综合在线五月| 成人黄色网址在线观看| 欧美精品一区二区久久久| 视频一区国产视频| 欧美色视频一区| 亚洲欧美另类在线| 99久免费精品视频在线观看 | 欧美日韩一区 二区 三区 久久精品| 国产精品久久久久毛片软件| 久久精品国产亚洲a| 欧美日本在线视频| 亚洲午夜视频在线观看| 9色porny自拍视频一区二区| 国产午夜精品一区二区| 久久精品国内一区二区三区| 9191国产精品| 午夜精品福利在线| 在线综合+亚洲+欧美中文字幕| 一区二区免费在线| 色成人在线视频| 自拍偷在线精品自拍偷无码专区| 国产传媒一区在线| 2023国产精品自拍| 国内精品自线一区二区三区视频| 亚洲精品一区二区在线观看| 精品无人码麻豆乱码1区2区 | 制服.丝袜.亚洲.另类.中文| 丝袜美腿亚洲一区二区图片| 欧美日韩一区二区欧美激情 | 国产精品久久久久久久久久免费看| 久久爱www久久做| 欧美不卡一区二区三区四区| 日本一区中文字幕| 日韩一区二区不卡| 玖玖九九国产精品| 精品裸体舞一区二区三区| 九九精品一区二区| 久久九九国产精品| eeuss鲁片一区二区三区在线看| 国产精品毛片高清在线完整版| 成人性生交大片| 亚洲男帅同性gay1069| 久久奇米777| 91激情在线视频| 色偷偷久久一区二区三区| 欧美一区二区在线看| 中文字幕欧美日韩一区| 亚洲乱码精品一二三四区日韩在线| 99vv1com这只有精品| 亚洲图片欧美色图| 91精品国产色综合久久不卡蜜臀 | www国产精品av| voyeur盗摄精品| 亚洲成人av电影| 精品少妇一区二区三区在线视频| 91精品在线免费观看| 国产一区在线观看麻豆| 亚洲女同一区二区| 日韩欧美精品在线| 91在线云播放|