⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 zdmparams.c

📁 IBE是一种非对称密码技术
💻 C
📖 第 1 页 / 共 5 页
字号:
    if (zdmObj != (VtZDMObject)0)
      libCtx = zdmObj->voltObject.libraryCtx;
    
    if ((flag == VOLT_ZDM_SET_TYPE_FLAG) && (info != (Pointer)0))
    {
      format = *(unsigned int*)info;
      if ((format != VT_MESSAGE_FORMAT_ZDM_DATA) &&
          (format != VT_MESSAGE_FORMAT_ZDM) &&
          (format != VT_MESSAGE_FORMAT_SECURE_MAIL))
      {
        VOLT_SET_ERROR_TYPE (errorType, VT_ERROR_TYPE_PRIMARY)
        VOLT_SET_FNCT_LINE(fnctLine)
        status = VT_ERROR_INVALID_ASSOCIATED_INFO;
        break;
      }
    }
    
    VOLT_SET_FNCT_LINE (fnctLine)
    status = VoltZDMParamCommon(zdmObj, info, flag, 
      VT_ZDM_SET_SUPPORTED | VT_ZDM_SET_INFO_REQUIRED,
      VT_ZDM_PARAM_MESSAGE_FORMAT);
  }
  while (0);
  
  VOLT_LOG_ERROR_COMPARE (
    status, libCtx, status, errorType,
    fnctLine, "VtZDMParamMessageFormat", (unsigned char *)0)

  return (status);
}

int VtZDMParamMessageBodySize (
   VtZDMObject zdmObj,
   Pointer info,
   unsigned int flag
   )
{
  int status;
  VtLibCtx libCtx = (VtLibCtx)0;
  VOLT_DECLARE_FNCT_LINE (fnctLine)

  if (zdmObj != (VtZDMObject)0)
    libCtx = zdmObj->voltObject.libraryCtx;
    
  VOLT_SET_FNCT_LINE (fnctLine)
  status = VoltZDMParamCommon(zdmObj, info, flag, 
    VT_ZDM_GET_SUPPORTED, VT_ZDM_PARAM_MESSAGE_BODY_SIZE);

  VOLT_LOG_ERROR_COMPARE (
    status, libCtx, status, 0, fnctLine,
    "VtZDMParamMessageBodySize", (unsigned char *)0)

  return (status);
}


int VtZDMParamReplyTo (
   VtZDMObject zdmObj,
   Pointer info,
   unsigned int flag
   )
{
  int status;
  VtLibCtx libCtx = (VtLibCtx)0;
  VOLT_DECLARE_FNCT_LINE (fnctLine)

  if (zdmObj != (VtZDMObject)0)
    libCtx = zdmObj->voltObject.libraryCtx;
    
  VOLT_SET_FNCT_LINE (fnctLine)
  status = VoltZDMParamCommon(zdmObj, info, flag, 
    VT_ZDM_GET_AND_SET_SUPPORTED | VT_ZDM_SET_INFO_REQUIRED,
    VT_ZDM_PARAM_REPLY_TO);

  VOLT_LOG_ERROR_COMPARE (
    status, libCtx, status, 0, fnctLine,
    "VtZDMParamReplyTo", (unsigned char *)0)

  return (status);
}

int VtZDMParamMessageID (
   VtZDMObject zdmObj,
   Pointer info,
   unsigned int flag
   )
{
  int status;
  VtLibCtx libCtx = (VtLibCtx)0;
  VOLT_DECLARE_FNCT_LINE (fnctLine)

  if (zdmObj != (VtZDMObject)0)
    libCtx = zdmObj->voltObject.libraryCtx;
    
  VOLT_SET_FNCT_LINE (fnctLine)
  status = VoltZDMParamCommon(zdmObj, info, flag, 
    VT_ZDM_GET_AND_SET_SUPPORTED | VT_ZDM_SET_INFO_REQUIRED,
    VT_ZDM_PARAM_MESSAGE_ID);

  VOLT_LOG_ERROR_COMPARE (
    status, libCtx, status, 0, fnctLine,
    "VtZDMParamMessageID", (unsigned char *)0)

  return (status);
}

int VtZDMParamInsecureMessageID (
   VtZDMObject zdmObj,
   Pointer info,
   unsigned int flag
   )
{
  int status;
  VtLibCtx libCtx = (VtLibCtx)0;
  VOLT_DECLARE_FNCT_LINE (fnctLine)

  if (zdmObj != (VtZDMObject)0)
    libCtx = zdmObj->voltObject.libraryCtx;
    
  VOLT_SET_FNCT_LINE (fnctLine)
  status = VoltZDMParamCommon(zdmObj, info, flag, 
    VT_ZDM_GET_AND_SET_SUPPORTED | VT_ZDM_SET_INFO_REQUIRED,
    VT_ZDM_PARAM_INSECURE_MESSAGE_ID);

  VOLT_LOG_ERROR_COMPARE (
    status, libCtx, status, 0, fnctLine,
    "VtZDMParamInsecureMessageID", (unsigned char *)0)

  return (status);
}

int VtZDMParamTemplateCharset (
   VtZDMObject zdmObj,
   Pointer info,
   unsigned int flag
   )
{
  int status;
  VtLibCtx libCtx = (VtLibCtx)0;
  VOLT_DECLARE_FNCT_LINE (fnctLine)

  if (zdmObj != (VtZDMObject)0)
    libCtx = zdmObj->voltObject.libraryCtx;
    
  VOLT_SET_FNCT_LINE (fnctLine)
  status = VoltZDMParamCommon(zdmObj, info, flag, 
    VT_ZDM_SET_SUPPORTED | VT_ZDM_SET_INFO_REQUIRED,
    VT_ZDM_PARAM_TEMPLATE_CHARSET);

  VOLT_LOG_ERROR_COMPARE (
    status, libCtx, status, 0, fnctLine,
    "VtZDMParamTemplateCharset", (unsigned char *)0)

  return (status);
}

int VtZDMParamDesignatedRecipient (
   VtZDMObject zdmObj,
   Pointer info,
   unsigned int flag
   )
{
  int status;
  VtLibCtx libCtx = (VtLibCtx)0;
  VOLT_DECLARE_FNCT_LINE (fnctLine)

  if (zdmObj != (VtZDMObject)0)
    libCtx = zdmObj->voltObject.libraryCtx;
    
  VOLT_SET_FNCT_LINE (fnctLine)
  status = VoltZDMParamCommon(zdmObj, info, flag, 
    VT_ZDM_SET_SUPPORTED | VT_ZDM_SET_INFO_REQUIRED,
    VT_ZDM_PARAM_DESIGNATED_RECIPIENT);

  VOLT_LOG_ERROR_COMPARE (
    status, libCtx, status, 0, fnctLine,
    "VtZDMParamDesignatedRecipient", (unsigned char *)0)

  return (status);
}

int VtZDMParamSupportedVersion (
   VtZDMObject zdmObj,
   Pointer info,
   unsigned int flag
   )
{
  int status;
  VtLibCtx libCtx = (VtLibCtx)0;
  VOLT_DECLARE_FNCT_LINE (fnctLine)

  if (zdmObj != (VtZDMObject)0)
    libCtx = zdmObj->voltObject.libraryCtx;
    
  VOLT_SET_FNCT_LINE (fnctLine)
  status = VoltZDMParamCommon(zdmObj, info, flag, 
    VT_ZDM_GET_SUPPORTED, VT_ZDM_PARAM_SUPPORTED_VERSION);

  VOLT_LOG_ERROR_COMPARE (
    status, libCtx, status, 0, fnctLine,
    "VtZDMParamSupportedVersion", (unsigned char *)0)

  return (status);
}

int VtZDMParamAttachmentCount (
   VtZDMObject zdmObj,
   Pointer info,
   unsigned int flag
   )
{
  int status;
  VtLibCtx libCtx = (VtLibCtx)0;
  VOLT_DECLARE_FNCT_LINE (fnctLine)

  if (zdmObj != (VtZDMObject)0)
    libCtx = zdmObj->voltObject.libraryCtx;
    
  VOLT_SET_FNCT_LINE (fnctLine)
  status = VoltZDMParamCommon(zdmObj, info, flag, 
    VT_ZDM_GET_SUPPORTED, VT_ZDM_PARAM_ATTACHMENT_COUNT);

  VOLT_LOG_ERROR_COMPARE (
    status, libCtx, status, 0, fnctLine,
    "VtZDMParamAttachmentCount", (unsigned char *)0)

  return (status);
}

int VtZDMParamCompressionEnabled (
   VtZDMObject zdmObj,
   Pointer info,
   unsigned int flag
   )
{
  int status;
  VtLibCtx libCtx = (VtLibCtx)0;
  VOLT_DECLARE_FNCT_LINE (fnctLine)

  if (zdmObj != (VtZDMObject)0)
    libCtx = zdmObj->voltObject.libraryCtx;
    
  VOLT_SET_FNCT_LINE (fnctLine)
  status = VoltZDMParamCommon(zdmObj, info, flag, 
    VT_ZDM_SET_SUPPORTED | VT_ZDM_SET_INFO_REQUIRED,
    VT_ZDM_PARAM_COMPRESSION_ENABLED);

  VOLT_LOG_ERROR_COMPARE (
    status, libCtx, status, 0, fnctLine,
    "VtZDMParamCompressionEnabled", (unsigned char *)0)

  return (status);
}

int VtZDMParamDataPadding (
   VtZDMObject zdmObj,
   Pointer info,
   unsigned int flag
   )
{
  int status;
  VtLibCtx libCtx = (VtLibCtx)0;
  VOLT_DECLARE_FNCT_LINE (fnctLine)

  if (zdmObj != (VtZDMObject)0)
    libCtx = zdmObj->voltObject.libraryCtx;
    
  VOLT_SET_FNCT_LINE (fnctLine)
  status = VoltZDMParamCommon(zdmObj, info, flag, 
    VT_ZDM_SET_SUPPORTED | VT_ZDM_SET_INFO_REQUIRED,
    VT_ZDM_PARAM_DATA_PADDING);

  VOLT_LOG_ERROR_COMPARE (
    status, libCtx, status, 0, fnctLine,
    "VtZDMParamDataPadding", (unsigned char *)0)

  return (status);
}

int VtZDMParamSurrenderCallback (
   VtZDMObject zdmObj,
   Pointer info,
   unsigned int flag
   )
{
  int status;
  VtLibCtx libCtx = (VtLibCtx)0;
  VOLT_DECLARE_FNCT_LINE (fnctLine)

  if (zdmObj != (VtZDMObject)0)
    libCtx = zdmObj->voltObject.libraryCtx;
    
  VOLT_SET_FNCT_LINE (fnctLine)
  status = VoltZDMParamCommon(zdmObj, info, flag, 
    VT_ZDM_SET_SUPPORTED | VT_ZDM_SET_INFO_REQUIRED,
    VT_ZDM_PARAM_SURRENDER_CALLBACK);

  VOLT_LOG_ERROR_COMPARE (
    status, libCtx, status, 0, fnctLine,
    "VtZDMParamSurrenderCallback", (unsigned char *)0)

  return (status);
}

int VtZDMParamRemainingOutputSize (
   VtZDMObject zdmObj,
   Pointer info,
   unsigned int flag
   )
{
  int status;
  VtLibCtx libCtx = (VtLibCtx)0;
  VOLT_DECLARE_FNCT_LINE (fnctLine)

  if (zdmObj != (VtZDMObject)0)
    libCtx = zdmObj->voltObject.libraryCtx;
    
  VOLT_SET_FNCT_LINE (fnctLine)
  status = VoltZDMParamCommon(zdmObj, info, flag, 
    VT_ZDM_GET_SUPPORTED, VT_ZDM_PARAM_REMAINING_OUTPUT_SIZE);

  VOLT_LOG_ERROR_COMPARE (
    status, libCtx, status, 0, fnctLine,
    "VtZDMParamRemainingOutputSize", (unsigned char *)0)

  return (status);
}

int VtZDMParamMaxInputFieldSize (
   VtZDMObject zdmObj,
   Pointer info,
   unsigned int flag
   )
{
  int status;
  VtLibCtx libCtx = (VtLibCtx)0;
  unsigned int maxInputFieldSize;
  VOLT_DECLARE_FNCT_LINE (fnctLine)
  VOLT_DECLARE_ERROR_TYPE(errorType)

  if (zdmObj != (VtZDMObject)0)
    libCtx = zdmObj->voltObject.libraryCtx;
  
  do
  {
    if ((flag == VOLT_ZDM_SET_TYPE_FLAG) && (info != (Pointer)0))
    {
      maxInputFieldSize = *(unsigned int*)info;
      if (maxInputFieldSize < 200)
      {
        VOLT_SET_ERROR_TYPE (errorType, VT_ERROR_TYPE_PRIMARY)
        VOLT_SET_FNCT_LINE(fnctLine)
        status = VT_ERROR_INVALID_ASSOCIATED_INFO;
        break;
      }
    }
      
    VOLT_SET_ERROR_TYPE (errorType, 0)
    VOLT_SET_FNCT_LINE (fnctLine)
    status = VoltZDMParamCommon(zdmObj, info, flag, 
      VT_ZDM_GET_AND_SET_SUPPORTED | VT_ZDM_SET_INFO_REQUIRED,
      VT_ZDM_PARAM_MAX_INPUT_FIELD_SIZE);
  }
  while (0);
  
  VOLT_LOG_ERROR_COMPARE (
    status, libCtx, status, errorType, fnctLine,
    "VtZDMParamMaxInputFieldSize", (unsigned char *)0)

  return (status);
}

#if VT_64_BIT_LENGTH == 64
int VtGetOutputLen64ImplZDM (
   VtLibCtx libraryCtx,
   Pointer associatedInfo,
   VtUInt64 *totalOutputLen,
   unsigned int flag
   )
{
  int status;
  unsigned int len;
  VoltZDMObject *zObj;
  VoltSecureMailObject *obj;
  VOLT_DECLARE_ERROR_TYPE (errorType)
  VOLT_DECLARE_FNCT_LINE (fnctLine)

  do
  {
    /* This Param must be called by VtGetTotalOutputLen64.
     */
    VOLT_SET_ERROR_TYPE (errorType, VT_ERROR_TYPE_PRIMARY)
    VOLT_SET_FNCT_LINE (fnctLine)
    status = VT_ERROR_INVALID_IMPL;
    if (flag != VOLT_GET_OUTPUT_LEN_64_TYPE_FLAG)
      break;

    /* The associated info is supposed to be a ZDM object.
     */
    VOLT_SET_FNCT_LINE (fnctLine)
    status = VT_ERROR_INVALID_ASSOCIATED_INFO;
    if (associatedInfo == (Pointer)0)
      break;

    zObj = (VoltZDMObject *)associatedInfo;

    /* Paranoid programming check.
     */
    VOLT_SET_FNCT_LINE (fnctLine)
    if (VOLT_OBJECT_TYPE_NOT_EQUAL (zObj, VOLT_OBJECT_TYPE_ZDM))
      break;

    obj = (VoltSecureMailObject *)(zObj->localCtx);

    /* The object should be built to write, and the state must be INIT.
     */
    VOLT_SET_FNCT_LINE (fnctLine)
    status = VT_ERROR_INVALID_ZDM_OBJ;
    if ((obj->state & VOLT_SECURE_MAIL_STATE_WRITE) == 0)
      break;

    VOLT_SET_FNCT_LINE (fnctLine)
    status = VT_ERROR_GET_INFO_UNAVAILABLE;
    if ((obj->state & VOLT_SECURE_MAIL_STATE_INIT) == 0)
      break;

    /* The object must be set with the data length.
     */
    VOLT_SET_FNCT_LINE (fnctLine)
    if (obj->dataLen64 == (VtUInt64)0)
      break;

    /* If the outputLen64 field is not set, call WriteUpdate to set it.
     */
    if (obj->outputLen64 == (VtUInt64)0)
    {
      VOLT_SET_ERROR_TYPE (errorType, 0)
      VOLT_SET_FNCT_LINE (fnctLine)
      status = VtZDMWriteUpdate (
        (VtZDMObject)zObj, (VtRandomObject)0, (unsigned char *)0, 1,
        (unsigned char *)0, 0, &len);
      if (status == 0)
        status = VT_ERROR_GENERAL;
      if (status != VT_ERROR_BUFFER_TOO_SMALL)
        break;
    }

    *totalOutputLen = obj->outputLen64;
    status = 0;

  } while (0);

  VOLT_LOG_ERROR_INFO_COMPARE (
    status, libraryCtx, 0, status, 0, errorType,
    (char *)0, "VtGetOutputLen64ImplZDM", fnctLine, (char *)0)

  return (status);
}
#endif

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -