Land latest SDR changes on the tip.

This commit is contained in:
thayes%netscape.com 2000-05-17 01:20:20 +00:00
Родитель e6e6074486
Коммит 7935d54dfd
7 изменённых файлов: 25 добавлений и 1978 удалений

Просмотреть файл

@ -2188,6 +2188,9 @@ CMTStatus CMT_FlushPendingRandomData(PCMT_CONTROL control);
* INPUTS
* control
* A control connection that has been established with the psm server.
* ctx
* A pointer to application defined context. It will be returned with
* the password callback request.
* key
* A buffer containing the key identifier to use for encrypting. May
* be NULL if keyLen is 0, which uses the "default" key.
@ -2208,7 +2211,7 @@ CMTStatus CMT_FlushPendingRandomData(PCMT_CONTROL control);
* CMTSuccess - the encryption worked.
* CMTFailure - some (unspecified) error occurred (needs work)
*/
CMTStatus CMT_SDREncrypt(PCMT_CONTROL control,
CMTStatus CMT_SDREncrypt(PCMT_CONTROL control, void *ctx,
const unsigned char *key, CMUint32 keyLen,
const unsigned char *data, CMUint32 dataLen,
unsigned char **result, CMUint32 *resultLen);
@ -2219,6 +2222,9 @@ CMTStatus CMT_SDREncrypt(PCMT_CONTROL control,
* INPUTS
* control
* A control connection that has been established with the psm server.
* ctx
* A pointer to application defined context. It will be returned with
* the password callback request.
* data
* A buffer containing the the results of a call to SDREncrypt
* dataLen
@ -2234,10 +2240,27 @@ CMTStatus CMT_SDREncrypt(PCMT_CONTROL control,
* CMTSuccess - the encryption worked.
* CMTFailure - some (unspecified) error occurred (needs work)
*/
CMTStatus CMT_SDRDecrypt(PCMT_CONTROL control,
CMTStatus CMT_SDRDecrypt(PCMT_CONTROL control, void *ctx,
const unsigned char *data, CMUint32 dataLen,
unsigned char **result, CMUint32 *resultLen);
/*
* FUNCTION: CMT_SDRChangePassword
* ----------------------------------
* INPUTS
* control
* A control connection that has been established with the psm server.
* ctx
* A context pointer that may be provided in callbacks
* NOTES
*
* RETURN
* CMTSuccess - the operation completed normally.
* CMTFailure - some (unspecified) error occurred. (probably not useful)
*/
CMTStatus CMT_SDRChangePassword(PCMT_CONTROL control, void *ctx);
/* Lock operations */
void CMT_LockConnection(PCMT_CONTROL control);
void CMT_UnlockConnection(PCMT_CONTROL control);

Просмотреть файл

@ -1,187 +0,0 @@
/*
* The contents of this file are subject to the Mozilla Public
* License Version 1.1 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
* implied. See the License for the specific language governing
* rights and limitations under the License.
*
* The Original Code is the Netscape security libraries.
*
* The Initial Developer of the Original Code is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1994-2000 Netscape Communications Corporation. All
* Rights Reserved.
*
* Contributor(s):
*
* Alternatively, the contents of this file may be used under the
* terms of the GNU General Public License Version 2 or later (the
* "GPL"), in which case the provisions of the GPL are applicable
* instead of those above. If you wish to allow use of your
* version of this file only under the terms of the GPL and not to
* allow others to use your version of this file under the MPL,
* indicate your decision by deleting the provisions above and
* replace them with the notice and other provisions required by
* the GPL. If you do not delete the provisions above, a recipient
* may use your version of this file under either the MPL or the
* GPL.
*/
/*
cmtsdr.c -- Support for the Secret Decoder Ring, which provides
encryption and decryption using stored keys.
Created by thayes 18 April 2000
*/
#include "stddef.h"
#include "cmtcmn.h"
#include "cmtutils.h"
#include "messages.h"
#include "protocolshr.h"
#include "rsrcids.h"
#include <string.h>
#undef PROCESS_LOCALLY
/* Encryption result - contains the key id and the resulting data */
/* An empty key id indicates that NO encryption was performed */
typedef struct EncryptionResult
{
CMTItem keyid;
CMTItem data;
} EncryptionResult;
/* Constants for testing */
static const char *kPrefix = "Encrypted:";
static CMTItem
CMT_CopyDataToItem(const unsigned char *data, CMUint32 len)
{
CMTItem item;
item.data = (unsigned char*) calloc(len, 1);
item.len = len;
memcpy(item.data, data, len);
return item;
}
static CMTStatus
tmp_SendMessage(PCMT_CONTROL control, CMTItem *message)
{
#ifndef PROCESS_LOCALLY
return CMT_SendMessage(control, message);
#else
if (message->type == SSM_SDR_ENCRYPT_REQUEST)
return CMT_DoEncryptionRequest(message);
else if (message->type == SSM_SDR_DECRYPT_REQUEST)
return CMT_DoDecryptionRequest(message);
return CMTFailure;
#endif
}
/* End test code */
CMTStatus
CMT_SDREncrypt(PCMT_CONTROL control, const unsigned char *key, CMUint32 keyLen,
const unsigned char *data, CMUint32 dataLen,
unsigned char **result, CMUint32 *resultLen)
{
CMTStatus rv = CMTSuccess;
CMTItem message;
EncryptRequestMessage request;
SingleItemMessage reply;
/* Fill in the request */
request.keyid = CMT_CopyDataToItem(key, keyLen);
request.data = CMT_CopyDataToItem(data, dataLen);
reply.item.data = 0;
reply.item.len = 0;
message.data = 0;
message.len = 0;
/* Encode */
rv = CMT_EncodeMessage(EncryptRequestTemplate, &message, &request);
if (rv != CMTSuccess) {
goto loser;
}
message.type = SSM_SDR_ENCRYPT_REQUEST;
/* Send */
/* if (CMT_SendMessage(control, &message) != CMTSuccess) goto loser; */
rv = tmp_SendMessage(control, &message);
if (rv != CMTSuccess) goto loser;
if (message.type != SSM_SDR_ENCRYPT_REPLY) { rv = CMTFailure; goto loser; }
rv = CMT_DecodeMessage(SingleItemMessageTemplate, &reply, &message);
if (rv != CMTSuccess)
goto loser;
*result = reply.item.data;
*resultLen = reply.item.len;
reply.item.data = 0;
loser:
if (message.data) free(message.data);
if (request.keyid.data) free(request.keyid.data);
if (request.data.data) free(request.data.data);
if (reply.item.data) free(reply.item.data);
return rv; /* need return value */
}
CMTStatus
CMT_SDRDecrypt(PCMT_CONTROL control, const unsigned char *data, CMUint32 dataLen,
unsigned char **result, CMUint32 *resultLen)
{
CMTStatus rv;
CMTItem message;
SingleItemMessage request;
SingleItemMessage reply;
/* Fill in the request */
request.item = CMT_CopyDataToItem(data, dataLen);
reply.item.data = 0;
reply.item.len = 0;
message.data = 0;
message.len = 0;
/* Encode */
rv = CMT_EncodeMessage(SingleItemMessageTemplate, &message, &request);
if (rv != CMTSuccess) {
goto loser;
}
message.type = SSM_SDR_DECRYPT_REQUEST;
/* Send */
/* if (CMT_SendMessage(control, &message) != CMTSuccess) goto loser; */
rv = tmp_SendMessage(control, &message);
if (rv != CMTSuccess) goto loser;
if (message.type != SSM_SDR_DECRYPT_REPLY) { rv = CMTFailure; goto loser; }
rv = CMT_DecodeMessage(SingleItemMessageTemplate, &reply, &message);
if (rv != CMTSuccess)
goto loser;
*result = reply.item.data;
*resultLen = reply.item.len;
reply.item.data = 0;
loser:
if (message.data) free(message.data);
if (request.item.data) free(request.item.data);
if (reply.item.data) free(reply.item.data);
return rv; /* need return value */
}

Просмотреть файл

@ -1,63 +0,0 @@
#
# The contents of this file are subject to the Mozilla Public
# License Version 1.1 (the "License"); you may not use this file
# except in compliance with the License. You may obtain a copy of
# the License at http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS
# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
# implied. See the License for the specific language governing
# rights and limitations under the License.
#
# The Original Code is the Netscape security libraries.
#
# The Initial Developer of the Original Code is Netscape
# Communications Corporation. Portions created by Netscape are
# Copyright (C) 1994-2000 Netscape Communications Corporation. All
# Rights Reserved.
#
# Contributor(s):
#
# Alternatively, the contents of this file may be used under the
# terms of the GNU General Public License Version 2 or later (the
# "GPL"), in which case the provisions of the GPL are applicable
# instead of those above. If you wish to allow use of your
# version of this file only under the terms of the GPL and not to
# allow others to use your version of this file under the MPL,
# indicate your decision by deleting the provisions above and
# replace them with the notice and other provisions required by
# the GPL. If you do not delete the provisions above, a recipient
# may use your version of this file under either the MPL or the
# GPL.
#
CORE_DEPTH = ../../..
DEPTH = ../../..
EXPORTS = \
cmtcmn.h \
cmtjs.h \
cmtclist.h \
$(NULL)
MODULE = security
CSRCS = cmtinit.c \
cmtssl.c \
cmtutils.c \
cmtcert.c \
cmthash.c \
cmtpkcs7.c \
cmtres.c \
cmtjs.c \
cmtevent.c \
cmtpasswd.c \
cmtadvisor.c \
cmtrng.c \
$(NULL)
REQUIRES = nspr security
LIBRARY_NAME = cmt
INCLUDES += -I$(CORE_DEPTH)/include

Просмотреть файл

@ -1,615 +0,0 @@
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
* The contents of this file are subject to the Mozilla Public
* License Version 1.1 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
* implied. See the License for the specific language governing
* rights and limitations under the License.
*
* The Original Code is the Netscape security libraries.
*
* The Initial Developer of the Original Code is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1994-2000 Netscape Communications Corporation. All
* Rights Reserved.
*
* Contributor(s):
*
* Alternatively, the contents of this file may be used under the
* terms of the GNU General Public License Version 2 or later (the
* "GPL"), in which case the provisions of the GPL are applicable
* instead of those above. If you wish to allow use of your
* version of this file only under the terms of the GPL and not to
* allow others to use your version of this file under the MPL,
* indicate your decision by deleting the provisions above and
* replace them with the notice and other provisions required by
* the GPL. If you do not delete the provisions above, a recipient
* may use your version of this file under either the MPL or the
* GPL.
*/
#ifndef __MESSAGES_H__
#define __MESSAGES_H__
#include "newproto.h"
typedef struct SingleNumMessage {
CMInt32 value;
} SingleNumMessage;
extern CMTMessageTemplate SingleNumMessageTemplate[];
typedef struct SingleStringMessage {
char *string;
} SingleStringMessage;
extern CMTMessageTemplate SingleStringMessageTemplate[];
typedef struct SingleItemMessage {
CMTItem item;
} SingleItemMessage;
extern CMTMessageTemplate SingleItemMessageTemplate[];
typedef struct HelloRequest {
CMInt32 version;
CMInt32 policy;
CMBool doesUI;
char *profile;
char* profileDir;
} HelloRequest;
extern CMTMessageTemplate HelloRequestTemplate[];
typedef struct HelloReply {
CMInt32 result;
CMInt32 sessionID;
CMInt32 version;
CMInt32 httpPort;
CMInt32 policy;
CMTItem nonce;
char *stringVersion;
} HelloReply;
extern CMTMessageTemplate HelloReplyTemplate[];
typedef struct SSLDataConnectionRequest {
CMInt32 flags;
CMInt32 port;
char *hostIP;
char *hostName;
CMBool forceHandshake;
CMTItem clientContext;
} SSLDataConnectionRequest;
extern CMTMessageTemplate SSLDataConnectionRequestTemplate[];
typedef struct TLSDataConnectionRequest {
CMInt32 port;
char* hostIP;
char* hostName;
} TLSDataConnectionRequest;
extern CMTMessageTemplate TLSDataConnectionRequestTemplate[];
typedef struct TLSStepUpRequest {
CMUint32 connID;
CMTItem clientContext;
} TLSStepUpRequest;
extern CMTMessageTemplate TLSStepUpRequestTemplate[];
typedef struct ProxyStepUpRequest {
CMUint32 connID;
CMTItem clientContext;
char* url;
} ProxyStepUpRequest;
extern CMTMessageTemplate ProxyStepUpRequestTemplate[];
typedef struct PKCS7DataConnectionRequest {
CMUint32 resID;
CMTItem clientContext;
} PKCS7DataConnectionRequest;
extern CMTMessageTemplate PKCS7DataConnectionRequestTemplate[];
typedef struct DataConnectionReply {
CMInt32 result;
CMInt32 connID;
CMInt32 port;
} DataConnectionReply;
extern CMTMessageTemplate DataConnectionReplyTemplate[];
typedef struct UIEvent {
CMInt32 resourceID;
CMInt32 width;
CMInt32 height;
CMBool isModal;
char *url;
CMTItem clientContext;
} UIEvent;
extern CMTMessageTemplate UIEventTemplate[];
extern CMTMessageTemplate OldUIEventTemplate[];
typedef struct TaskCompletedEvent {
CMInt32 resourceID;
CMInt32 numTasks;
CMInt32 result;
} TaskCompletedEvent;
extern CMTMessageTemplate TaskCompletedEventTemplate[];
typedef struct VerifyDetachedSigRequest {
CMInt32 pkcs7ContentID;
CMInt32 certUsage;
CMInt32 hashAlgID;
CMBool keepCert;
CMTItem hash;
} VerifyDetachedSigRequest;
extern CMTMessageTemplate VerifyDetachedSigRequestTemplate[];
typedef struct CreateSignedRequest {
CMInt32 scertRID;
CMInt32 ecertRID;
CMInt32 dig_alg;
CMTItem digest;
} CreateSignedRequest;
extern CMTMessageTemplate CreateSignedRequestTemplate[];
typedef struct CreateContentInfoReply {
CMInt32 ciRID;
CMInt32 result;
CMInt32 errorCode;
} CreateContentInfoReply;
extern CMTMessageTemplate CreateContentInfoReplyTemplate[];
typedef struct CreateEncryptedRequest {
CMInt32 scertRID;
CMInt32 nrcerts;
CMInt32 *rcertRIDs;
} CreateEncryptedRequest;
extern CMTMessageTemplate CreateEncryptedRequestTemplate[];
typedef struct CreateResourceRequest {
CMInt32 type;
CMTItem params;
} CreateResourceRequest;
extern CMTMessageTemplate CreateResourceRequestTemplate[];
typedef struct CreateResourceReply {
CMInt32 result;
CMInt32 resID;
} CreateResourceReply;
extern CMTMessageTemplate CreateResourceReplyTemplate[];
typedef struct GetAttribRequest {
CMInt32 resID;
CMInt32 fieldID;
} GetAttribRequest;
extern CMTMessageTemplate GetAttribRequestTemplate[];
typedef struct GetAttribReply {
CMInt32 result;
SSMAttributeValue value;
} GetAttribReply;
extern CMTMessageTemplate GetAttribReplyTemplate[];
typedef struct SetAttribRequest {
CMInt32 resID;
CMInt32 fieldID;
SSMAttributeValue value;
} SetAttribRequest;
extern CMTMessageTemplate SetAttribRequestTemplate[];
typedef struct PickleResourceReply {
CMInt32 result;
CMTItem blob;
} PickleResourceReply;
extern CMTMessageTemplate PickleResourceReplyTemplate[];
typedef struct UnpickleResourceRequest {
CMInt32 resourceType;
CMTItem resourceData;
} UnpickleResourceRequest;
extern CMTMessageTemplate UnpickleResourceRequestTemplate[];
typedef struct UnpickleResourceReply {
CMInt32 result;
CMInt32 resID;
} UnpickleResourceReply;
extern CMTMessageTemplate UnpickleResourceReplyTemplate[];
typedef struct PickleSecurityStatusReply {
CMInt32 result;
CMInt32 securityLevel;
CMTItem blob;
} PickleSecurityStatusReply;
extern CMTMessageTemplate PickleSecurityStatusReplyTemplate[];
typedef struct DupResourceReply {
CMInt32 result;
CMUint32 resID;
} DupResourceReply;
extern CMTMessageTemplate DupResourceReplyTemplate[];
typedef struct DestroyResourceRequest {
CMInt32 resID;
CMInt32 resType;
} DestroyResourceRequest;
extern CMTMessageTemplate DestroyResourceRequestTemplate[];
typedef struct VerifyCertRequest {
CMInt32 resID;
CMInt32 certUsage;
} VerifyCertRequest;
extern CMTMessageTemplate VerifyCertRequestTemplate[];
typedef struct AddTempCertToDBRequest {
CMInt32 resID;
char *nickname;
CMInt32 sslFlags;
CMInt32 emailFlags;
CMInt32 objSignFlags;
} AddTempCertToDBRequest;
extern CMTMessageTemplate AddTempCertToDBRequestTemplate[];
typedef struct MatchUserCertRequest {
CMInt32 certType;
CMInt32 numCANames;
char **caNames;
} MatchUserCertRequest;
extern CMTMessageTemplate MatchUserCertRequestTemplate[];
typedef struct MatchUserCertReply {
CMInt32 numCerts;
CMInt32 *certs;
} MatchUserCertReply;
extern CMTMessageTemplate MatchUserCertReplyTemplate[];
typedef struct EncodeCRMFReqRequest {
CMInt32 numRequests;
CMInt32 * reqIDs;
} EncodeCRMFReqRequest;
extern CMTMessageTemplate EncodeCRMFReqRequestTemplate[];
typedef struct CMMFCertResponseRequest {
char *nickname;
char *base64Der;
CMBool doBackup;
CMTItem clientContext;
} CMMFCertResponseRequest;
extern CMTMessageTemplate CMMFCertResponseRequestTemplate[];
typedef struct PasswordRequest {
CMInt32 tokenKey;
char *prompt;
CMTItem clientContext;
} PasswordRequest;
extern CMTMessageTemplate PasswordRequestTemplate[];
typedef struct PasswordReply {
CMInt32 result;
CMInt32 tokenID;
char * passwd;
} PasswordReply;
extern CMTMessageTemplate PasswordReplyTemplate[];
typedef struct KeyPairGenRequest {
CMInt32 keyGenCtxtID;
CMInt32 genMechanism;
CMInt32 keySize;
CMTItem params;
} KeyPairGenRequest;
extern CMTMessageTemplate KeyPairGenRequestTemplate[];
typedef struct DecodeAndCreateTempCertRequest {
CMInt32 type;
CMTItem cert;
} DecodeAndCreateTempCertRequest;
extern CMTMessageTemplate DecodeAndCreateTempCertRequestTemplate[];
typedef struct GenKeyOldStyleRequest {
char *choiceString;
char *challenge;
char *typeString;
char *pqgString;
} GenKeyOldStyleRequest;
extern CMTMessageTemplate GenKeyOldStyleRequestTemplate[];
typedef struct GenKeyOldStyleTokenRequest {
CMInt32 rid;
CMInt32 numtokens;
char ** tokenNames;
} GenKeyOldStyleTokenRequest;
extern CMTMessageTemplate GenKeyOldStyleTokenRequestTemplate[];
typedef struct GenKeyOldStyleTokenReply {
CMInt32 rid;
CMBool cancel;
char * tokenName;
} GenKeyOldStyleTokenReply;
extern CMTMessageTemplate GenKeyOldStyleTokenReplyTemplate[];
typedef struct GenKeyOldStylePasswordRequest {
CMInt32 rid;
char * tokenName;
CMBool internal;
CMInt32 minpwdlen;
CMInt32 maxpwdlen;
} GenKeyOldStylePasswordRequest;
extern CMTMessageTemplate GenKeyOldStylePasswordRequestTemplate[];
typedef struct GenKeyOldStylePasswordReply {
CMInt32 rid;
CMBool cancel;
char * password;
} GenKeyOldStylePasswordReply;
extern CMTMessageTemplate GenKeyOldStylePasswordReplyTemplate[];
typedef struct GetKeyChoiceListRequest {
char *type;
char *pqgString;
} GetKeyChoiceListRequest;
extern CMTMessageTemplate GetKeyChoiceListRequestTemplate[];
typedef struct GetKeyChoiceListReply {
CMInt32 nchoices;
char **choices;
} GetKeyChoiceListReply;
extern CMTMessageTemplate GetKeyChoiceListReplyTemplate[];
typedef struct AddNewSecurityModuleRequest {
char *moduleName;
char *libraryPath;
CMInt32 pubMechFlags;
CMInt32 pubCipherFlags;
} AddNewSecurityModuleRequest;
extern CMTMessageTemplate AddNewSecurityModuleRequestTemplate[];
typedef struct FilePathRequest {
CMInt32 resID;
char *prompt;
CMBool getExistingFile;
char *fileRegEx;
} FilePathRequest;
extern CMTMessageTemplate FilePathRequestTemplate[];
typedef struct FilePathReply {
CMInt32 resID;
char *filePath;
} FilePathReply;
extern CMTMessageTemplate FilePathReplyTemplate[];
typedef struct PasswordPromptReply {
CMInt32 resID;
char *promptReply;
} PasswordPromptReply;
extern CMTMessageTemplate PasswordPromptReplyTemplate[];
typedef struct SignTextRequest {
CMInt32 resID;
char *stringToSign;
char *hostName;
char *caOption;
CMInt32 numCAs;
char** caNames;
} SignTextRequest;
extern CMTMessageTemplate SignTextRequestTemplate[];
typedef struct GetLocalizedTextReply {
CMInt32 whichString;
char *localizedString;
} GetLocalizedTextReply;
extern CMTMessageTemplate GetLocalizedTextReplyTemplate[];
typedef struct ImportCertReply {
CMInt32 result;
CMInt32 resID;
} ImportCertReply;
extern CMTMessageTemplate ImportCertReplyTemplate[];
typedef struct PromptRequest {
CMInt32 resID;
char *prompt;
CMTItem clientContext;
} PromptRequest;
extern CMTMessageTemplate PromptRequestTemplate[];
typedef struct PromptReply {
CMInt32 resID;
CMBool cancel;
char *promptReply;
} PromptReply;
extern CMTMessageTemplate PromptReplyTemplate[];
typedef struct RedirectCompareReqeust {
CMTItem socketStatus1Data;
CMTItem socketStatus2Data;
} RedirectCompareRequest;
extern CMTMessageTemplate RedirectCompareRequestTemplate[];
typedef struct DecodeAndAddCRLRequest {
CMTItem derCrl;
CMUint32 type;
char *url;
} DecodeAndAddCRLRequest;
extern CMTMessageTemplate DecodeAndAddCRLRequestTemplate[];
typedef struct SecurityAdvisorRequest {
CMInt32 infoContext;
CMInt32 resID;
char * hostname;
char * senderAddr;
CMUint32 encryptedP7CInfo;
CMUint32 signedP7CInfo;
CMInt32 decodeError;
CMInt32 verifyError;
CMBool encryptthis;
CMBool signthis;
CMInt32 numRecipients;
char ** recipients;
} SecurityAdvisorRequest;
extern CMTMessageTemplate SecurityAdvisorRequestTemplate[];
/* "SecurityConfig" javascript related message templates */
typedef struct SCAddTempCertToPermDBRequest {
CMTItem certKey;
char* trustStr;
char* nickname;
} SCAddTempCertToPermDBRequest;
extern CMTMessageTemplate SCAddTempCertToPermDBRequestTemplate[];
typedef struct SCDeletePermCertsRequest {
CMTItem certKey;
CMBool deleteAll;
} SCDeletePermCertsRequest;
extern CMTMessageTemplate SCDeletePermCertsRequestTemplate[];
typedef struct TimeMessage {
CMInt32 year;
CMInt32 month;
CMInt32 day;
CMInt32 hour;
CMInt32 minute;
CMInt32 second;
} TimeMessage;
extern CMTMessageTemplate TimeMessageTemplate[];
typedef struct CertEnumElement {
char* name;
CMTItem certKey;
} CertEnumElement;
typedef struct SCCertIndexEnumReply {
int length;
CertEnumElement* list;
} SCCertIndexEnumReply;
extern CMTMessageTemplate SCCertIndexEnumReplyTemplate[];
/* Test message */
typedef struct TestListElement {
char * name;
char * value;
} TestListElement;
typedef struct TestList {
char *listName;
int numElements;
TestListElement *elements;
} TestList;
extern CMTMessageTemplate TestListTemplate[];
/* Preference-related structs */
typedef struct SetPrefElement {
char* key;
char* value;
CMInt32 type;
} SetPrefElement;
typedef struct SetPrefListMessage {
int length;
SetPrefElement* list;
} SetPrefListMessage;
extern CMTMessageTemplate SetPrefListMessageTemplate[];
typedef struct GetPrefElement {
char* key;
CMInt32 type;
} GetPrefElement;
typedef struct GetPrefListRequest {
int length;
GetPrefElement* list;
} GetPrefListRequest;
extern CMTMessageTemplate GetPrefListRequestTemplate[];
typedef struct GetCertExtension {
CMUint32 resID;
CMUint32 extension;
} GetCertExtension;
extern CMTMessageTemplate GetCertExtensionTemplate[];
typedef struct HTMLCertInfoRequest {
CMUint32 certID;
CMUint32 showImages;
CMUint32 showIssuer;
} HTMLCertInfoRequest;
extern CMTMessageTemplate HTMLCertInfoRequestTemplate[];
typedef struct EncryptRequestMessage
{
CMTItem keyid; /* May have length 0 for default */
CMTItem data;
} EncryptRequestMessage;
extern CMTMessageTemplate EncryptRequestTemplate[];
typedef struct SingleItemMessage EncryptReplyMessage;
#define EncryptReplyTemplate SingleItemMessageTemplate
typedef struct SingleItemMessage DecryptRequestMessage;
#define DecryptRequestTemplate SingleItemMessageTemplate
typedef struct SingleItemMessage DecryptReplyMessage;
#define DecryptReplyTemplate SingleItemMessageTemplate
#endif /* __MESSAGES_H__ */

Просмотреть файл

@ -1,164 +0,0 @@
/*
* The contents of this file are subject to the Mozilla Public
* License Version 1.1 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
* implied. See the License for the specific language governing
* rights and limitations under the License.
*
* The Original Code is the Netscape security libraries.
*
* The Initial Developer of the Original Code is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1994-2000 Netscape Communications Corporation. All
* Rights Reserved.
*
* Contributor(s):
*
* Alternatively, the contents of this file may be used under the
* terms of the GNU General Public License Version 2 or later (the
* "GPL"), in which case the provisions of the GPL are applicable
* instead of those above. If you wish to allow use of your
* version of this file only under the terms of the GPL and not to
* allow others to use your version of this file under the MPL,
* indicate your decision by deleting the provisions above and
* replace them with the notice and other provisions required by
* the GPL. If you do not delete the provisions above, a recipient
* may use your version of this file under either the MPL or the
* GPL.
*/
#include "string.h"
#include "protocol.h"
#include "protocolshr.h"
#include "messages.h"
/* Forward ref */
static void encrypt(CMTItem *data);
static void decrypt(CMTItem *data);
const char *kPrefix = "Encrypted";
/* encryption request */
CMTStatus
CMT_DoEncryptionRequest(CMTItem *message)
{
CMTStatus rv = CMTSuccess;
EncryptRequestMessage request;
EncryptReplyMessage reply;
CMUint32 pLen = strlen(kPrefix);
/* Initialize */
request.keyid.data = 0;
request.data.data = 0;
/* Decode incoming message */
rv = CMT_DecodeMessage(EncryptRequestTemplate, &request, message);
if (rv != CMTSuccess) goto loser; /* Protocol error */
/* Free incoming message */
free(message->data);
message->data = NULL;
/* "Encrypt" by prefixing the data */
reply.item.len = request.data.len + pLen;
reply.item.data = calloc(reply.item.len, 1);
if (!reply.item.data) {
rv = CMTFailure;
goto loser;
}
if (pLen) memcpy(reply.item.data, kPrefix, pLen);
encrypt(&request.data);
memcpy(&reply.item.data[pLen], request.data.data, request.data.len);
/* Generate response */
message->type = SSM_SDR_ENCRYPT_REPLY;
rv = CMT_EncodeMessage(EncryptReplyTemplate, message, &reply);
if (rv != CMTSuccess) goto loser; /* Unknown error */
loser:
if (request.keyid.data) free(request.keyid.data);
if (request.data.data) free(request.data.data);
return rv;
}
/* decryption request */
CMTStatus
CMT_DoDecryptionRequest(CMTItem *message)
{
CMTStatus rv = CMTSuccess;
DecryptRequestMessage request;
DecryptReplyMessage reply;
CMUint32 pLen = strlen(kPrefix);
/* Initialize */
request.item.data = 0;
reply.item.data = 0;
/* Decode the message */
rv = CMT_DecodeMessage(DecryptRequestTemplate, &request, message);
if (rv != CMTSuccess) goto loser;
/* Free incoming message */
free(message->data);
message->data = NULL;
/* "Decrypt" the message by removing the key */
if (pLen && memcmp(request.item.data, kPrefix, pLen) != 0) {
rv = CMTFailure; /* Invalid format */
goto loser;
}
reply.item.len = request.item.len - pLen;
reply.item.data = calloc(reply.item.len, 1);
if (!reply.item.data) { rv = CMTFailure; goto loser; }
memcpy(reply.item.data, &request.item.data[pLen], reply.item.len);
decrypt(&reply.item);
/* Create reply message */
message->type = SSM_SDR_DECRYPT_REPLY;
rv = CMT_EncodeMessage(DecryptReplyTemplate, message, &reply);
if (rv != CMTSuccess) goto loser;
loser:
if (request.item.data) free(request.item.data);
if (reply.item.data) free(reply.item.data);
return rv;
}
/* "encrypt" */
static unsigned char mask[64] = {
0x73, 0x46, 0x1a, 0x05, 0x24, 0x65, 0x43, 0xb4, 0x24, 0xee, 0x79, 0xc1, 0xcc,
0x49, 0xc7, 0x27, 0x11, 0x91, 0x2e, 0x8f, 0xaa, 0xf7, 0x62, 0x75, 0x41, 0x7e,
0xb2, 0x42, 0xde, 0x1b, 0x42, 0x7b, 0x1f, 0x33, 0x49, 0xca, 0xd1, 0x6a, 0x85,
0x05, 0x6c, 0xf9, 0x0e, 0x3e, 0x72, 0x02, 0xf2, 0xd8, 0x9d, 0xa1, 0xb8, 0x6e,
0x03, 0x18, 0x3e, 0x82, 0x86, 0x34, 0x1a, 0x61, 0xd9, 0x65, 0xb6, 0x7f
};
static void
encrypt(CMTItem *data)
{
unsigned int i, j;
j = 0;
for(i = 0;i < data->len;i++)
{
data->data[i] ^= mask[j];
if (++j >= 64) j = 0;
}
}
static void
decrypt(CMTItem *data)
{
encrypt(data);
}

Просмотреть файл

@ -1,327 +0,0 @@
/* -*- mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
* The contents of this file are subject to the Mozilla Public
* License Version 1.1 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
* implied. See the License for the specific language governing
* rights and limitations under the License.
*
* The Original Code is the Netscape security libraries.
*
* The Initial Developer of the Original Code is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1994-2000 Netscape Communications Corporation. All
* Rights Reserved.
*
* Contributor(s):
*
* Alternatively, the contents of this file may be used under the
* terms of the GNU General Public License Version 2 or later (the
* "GPL"), in which case the provisions of the GPL are applicable
* instead of those above. If you wish to allow use of your
* version of this file only under the terms of the GPL and not to
* allow others to use your version of this file under the MPL,
* indicate your decision by deleting the provisions above and
* replace them with the notice and other provisions required by
* the GPL. If you do not delete the provisions above, a recipient
* may use your version of this file under either the MPL or the
* GPL.
*/
#ifndef __SSMDEFS_H__
#define __SSMDEFS_H__
/* Basic type definitions for both client and server. */
typedef long CMInt32;
typedef unsigned long CMUint32;
typedef long SSMResourceID;
typedef int SSMStatus;
#define PSM_PORT 11111
#define PSM_DATA_PORT 11113 /* needs to be removed */
typedef enum _CMTStatus {
CMTFailure = -1,
CMTSuccess = 0
} CMTStatus;
typedef enum {
CM_FALSE = 0,
CM_TRUE = 1
} CMBool;
typedef struct CMTItemStr {
CMUint32 type;
unsigned char *data;
unsigned int len;
} CMTItem;
/* A length-encoded string. */
struct _SSMString {
CMUint32 m_length;
char m_data;
};
typedef struct _SSMString SSMString;
#define SSM_PROTOCOL_VERSION 0x00000051
#define SSM_INVALID_RESOURCE 0x00000000
#define SSM_GLOBAL_RESOURCE 0x00000001
#define SSM_SESSION_RESOURCE 0x00000002
/* Message category flags */
#define SSM_REQUEST_MESSAGE 0x10000000
#define SSM_REPLY_OK_MESSAGE 0x20000000
#define SSM_REPLY_ERR_MESSAGE 0x30000000
#define SSM_EVENT_MESSAGE 0x40000000
/* Message types */
#define SSM_DATA_CONNECTION 0x00001000
#define SSM_OBJECT_SIGNING 0x00002000
#define SSM_RESOURCE_ACTION 0x00003000
#define SSM_CERT_ACTION 0x00004000
#define SSM_PKCS11_ACTION 0x00005000
#define SSM_CRMF_ACTION 0x00006000
#define SSM_FORMSIGN_ACTION 0x00007000
#define SSM_LOCALIZED_TEXT 0x00008000
#define SSM_HELLO_MESSAGE 0x00009000
#define SSM_SECURITY_ADVISOR 0x0000a000
#define SSM_SEC_CFG_ACTION 0x0000b000
#define SSM_KEYGEN_TAG 0x0000c000
#define SSM_PREF_ACTION 0x0000d000
#define SSM_MISC_ACTION 0x0000f000
/* Data connection messages subtypes */
#define SSM_SSL_CONNECTION 0x00000100
#define SSM_PKCS7DECODE_STREAM 0x00000200
#define SSM_PKCS7ENCODE_STREAM 0x00000300
#define SSM_HASH_STREAM 0x00000400
#define SSM_TLS_CONNECTION 0x00000500
#define SSM_PROXY_CONNECTION 0x00000600
/* Object signing message subtypes */
#define SSM_VERIFY_RAW_SIG 0x00000100
#define SSM_VERIFY_DETACHED_SIG 0x00000200
#define SSM_CREATE_SIGNED 0x00000300
#define SSM_CREATE_ENCRYPTED 0x00000400
/* Resource access messages subtypes */
#define SSM_CREATE_RESOURCE 0x00000100
#define SSM_DESTROY_RESOURCE 0x00000200
#define SSM_GET_ATTRIBUTE 0x00000300
#define SSM_CONSERVE_RESOURCE 0x00000400
#define SSM_DUPLICATE_RESOURCE 0x00000500
#define SSM_SET_ATTRIBUTE 0x00000600
#define SSM_TLS_STEPUP 0x00000700
#define SSM_PROXY_STEPUP 0x00000800
/* Further specification for resource access messages */
#define SSM_SSLSocket_Status 0x00000010
#define SSM_NO_ATTRIBUTE 0x00000000
#define SSM_NUMERIC_ATTRIBUTE 0x00000010
#define SSM_STRING_ATTRIBUTE 0x00000020
#define SSM_RID_ATTRIBUTE 0x00000030
#define SSM_PICKLE_RESOURCE 0x00000010
#define SSM_UNPICKLE_RESOURCE 0x00000020
#define SSM_PICKLE_SECURITY_STATUS 0x00000030
/* Certificate access message subtypes */
#define SSM_IMPORT_CERT 0x00000100
#define SSM_VERIFY_CERT 0x00000200
#define SSM_FIND_BY_NICKNAME 0x00000300
#define SSM_FIND_BY_KEY 0x00000400
#define SSM_FIND_BY_EMAILADDR 0x00000500
#define SSM_ADD_TO_DB 0x00000600
#define SSM_DECODE_CERT 0x00000700
#define SSM_MATCH_USER_CERT 0x00000800
#define SSM_DESTROY_CERT 0x00000900
#define SSM_DECODE_TEMP_CERT 0x00000a00
#define SSM_REDIRECT_COMPARE 0x00000b00
#define SSM_DECODE_CRL 0x00000c00
#define SSM_EXTENSION_VALUE 0x00000d00
#define SSM_HTML_INFO 0x00000e00
/* message subtypes used for KEYGEN form tag */
#define SSM_GET_KEY_CHOICE 0x00000100
#define SSM_KEYGEN_START 0x00000200
#define SSM_KEYGEN_TOKEN 0x00000300
#define SSM_KEYGEN_PASSWORD 0x00000400
#define SSM_KEYGEN_DONE 0x00000500
#define SSM_CREATE_KEY_PAIR 0x00000100
#define SSM_FINISH_KEY_GEN 0x00000200
#define SSM_ADD_NEW_MODULE 0x00000300
#define SSM_DEL_MODULE 0x00000400
#define SSM_LOGOUT_ALL 0x00000500
#define SSM_ENABLED_CIPHERS 0x00000600
#define SSM_CREATE_CRMF_REQ 0x00000100
#define SSM_DER_ENCODE_REQ 0x00000200
#define SSM_PROCESS_CMMF_RESP 0x00000300
#define SSM_CHALLENGE 0x00000400
#define SSM_SIGN_TEXT 0x00000100
/* Security Config subtypes */
#define SSM_ADD_CERT_TO_TEMP_DB 0x00000100
#define SSM_ADD_TEMP_CERT_TO_DB 0x00000200
#define SSM_DELETE_PERM_CERTS 0x00000300
#define SSM_FIND_CERT_KEY 0x00000400
#define SSM_GET_CERT_PROP_BY_KEY 0x00000500
#define SSM_CERT_INDEX_ENUM 0x00000600
/* subcategories for SSM_FIND_CERT_KEY and SSM_CERT_INDEX_ENUM */
#define SSM_FIND_KEY_BY_NICKNAME 0x00000010
#define SSM_FIND_KEY_BY_EMAIL_ADDR 0x00000020
#define SSM_FIND_KEY_BY_DN 0x00000030
/* subcategories for SSM_GET_CERT_PROP_BY_KEY */
#define SSM_SECCFG_GET_NICKNAME 0x00000010
#define SSM_SECCFG_GET_EMAIL_ADDR 0x00000020
#define SSM_SECCFG_GET_DN 0x00000030
#define SSM_SECCFG_GET_TRUST 0x00000040
#define SSM_SECCFG_CERT_IS_PERM 0x00000050
#define SSM_SECCFG_GET_NOT_BEFORE 0x00000060
#define SSM_SECCFG_GET_NOT_AFTER 0x00000070
#define SSM_SECCFG_GET_SERIAL_NO 0x00000080
#define SSM_SECCFG_GET_ISSUER 0x00000090
#define SSM_SECCFG_GET_ISSUER_KEY 0x000000a0
#define SSM_SECCFG_GET_SUBJECT_NEXT 0x000000b0
#define SSM_SECCFG_GET_SUBJECT_PREV 0x000000c0
/* Misc requests */
#define SSM_MISC_GET_RNG_DATA 0x00000100
#define SSM_MISC_PUT_RNG_DATA 0x00000200
#define SSM_MISC_SDR_ENCRYPT 0x00000300
#define SSM_MISC_SDR_DECRYPT 0x00000400
#define SSM_SDR_ENCRYPT_REQUEST \
(SSM_REQUEST_MESSAGE|SSM_MISC_ACTION|SSM_MISC_SDR_ENCRYPT)
#define SSM_SDR_ENCRYPT_REPLY \
(SSM_REPLY_OK_MESSAGE|SSM_MISC_ACTION|SSM_MISC_SDR_ENCRYPT)
#define SSM_SDR_DECRYPT_REQUEST \
(SSM_REQUEST_MESSAGE|SSM_MISC_ACTION|SSM_MISC_SDR_DECRYPT)
#define SSM_SDR_DECRYPT_REPLY \
(SSM_REPLY_OK_MESSAGE|SSM_MISC_ACTION|SSM_MISC_SDR_DECRYPT)
/* Type masks for message types */
#define SSM_CATEGORY_MASK 0xF0000000
#define SSM_TYPE_MASK 0x0000F000
#define SSM_SUBTYPE_MASK 0x00000F00
#define SSM_SPECIFIC_MASK 0x000000F0
typedef struct SSMAttributeValue {
CMUint32 type;
union {
SSMResourceID rid;
CMTItem string;
CMInt32 numeric;
} u;
} SSMAttributeValue;
typedef enum {
rsaEnc, rsaDualUse, rsaSign, rsaNonrepudiation, rsaSignNonrepudiation,
dhEx, dsaSignNonrepudiation, dsaSign, dsaNonrepudiation, invalidKeyGen
} SSMKeyGenType;
typedef enum {
ssmUnknownPolicy= -1,ssmDomestic=0, ssmExport=1, ssmFrance=2
} SSMPolicyType;
/* These are the localized strings that PSM can feed back to
* the plug-in. These will initially be used by the plug-in for
* JavaScript purposes to pop up alert/confirm dialogs that would
* cause nightmares to do if we sent UI events.
*/
typedef enum {
SSM_STRING_BAD_PK11_LIB_PARAM,
SSM_STRING_BAD_PK11_LIB_PATH,
SSM_STRING_ADD_MOD_SUCCESS,
SSM_STRING_DUP_MOD_FAILURE,
SSM_STRING_ADD_MOD_FAILURE,
SSM_STRING_BAD_MOD_NAME,
SSM_STRING_EXT_MOD_DEL,
SSM_STRING_INT_MOD_DEL,
SSM_STRING_MOD_DEL_FAIL,
SSM_STRING_ADD_MOD_WARN,
SSM_STRING_MOD_PROMPT,
SSM_STRING_DLL_PROMPT,
SSM_STRING_DEL_MOD_WARN,
SSM_STRING_INVALID_CRL,
SSM_STRING_INVALID_CKL,
SSM_STRING_ROOT_CKL_CERT_NOT_FOUND,
SSM_STRING_BAD_CRL_SIGNATURE,
SSM_STRING_BAD_CKL_SIGNATURE,
SSM_STRING_ERR_ADD_CRL,
SSM_STRING_ERR_ADD_CKL,
SSM_STRING_JAVASCRIPT_DISABLED
} SSMLocalizedString;
/* Event types */
#define SSM_UI_EVENT 0x00001000
#define SSM_TASK_COMPLETED_EVENT 0x00002000
#define SSM_FILE_PATH_EVENT 0x00003000
#define SSM_PROMPT_EVENT 0x00004000
#define SSM_AUTH_EVENT 0x00007000
#define SSM_SAVE_PREF_EVENT 0x00008000
#define SSM_MISC_EVENT 0x0000f000
/* Flags used in Create SSL Data request */
#define SSM_REQUEST_SSL_DATA_SSL 0x00000001
#define SSM_REQUEST_SSL_DATA_PROXY 0x00000002
#define SSM_REQUEST_SSL_CONNECTION_MASK 0x00000003
/* Create typedefs for the various #defines */
typedef CMUint32 SSMMessageCategory;
typedef CMUint32 SSMMessageType;
typedef CMUint32 SSMDataConnectionSType;
typedef CMUint32 SSMObjSignSType;
typedef CMUint32 SSMResourceAccessSType;
typedef CMUint32 SSMCreateResource;
typedef CMUint32 SSMResourceAttrType;
typedef CMUint32 SSMResourceConsv;
typedef CMUint32 SSMCertAccessSType;
typedef CMUint32 SSMKeyGenTagProcessType;
typedef CMUint32 SSMPKCS11Actions;
typedef CMUint32 SSMCRMFAction;
typedef CMUint32 SSMFormSignAction;
typedef CMUint32 SSMSecCfgAction;
typedef CMUint32 SSMSecCfgFindByType;
typedef CMUint32 SSMSecCfgGetCertPropType;
typedef CMUint32 SSMMiscRequestType;
typedef CMUint32 SSMMessageMaskType;
typedef CMUint32 SSMEventType;
typedef CMUint32 SSMSSLConnectionRequestType;
/*
* This string is version that can be used to assemble any
* version information by the apllication using the protocol
* library.
*/
extern char SSMVersionString[];
#ifdef __cplusplus
extern "C" {
char * SSM_GetVersionString(void);
#endif
#ifdef __cplusplus
}
#endif
/* What type of client */
typedef enum
{
SSM_NOINFO,
SSM_COMPOSE,
SSM_MAIL_MESSAGE,
SSM_NEWS_MESSAGE,
SSM_SNEWS_MESSAGE,
SSM_BROWSER
} SSMClientType;
#endif /* __SSMDEFS_H__ */

Просмотреть файл

@ -1,620 +0,0 @@
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
* The contents of this file are subject to the Mozilla Public
* License Version 1.1 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
* implied. See the License for the specific language governing
* rights and limitations under the License.
*
* The Original Code is the Netscape security libraries.
*
* The Initial Developer of the Original Code is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1994-2000 Netscape Communications Corporation. All
* Rights Reserved.
*
* Contributor(s):
*
* Alternatively, the contents of this file may be used under the
* terms of the GNU General Public License Version 2 or later (the
* "GPL"), in which case the provisions of the GPL are applicable
* instead of those above. If you wish to allow use of your
* version of this file only under the terms of the GPL and not to
* allow others to use your version of this file under the MPL,
* indicate your decision by deleting the provisions above and
* replace them with the notice and other provisions required by
* the GPL. If you do not delete the provisions above, a recipient
* may use your version of this file under either the MPL or the
* GPL.
*/
#include "stddef.h"
#include "messages.h"
CMTMessageTemplate SingleNumMessageTemplate[] =
{
{ CMT_DT_INT, offsetof(SingleNumMessage, value) },
{ CMT_DT_END }
};
CMTMessageTemplate SingleStringMessageTemplate[] =
{
{ CMT_DT_STRING, offsetof(SingleStringMessage, string) },
{ CMT_DT_END }
};
CMTMessageTemplate SingleItemMessageTemplate[] =
{
{ CMT_DT_ITEM, offsetof(SingleItemMessage, item) },
{ CMT_DT_END }
};
CMTMessageTemplate HelloRequestTemplate[] =
{
{ CMT_DT_INT, offsetof(HelloRequest, version) },
{ CMT_DT_INT, offsetof(HelloRequest, policy) },
{ CMT_DT_BOOL, offsetof(HelloRequest, doesUI) },
{ CMT_DT_STRING, offsetof(HelloRequest, profile) },
{ CMT_DT_STRING, offsetof(HelloRequest, profileDir) },
{ CMT_DT_END }
};
CMTMessageTemplate HelloReplyTemplate[] =
{
{ CMT_DT_INT, offsetof(HelloReply, result) },
{ CMT_DT_INT, offsetof(HelloReply, sessionID) },
{ CMT_DT_INT, offsetof(HelloReply, version) },
{ CMT_DT_STRING, offsetof(HelloReply, stringVersion) },
{ CMT_DT_INT, offsetof(HelloReply, httpPort) },
{ CMT_DT_INT, offsetof(HelloReply, policy) },
{ CMT_DT_ITEM, offsetof(HelloReply, nonce) },
{ CMT_DT_END }
};
CMTMessageTemplate SSLDataConnectionRequestTemplate[] =
{
{ CMT_DT_INT, offsetof(SSLDataConnectionRequest, flags) },
{ CMT_DT_INT, offsetof(SSLDataConnectionRequest, port) },
{ CMT_DT_STRING, offsetof(SSLDataConnectionRequest, hostIP) },
{ CMT_DT_STRING, offsetof(SSLDataConnectionRequest, hostName) },
{ CMT_DT_BOOL, offsetof(SSLDataConnectionRequest, forceHandshake) },
{ CMT_DT_ITEM, offsetof(SSLDataConnectionRequest, clientContext) },
{ CMT_DT_END }
};
CMTMessageTemplate TLSDataConnectionRequestTemplate[] =
{
{ CMT_DT_INT, offsetof(TLSDataConnectionRequest, port) },
{ CMT_DT_STRING, offsetof(TLSDataConnectionRequest, hostIP) },
{ CMT_DT_STRING, offsetof(TLSDataConnectionRequest, hostName) },
{ CMT_DT_END }
};
CMTMessageTemplate TLSStepUpRequestTemplate[] =
{
{ CMT_DT_INT, offsetof(TLSStepUpRequest, connID) },
{ CMT_DT_ITEM, offsetof(TLSStepUpRequest, clientContext) },
{ CMT_DT_END }
};
CMTMessageTemplate ProxyStepUpRequestTemplate[] =
{
{ CMT_DT_INT, offsetof(ProxyStepUpRequest, connID) },
{ CMT_DT_ITEM, offsetof(ProxyStepUpRequest, clientContext) },
{ CMT_DT_STRING, offsetof(ProxyStepUpRequest, url) },
{ CMT_DT_END }
};
CMTMessageTemplate PKCS7DataConnectionRequestTemplate[] =
{
{ CMT_DT_INT, offsetof(PKCS7DataConnectionRequest, resID) },
{ CMT_DT_ITEM, offsetof(PKCS7DataConnectionRequest, clientContext) },
{ CMT_DT_END }
};
CMTMessageTemplate DataConnectionReplyTemplate[] =
{
{ CMT_DT_INT, offsetof(DataConnectionReply, result) },
{ CMT_DT_INT, offsetof(DataConnectionReply, connID) },
{ CMT_DT_INT, offsetof(DataConnectionReply, port) },
{ CMT_DT_END }
};
CMTMessageTemplate UIEventTemplate[] =
{
{ CMT_DT_INT, offsetof(UIEvent, resourceID) },
{ CMT_DT_INT, offsetof(UIEvent, width) },
{ CMT_DT_INT, offsetof(UIEvent, height) },
{ CMT_DT_BOOL, offsetof(UIEvent, isModal) },
{ CMT_DT_STRING, offsetof(UIEvent, url) },
{ CMT_DT_ITEM, offsetof(UIEvent, clientContext) },
{ CMT_DT_END }
};
/*
* The old UI Event was missing the modal indication.
* As a transition aid, we use the old template if the
* "modern" version doesn't work. Model is true in that case
*/
CMTMessageTemplate OldUIEventTemplate[] =
{
{ CMT_DT_INT, offsetof(UIEvent, resourceID) },
{ CMT_DT_INT, offsetof(UIEvent, width) },
{ CMT_DT_INT, offsetof(UIEvent, height) },
{ CMT_DT_STRING, offsetof(UIEvent, url) },
{ CMT_DT_ITEM, offsetof(UIEvent, clientContext) },
{ CMT_DT_END }
};
CMTMessageTemplate TaskCompletedEventTemplate[] =
{
{ CMT_DT_INT, offsetof(TaskCompletedEvent, resourceID) },
{ CMT_DT_INT, offsetof(TaskCompletedEvent, numTasks) },
{ CMT_DT_INT, offsetof(TaskCompletedEvent, result) },
{ CMT_DT_END }
};
CMTMessageTemplate VerifyDetachedSigRequestTemplate[] =
{
{ CMT_DT_INT, offsetof(VerifyDetachedSigRequest, pkcs7ContentID) },
{ CMT_DT_INT, offsetof(VerifyDetachedSigRequest, certUsage) },
{ CMT_DT_INT, offsetof(VerifyDetachedSigRequest, hashAlgID) },
{ CMT_DT_BOOL, offsetof(VerifyDetachedSigRequest, keepCert) },
{ CMT_DT_ITEM, offsetof(VerifyDetachedSigRequest, hash) },
{ CMT_DT_END }
};
CMTMessageTemplate CreateSignedRequestTemplate[] =
{
{ CMT_DT_INT, offsetof(CreateSignedRequest, scertRID) },
{ CMT_DT_INT, offsetof(CreateSignedRequest, ecertRID) },
{ CMT_DT_INT, offsetof(CreateSignedRequest, dig_alg) },
{ CMT_DT_ITEM, offsetof(CreateSignedRequest, digest) },
{ CMT_DT_END }
};
CMTMessageTemplate CreateContentInfoReplyTemplate[] =
{
{ CMT_DT_INT, offsetof(CreateContentInfoReply, ciRID) },
{ CMT_DT_INT, offsetof(CreateContentInfoReply, result) },
{ CMT_DT_INT, offsetof(CreateContentInfoReply, errorCode) },
{ CMT_DT_END }
};
CMTMessageTemplate CreateEncryptedRequestTemplate[] =
{
{ CMT_DT_INT, offsetof(CreateEncryptedRequest, scertRID) },
{ CMT_DT_LIST, offsetof(CreateEncryptedRequest, nrcerts) },
{ CMT_DT_INT, offsetof(CreateEncryptedRequest, rcertRIDs) },
{ CMT_DT_END }
};
CMTMessageTemplate CreateResourceRequestTemplate[] =
{
{ CMT_DT_INT, offsetof(CreateResourceRequest, type) },
{ CMT_DT_ITEM, offsetof(CreateResourceRequest, params) },
{ CMT_DT_END }
};
CMTMessageTemplate CreateResourceReplyTemplate[] =
{
{ CMT_DT_INT, offsetof(CreateResourceReply, result) },
{ CMT_DT_INT, offsetof(CreateResourceReply, resID) },
{ CMT_DT_END }
};
CMTMessageTemplate GetAttribRequestTemplate[] =
{
{ CMT_DT_INT, offsetof(GetAttribRequest, resID) },
{ CMT_DT_INT, offsetof(GetAttribRequest, fieldID) },
{ CMT_DT_END }
};
CMTMessageTemplate GetAttribReplyTemplate[] =
{
{ CMT_DT_INT, offsetof(GetAttribReply, result) },
{ CMT_DT_CHOICE, offsetof(GetAttribReply, value.type) },
{ CMT_DT_RID, offsetof(GetAttribReply, value.u.rid), 0, SSM_RID_ATTRIBUTE },
{ CMT_DT_INT, offsetof(GetAttribReply, value.u.numeric), 0,
SSM_NUMERIC_ATTRIBUTE },
{ CMT_DT_ITEM, offsetof(GetAttribReply, value.u.string), 0,
SSM_STRING_ATTRIBUTE},
{ CMT_DT_END_CHOICE },
{ CMT_DT_END }
};
CMTMessageTemplate SetAttribRequestTemplate[] =
{
{ CMT_DT_INT, offsetof(SetAttribRequest, resID) },
{ CMT_DT_INT, offsetof(SetAttribRequest, fieldID) },
{ CMT_DT_CHOICE, offsetof(SetAttribRequest, value.type) },
{ CMT_DT_RID, offsetof(SetAttribRequest, value.u.rid), 0, SSM_RID_ATTRIBUTE },
{ CMT_DT_INT, offsetof(SetAttribRequest, value.u.numeric), 0,
SSM_NUMERIC_ATTRIBUTE },
{ CMT_DT_ITEM, offsetof(SetAttribRequest, value.u.string), 0,
SSM_STRING_ATTRIBUTE},
{ CMT_DT_END_CHOICE },
{ CMT_DT_END }
};
CMTMessageTemplate PickleResourceReplyTemplate[] =
{
{ CMT_DT_INT, offsetof(PickleResourceReply, result) },
{ CMT_DT_ITEM, offsetof(PickleResourceReply, blob) },
{ CMT_DT_END }
};
CMTMessageTemplate UnpickleResourceRequestTemplate[] =
{
{ CMT_DT_INT, offsetof(UnpickleResourceRequest, resourceType) },
{ CMT_DT_ITEM, offsetof(UnpickleResourceRequest, resourceData) },
{ CMT_DT_END }
};
CMTMessageTemplate UnpickleResourceReplyTemplate[] =
{
{ CMT_DT_INT, offsetof(UnpickleResourceReply, result) },
{ CMT_DT_INT, offsetof(UnpickleResourceReply, resID) },
{ CMT_DT_END }
};
CMTMessageTemplate PickleSecurityStatusReplyTemplate[] =
{
{ CMT_DT_INT, offsetof(PickleSecurityStatusReply, result) },
{ CMT_DT_INT, offsetof(PickleSecurityStatusReply, securityLevel) },
{ CMT_DT_ITEM, offsetof(PickleSecurityStatusReply, blob) },
{ CMT_DT_END }
};
CMTMessageTemplate DupResourceReplyTemplate[] =
{
{ CMT_DT_INT, offsetof(DupResourceReply, result) },
{ CMT_DT_RID, offsetof(DupResourceReply, resID), 0, SSM_RID_ATTRIBUTE },
{ CMT_DT_END }
};
CMTMessageTemplate DestroyResourceRequestTemplate[] =
{
{ CMT_DT_INT, offsetof(DestroyResourceRequest, resID) },
{ CMT_DT_INT, offsetof(DestroyResourceRequest, resType) },
{ CMT_DT_END }
};
CMTMessageTemplate VerifyCertRequestTemplate[] =
{
{ CMT_DT_INT, offsetof(VerifyCertRequest, resID) },
{ CMT_DT_INT, offsetof(VerifyCertRequest, certUsage) },
{ CMT_DT_END }
};
CMTMessageTemplate AddTempCertToDBRequestTemplate[] =
{
{ CMT_DT_INT, offsetof(AddTempCertToDBRequest, resID) },
{ CMT_DT_STRING, offsetof(AddTempCertToDBRequest, nickname) },
{ CMT_DT_INT, offsetof(AddTempCertToDBRequest, sslFlags) },
{ CMT_DT_INT, offsetof(AddTempCertToDBRequest, emailFlags) },
{ CMT_DT_INT, offsetof(AddTempCertToDBRequest, objSignFlags) },
{ CMT_DT_END }
};
CMTMessageTemplate MatchUserCertRequestTemplate[] =
{
{ CMT_DT_INT, offsetof(MatchUserCertRequest, certType) },
{ CMT_DT_LIST, offsetof(MatchUserCertRequest, numCANames) },
{ CMT_DT_STRING, offsetof(MatchUserCertRequest, caNames) },
{ CMT_DT_END }
};
CMTMessageTemplate MatchUserCertReplyTemplate[] =
{
{ CMT_DT_LIST, offsetof(MatchUserCertReply, numCerts) },
{ CMT_DT_INT, offsetof(MatchUserCertReply, certs) },
{ CMT_DT_END }
};
CMTMessageTemplate EncodeCRMFReqRequestTemplate[] =
{
{ CMT_DT_LIST, offsetof(EncodeCRMFReqRequest, numRequests) },
{ CMT_DT_INT, offsetof(EncodeCRMFReqRequest, reqIDs) },
{ CMT_DT_END }
};
CMTMessageTemplate CMMFCertResponseRequestTemplate[] =
{
{ CMT_DT_STRING, offsetof(CMMFCertResponseRequest, nickname) },
{ CMT_DT_STRING, offsetof(CMMFCertResponseRequest, base64Der) },
{ CMT_DT_INT, offsetof(CMMFCertResponseRequest, doBackup) },
{ CMT_DT_ITEM, offsetof(CMMFCertResponseRequest, clientContext) },
{ CMT_DT_END }
};
CMTMessageTemplate PasswordRequestTemplate[] =
{
{ CMT_DT_INT, offsetof(PasswordRequest, tokenKey) },
{ CMT_DT_STRING, offsetof(PasswordRequest, prompt) },
{ CMT_DT_ITEM, offsetof(PasswordRequest, clientContext) },
{ CMT_DT_END }
};
CMTMessageTemplate PasswordReplyTemplate[] =
{
{ CMT_DT_INT, offsetof(PasswordReply, result) },
{ CMT_DT_INT, offsetof(PasswordReply, tokenID) },
{ CMT_DT_STRING, offsetof(PasswordReply, passwd) },
{ CMT_DT_END }
};
CMTMessageTemplate KeyPairGenRequestTemplate[] =
{
{ CMT_DT_INT, offsetof(KeyPairGenRequest, keyGenCtxtID) },
{ CMT_DT_INT, offsetof(KeyPairGenRequest, genMechanism) },
{ CMT_DT_INT, offsetof(KeyPairGenRequest, keySize) },
{ CMT_DT_ITEM, offsetof(KeyPairGenRequest, params) },
{ CMT_DT_END }
};
CMTMessageTemplate DecodeAndCreateTempCertRequestTemplate[] =
{
{ CMT_DT_INT, offsetof(DecodeAndCreateTempCertRequest, type) },
{ CMT_DT_ITEM, offsetof(DecodeAndCreateTempCertRequest, cert) },
{ CMT_DT_END }
};
CMTMessageTemplate GenKeyOldStyleRequestTemplate[] =
{
{ CMT_DT_STRING, offsetof(GenKeyOldStyleRequest, choiceString) },
{ CMT_DT_STRING, offsetof(GenKeyOldStyleRequest, challenge) },
{ CMT_DT_STRING, offsetof(GenKeyOldStyleRequest, typeString) },
{ CMT_DT_STRING, offsetof(GenKeyOldStyleRequest, pqgString) },
{ CMT_DT_END }
};
CMTMessageTemplate GenKeyOldStyleTokenRequestTemplate[] =
{
{ CMT_DT_INT, offsetof(GenKeyOldStyleTokenRequest, rid) },
{ CMT_DT_LIST, offsetof(GenKeyOldStyleTokenRequest, numtokens) },
{ CMT_DT_STRING,offsetof(GenKeyOldStyleTokenRequest, tokenNames)},
{ CMT_DT_END }
};
CMTMessageTemplate GenKeyOldStyleTokenReplyTemplate[] =
{
{ CMT_DT_INT, offsetof(GenKeyOldStyleTokenReply, rid) },
{ CMT_DT_BOOL, offsetof(GenKeyOldStyleTokenReply, cancel) },
{ CMT_DT_STRING, offsetof(GenKeyOldStyleTokenReply, tokenName) },
{ CMT_DT_END }
};
CMTMessageTemplate GenKeyOldStylePasswordRequestTemplate[] =
{
{ CMT_DT_INT, offsetof(GenKeyOldStylePasswordRequest, rid) },
{ CMT_DT_STRING, offsetof(GenKeyOldStylePasswordRequest, tokenName) },
{ CMT_DT_BOOL, offsetof(GenKeyOldStylePasswordRequest, internal) },
{ CMT_DT_INT, offsetof(GenKeyOldStylePasswordRequest, minpwdlen) },
{ CMT_DT_INT, offsetof(GenKeyOldStylePasswordRequest, maxpwdlen) },
{ CMT_DT_END }
};
CMTMessageTemplate GenKeyOldStylePasswordReplyTemplate[] =
{
{ CMT_DT_INT, offsetof(GenKeyOldStylePasswordReply, rid) },
{ CMT_DT_BOOL, offsetof(GenKeyOldStylePasswordReply, cancel) },
{ CMT_DT_STRING, offsetof(GenKeyOldStylePasswordReply, password) },
{ CMT_DT_END }
};
CMTMessageTemplate GetKeyChoiceListRequestTemplate[] =
{
{ CMT_DT_STRING, offsetof(GetKeyChoiceListRequest, type) },
{ CMT_DT_STRING, offsetof(GetKeyChoiceListRequest, pqgString) },
{ CMT_DT_END }
};
CMTMessageTemplate GetKeyChoiceListReplyTemplate[] =
{
{ CMT_DT_LIST, offsetof(GetKeyChoiceListReply, nchoices) },
{ CMT_DT_STRING, offsetof(GetKeyChoiceListReply, choices) },
{ CMT_DT_END }
};
CMTMessageTemplate AddNewSecurityModuleRequestTemplate[] =
{
{ CMT_DT_STRING, offsetof(AddNewSecurityModuleRequest, moduleName) },
{ CMT_DT_STRING, offsetof(AddNewSecurityModuleRequest, libraryPath) },
{ CMT_DT_INT, offsetof(AddNewSecurityModuleRequest, pubMechFlags) },
{ CMT_DT_INT, offsetof(AddNewSecurityModuleRequest, pubCipherFlags) },
{ CMT_DT_END }
};
CMTMessageTemplate FilePathRequestTemplate[] =
{
{ CMT_DT_INT, offsetof(FilePathRequest, resID) },
{ CMT_DT_STRING, offsetof(FilePathRequest, prompt) },
{ CMT_DT_BOOL, offsetof(FilePathRequest, getExistingFile) },
{ CMT_DT_STRING, offsetof(FilePathRequest, fileRegEx) },
{ CMT_DT_END }
};
CMTMessageTemplate FilePathReplyTemplate[] =
{
{ CMT_DT_INT, offsetof(FilePathReply, resID) },
{ CMT_DT_STRING, offsetof(FilePathReply, filePath) },
{ CMT_DT_END }
};
CMTMessageTemplate PasswordPromptReplyTemplate[] =
{
{ CMT_DT_INT, offsetof(PasswordPromptReply, resID) },
{ CMT_DT_STRING, offsetof(PasswordPromptReply, promptReply) },
{ CMT_DT_END }
};
CMTMessageTemplate SignTextRequestTemplate[] =
{
{ CMT_DT_INT, offsetof(SignTextRequest, resID) },
{ CMT_DT_STRING, offsetof(SignTextRequest, stringToSign) },
{ CMT_DT_STRING, offsetof(SignTextRequest, hostName) },
{ CMT_DT_STRING, offsetof(SignTextRequest, caOption) },
{ CMT_DT_LIST, offsetof(SignTextRequest, numCAs) },
{ CMT_DT_STRING, offsetof(SignTextRequest, caNames) },
{ CMT_DT_END }
};
CMTMessageTemplate GetLocalizedTextReplyTemplate[] =
{
{ CMT_DT_INT, offsetof(GetLocalizedTextReply, whichString) },
{ CMT_DT_STRING, offsetof(GetLocalizedTextReply, localizedString) },
{ CMT_DT_END }
};
CMTMessageTemplate ImportCertReplyTemplate[] =
{
{ CMT_DT_INT, offsetof(ImportCertReply, result) },
{ CMT_DT_INT, offsetof(ImportCertReply, resID) },
{ CMT_DT_END }
};
CMTMessageTemplate PromptRequestTemplate[] =
{
{ CMT_DT_INT, offsetof(PromptRequest, resID) },
{ CMT_DT_STRING, offsetof(PromptRequest, prompt) },
{ CMT_DT_ITEM, offsetof(PromptRequest, clientContext) },
{ CMT_DT_END }
};
CMTMessageTemplate PromptReplyTemplate[] =
{
{ CMT_DT_INT, offsetof(PromptReply, resID) },
{ CMT_DT_BOOL, offsetof(PromptReply, cancel) },
{ CMT_DT_STRING, offsetof(PromptReply, promptReply) },
{ CMT_DT_END }
};
CMTMessageTemplate RedirectCompareRequestTemplate[] =
{
{ CMT_DT_ITEM, offsetof(RedirectCompareRequest, socketStatus1Data) },
{ CMT_DT_ITEM, offsetof(RedirectCompareRequest, socketStatus2Data) },
{ CMT_DT_END }
};
CMTMessageTemplate DecodeAndAddCRLRequestTemplate[] =
{
{ CMT_DT_ITEM, offsetof(DecodeAndAddCRLRequest, derCrl) },
{ CMT_DT_INT, offsetof(DecodeAndAddCRLRequest, type) },
{ CMT_DT_STRING, offsetof(DecodeAndAddCRLRequest, url) },
{ CMT_DT_END }
};
CMTMessageTemplate SecurityAdvisorRequestTemplate[] =
{
{ CMT_DT_INT, offsetof(SecurityAdvisorRequest, infoContext) },
{ CMT_DT_INT, offsetof(SecurityAdvisorRequest, resID) },
{ CMT_DT_STRING, offsetof(SecurityAdvisorRequest, hostname) },
{ CMT_DT_STRING, offsetof(SecurityAdvisorRequest, senderAddr) },
{ CMT_DT_INT, offsetof(SecurityAdvisorRequest, encryptedP7CInfo) },
{ CMT_DT_INT, offsetof(SecurityAdvisorRequest, signedP7CInfo) },
{ CMT_DT_INT, offsetof(SecurityAdvisorRequest, decodeError) },
{ CMT_DT_INT, offsetof(SecurityAdvisorRequest, verifyError) },
{ CMT_DT_BOOL, offsetof(SecurityAdvisorRequest, encryptthis) },
{ CMT_DT_BOOL, offsetof(SecurityAdvisorRequest, signthis) },
{ CMT_DT_LIST, offsetof(SecurityAdvisorRequest, numRecipients) },
{ CMT_DT_STRING, offsetof(SecurityAdvisorRequest, recipients) },
{ CMT_DT_END }
};
CMTMessageTemplate SCAddTempCertToPermDBRequestTemplate[] =
{
{ CMT_DT_ITEM, offsetof(SCAddTempCertToPermDBRequest, certKey) },
{ CMT_DT_STRING, offsetof(SCAddTempCertToPermDBRequest, trustStr) },
{ CMT_DT_STRING, offsetof(SCAddTempCertToPermDBRequest, nickname) },
{ CMT_DT_END }
};
CMTMessageTemplate SCDeletePermCertsRequestTemplate[] =
{
{ CMT_DT_ITEM, offsetof(SCDeletePermCertsRequest, certKey) },
{ CMT_DT_BOOL, offsetof(SCDeletePermCertsRequest, deleteAll) },
{ CMT_DT_END }
};
CMTMessageTemplate TimeMessageTemplate[] =
{
{ CMT_DT_INT, offsetof(TimeMessage, year) },
{ CMT_DT_INT, offsetof(TimeMessage, month) },
{ CMT_DT_INT, offsetof(TimeMessage, day) },
{ CMT_DT_INT, offsetof(TimeMessage, hour) },
{ CMT_DT_INT, offsetof(TimeMessage, minute) },
{ CMT_DT_INT, offsetof(TimeMessage, second) },
{ CMT_DT_END }
};
CMTMessageTemplate SCCertIndexEnumReplyTemplate[] =
{
{ CMT_DT_INT, offsetof(SCCertIndexEnumReply, length) },
{ CMT_DT_STRUCT_PTR, offsetof(SCCertIndexEnumReply, list) },
{ CMT_DT_STRING, offsetof(CertEnumElement, name) },
{ CMT_DT_ITEM, offsetof(CertEnumElement, certKey) },
{ CMT_DT_END_STRUCT_LIST },
{ CMT_DT_END }
};
/* Test template */
CMTMessageTemplate TestListTemplate[] =
{
{ CMT_DT_STRING, offsetof(TestList, listName) },
{ CMT_DT_STRUCT_LIST, offsetof(TestList, numElements) },
{ CMT_DT_STRUCT_PTR, offsetof(TestList, elements) },
{ CMT_DT_STRING, offsetof(TestListElement, name) },
{ CMT_DT_STRING, offsetof(TestListElement, value) },
{ CMT_DT_END_STRUCT_LIST},
{ CMT_DT_END}
};
CMTMessageTemplate SetPrefListMessageTemplate[] =
{
{ CMT_DT_STRUCT_LIST, offsetof(SetPrefListMessage, length) },
{ CMT_DT_STRUCT_PTR, offsetof(SetPrefListMessage, list) },
{ CMT_DT_STRING, offsetof(SetPrefElement, key) },
{ CMT_DT_STRING, offsetof(SetPrefElement, value) },
{ CMT_DT_INT, offsetof(SetPrefElement, type) },
{ CMT_DT_END_STRUCT_LIST },
{ CMT_DT_END }
};
CMTMessageTemplate GetPrefListRequestTemplate[] =
{
{ CMT_DT_STRUCT_LIST, offsetof(GetPrefListRequest, length) },
{ CMT_DT_STRUCT_PTR, offsetof(GetPrefListRequest, list) },
{ CMT_DT_STRING, offsetof(GetPrefElement, key) },
{ CMT_DT_INT, offsetof(GetPrefElement, type) },
{ CMT_DT_END_STRUCT_LIST },
{ CMT_DT_END }
};
CMTMessageTemplate GetCertExtensionTemplate[] =
{
{ CMT_DT_INT, offsetof(GetCertExtension, resID) },
{ CMT_DT_INT, offsetof(GetCertExtension, extension) },
{ CMT_DT_END }
};
CMTMessageTemplate HTMLCertInfoRequestTemplate[] =
{
{ CMT_DT_INT, offsetof(HTMLCertInfoRequest, certID) },
{ CMT_DT_INT, offsetof(HTMLCertInfoRequest, showImages) },
{ CMT_DT_INT, offsetof(HTMLCertInfoRequest, showIssuer) },
{ CMT_DT_END }
};
CMTMessageTemplate EncryptRequestTemplate[] =
{
{ CMT_DT_ITEM, offsetof(EncryptRequestMessage, keyid) },
{ CMT_DT_ITEM, offsetof(EncryptRequestMessage, data) },
{ CMT_DT_END }
};