28 static const MAP_TABLE reqClibReqMapTbl[] = {
46 status = mapValue( reqType, &value, reqClibReqMapTbl,
60 CMP_INFO *cmpInfo = sessionInfoPtr->sessionCMP;
71 status = setCMPprotocolInfo( protocolInfo, NULL, 0,
85 protocolInfo->userID, protocolInfo->userIDsize,
93 findSessionInfo( sessionInfoPtr->attributeList,
102 memcpy( userID, userNamePtr->value, userIDlen );
117 memcpy( userID,
"the requested user", userIDlen );
122 "Couldn't find PKI user information for %s",
127 protocolInfo->userIDchanged =
FALSE;
135 status = updateSessionInfo( &sessionInfoPtr->attributeList,
145 "Couldn't copy PKI user data from PKI user object to "
146 "session object" ) );
156 CMP_INFO *cmpInfo = sessionInfoPtr->sessionCMP;
187 protocolInfo->certID, protocolInfo->certIDsize,
197 "Couldn't find PKI user information for owner of "
198 "requesting certificate" ) );
209 status = updateSessionInfo( &sessionInfoPtr->attributeList,
218 "Couldn't copy PKI user data from PKI user object to "
219 "session object" ) );
229 protocolInfo->certID, protocolInfo->certIDsize,
239 "Couldn't find certificate for requested user" ) );
241 sessionInfoPtr->iAuthInContext = getkeyInfo.
cryptHandle;
242 protocolInfo->certIDchanged =
FALSE;
257 BOOLEAN writeHttpResponseOnly = !protocolInfo->headerRead;
269 protocolInfo->useMACsend =
FALSE;
277 if( !writeHttpResponseOnly )
279 status = writePkiMessage( sessionInfoPtr, protocolInfo,
CMPBODY_ERROR );
281 writeHttpResponseOnly =
TRUE;
283 if( writeHttpResponseOnly )
292 sessionInfoPtr->receiveBufSize );
294 swrite( &sessionInfoPtr->stream, &httpDataInfo,
316 CMP_INFO *cmpInfo = sessionInfoPtr->sessionCMP;
329 initCMPprotocolInfo( &protocolInfo,
332 protocolInfo.
authContext = sessionInfoPtr->privateKey;
336 if( userNamePtr != NULL )
360 memcpy( userID, userNamePtr->value, userIDsize );
362 status = setCMPprotocolInfo( &protocolInfo, userID, userIDsize,
366 destroyCMPprotocolInfo( &protocolInfo );
384 status = readPkiDatagram( sessionInfoPtr );
387 destroyCMPprotocolInfo( &protocolInfo );
390 status = readPkiMessage( sessionInfoPtr, &protocolInfo,
399 sendErrorResponse( sessionInfoPtr, &protocolInfo, status );
400 destroyCMPprotocolInfo( &protocolInfo );
408 status = writePkiMessage( sessionInfoPtr, &protocolInfo,
418 sendErrorResponse( sessionInfoPtr, &protocolInfo, status );
419 destroyCMPprotocolInfo( &protocolInfo );
441 sendErrorResponse( sessionInfoPtr, &protocolInfo, status );
442 destroyCMPprotocolInfo( &protocolInfo );
445 "Certificate request signature check failed" ) );
455 setkeyInfo.
cryptHandle = sessionInfoPtr->iCertRequest;
479 sendErrorResponse( sessionInfoPtr, &protocolInfo, status );
480 destroyCMPprotocolInfo( &protocolInfo );
486 "Initialisation request couldn't be added to the "
487 "certificate store because another initialisation "
488 "request has already been processed for this user" ) );
492 "Request couldn't be added to the certificate store" ) );
499 sessionInfoPtr->iCertRequest );
509 sessionInfoPtr->iCertResponse = certMgmtInfo.
cryptCert;
512 CRYPT_IATTRIBUTE_CERTHASHALGO );
520 sessionInfoPtr->iCertRequest );
531 sendErrorResponse( sessionInfoPtr, &protocolInfo, status );
532 destroyCMPprotocolInfo( &protocolInfo );
535 "Certificate %s was denied by certificate store",
537 "issue" :
"revocation" ) );
541 status = writePkiMessage( sessionInfoPtr, &protocolInfo,
CMPBODY_NORMAL );
550 sendErrorResponse( sessionInfoPtr, &protocolInfo, status );
563 sessionInfoPtr->iCertResponse );
568 destroyCMPprotocolInfo( &protocolInfo );
581 destroyCMPprotocolInfo( &protocolInfo );
586 status = readPkiDatagram( sessionInfoPtr );
588 status = readPkiMessage( sessionInfoPtr, &protocolInfo,
592 sendErrorResponse( sessionInfoPtr, &protocolInfo, status );
593 destroyCMPprotocolInfo( &protocolInfo );
599 sessionInfoPtr->iCertResponse );
612 status = writePkiMessage( sessionInfoPtr, &protocolInfo,
CMPBODY_ACK );
616 destroyCMPprotocolInfo( &protocolInfo );
621 sessionInfoPtr->iCertResponse );
630 sessionInfoPtr->iCertResponse );
636 sendErrorResponse( sessionInfoPtr, &protocolInfo, status );
637 destroyCMPprotocolInfo( &protocolInfo );
640 "Certificate issue completion failed" ) );
644 status = writePkiMessage( sessionInfoPtr, &protocolInfo,
CMPBODY_ACK );
657 destroyCMPprotocolInfo( &protocolInfo );
668 void initCMPserverProcessing(
SESSION_INFO *sessionInfoPtr )
672 sessionInfoPtr->transactFunction = serverTransact;