28 static const MAP_TABLE clibReqReqMapTbl[] = {
39 static
int clibReqToReq(
IN_ENUM( CRYPT_REQUESTTYPE )
const int reqType )
46 status = mapValue( reqType, &value, clibReqReqMapTbl,
57 CMP_INFO *cmpInfo = sessionInfoPtr->sessionCMP;
59 findSessionInfo( sessionInfoPtr->attributeList,
62 findSessionInfo( sessionInfoPtr->attributeList,
72 status = protocolInfo->operation = clibReqToReq( cmpInfo->
requestType );
81 passwordPtr != NULL ) )
91 protocolInfo->authContext = sessionInfoPtr->iAuthOutContext;
92 protocolInfo->cryptOnlyKey =
TRUE;
98 protocolInfo->authContext = sessionInfoPtr->privateKey;
107 if( !protocolInfo->isCryptlib )
118 status = setCMPprotocolInfo( protocolInfo, userID,
130 return( setCMPprotocolInfo( protocolInfo, NULL, 0,
138 status = setCMPprotocolInfo( protocolInfo, NULL, 0,
142 protocolInfo->useMACsend = protocolInfo->useMACreceive =
TRUE;
152 BYTE decodedValue[ 64 + 8 ];
153 int decodedValueLength;
157 status = decodePKIUserValue( decodedValue, 64, &decodedValueLength,
161 status = setCMPprotocolInfo( protocolInfo, decodedValue,
169 status = setCMPprotocolInfo( protocolInfo, userNamePtr->value,
182 BYTE decodedValue[ 64 + 8 ];
183 int decodedValueLength;
187 status = decodePKIUserValue( decodedValue, 64, &decodedValueLength,
191 status = initMacInfo( protocolInfo->iMacContext, decodedValue,
192 decodedValueLength, protocolInfo->salt,
193 protocolInfo->saltSize,
194 protocolInfo->iterations );
200 status = initMacInfo( protocolInfo->iMacContext,
202 protocolInfo->salt, protocolInfo->saltSize,
203 protocolInfo->iterations );
219 #ifdef USE_CMP_TRANSPORT
220 const PROTOCOL_INFO *protocolInfoPtr = sessionInfoPtr->protocolInfo;
222 CMP_INFO *cmpInfo = sessionInfoPtr->sessionCMP;
258 status = initSessionNetConnectInfo( sessionInfoPtr, &connectInfo );
261 #ifdef USE_CMP_TRANSPORT
264 &connectInfo, &sessionInfoPtr->errorInfo );
268 protocolInfoPtr->altProtocolInfo;
275 if( connectInfo.
port == 80 )
276 connectInfo.
port = altProtocolInfoPtr->
port;
277 status = sNetConnect( &sessionInfoPtr->stream,
278 altProtocolInfoPtr->
type,
279 &connectInfo, &sessionInfoPtr->errorInfo );
284 &connectInfo, &sessionInfoPtr->errorInfo ) );
296 CMP_INFO *cmpInfo = sessionInfoPtr->sessionCMP;
313 initCMPprotocolInfo( &protocolInfo,
316 status = initClientInfo( sessionInfoPtr, &protocolInfo );
319 destroyCMPprotocolInfo( &protocolInfo );
324 status = writePkiMessage( sessionInfoPtr, &protocolInfo,
345 destroyCMPprotocolInfo( &protocolInfo );
350 status = readPkiDatagram( sessionInfoPtr );
353 const int responseType = reqToResp( protocolInfo.
operation );
357 status = responseType;
360 status = readPkiMessage( sessionInfoPtr, &protocolInfo,
371 &sessionInfoPtr->iCertResponse,
372 CRYPT_IATTRIBUTE_CTL );
382 destroyCMPprotocolInfo( &protocolInfo );
399 destroyCMPprotocolInfo( &protocolInfo );
406 status = writePkiMessage( sessionInfoPtr, &protocolInfo,
415 status = readPkiDatagram( sessionInfoPtr );
419 status = readPkiMessage( sessionInfoPtr, &protocolInfo,
CTAG_PB_PKICONF );
428 destroyCMPprotocolInfo( &protocolInfo );
442 return( clientTransact( sessionInfoPtr ) );
447 sessionInfoPtr->transactFunction = clientTransact;
448 status = pnpPkiSession( sessionInfoPtr );
449 sessionInfoPtr->transactFunction = clientTransactWrapper;
460 void initCMPclientProcessing(
SESSION_INFO *sessionInfoPtr )
464 sessionInfoPtr->connectFunction = clientStartup;
465 sessionInfoPtr->transactFunction = clientTransactWrapper;