64 writeSequence( stream, msgData.
length );
65 return( exportCertToStream( stream, sessionInfoPtr->
iCertRequest,
96 static
int writeResponseBodyHeader(
INOUT STREAM *stream,
101 const int respType = reqToResp( operationType );
103 int totalPayloadSize;
118 writeSequence( stream,
objSize( statusInfoLength ) );
119 writeSequence( stream, statusInfoLength );
120 return( writePkiStatusInfo( stream,
CRYPT_OK, 0 ) );
135 writeSequence( stream,
objSize( totalPayloadSize ) );
136 writeSequence( stream, totalPayloadSize );
138 return( writePkiStatusInfo( stream,
CRYPT_OK, 0 ) );
142 static
int writeEncryptedResponseBody(
INOUT STREAM *stream,
166 status = sMemGetDataBlockRemaining( stream, &srcPtr, &dataLength );
169 srcPtr = (
BYTE * ) srcPtr + 100;
171 ENSURES( dataLength >= 1024 && dataLength < sMemDataLeft( stream ) );
185 status = envelopeWrap( srcPtr, msgData.
length, srcPtr, dataLength,
193 status = writeResponseBodyHeader( stream, protocolInfo->
operation,
212 writeSequence( stream,
objSize( dataLength ) );
214 status = sMemGetDataBlockRemaining( stream, &destPtr, &destLength );
217 ENSURES( dataLength <= destLength );
220 memmove( destPtr, srcPtr, dataLength );
221 return( sSkip( stream, dataLength ) );
225 static
int writeResponseBody(
INOUT STREAM *stream,
238 return( writeResponseBodyHeader( stream, protocolInfo->
operation,
245 return( writeEncryptedResponseBody( stream, sessionInfoPtr,
255 dataLength = msgData.
length;
256 status = writeResponseBodyHeader( stream, protocolInfo->
operation,
262 writeSequence( stream,
objSize( dataLength ) );
264 return( exportCertToStream( stream, sessionInfoPtr->
iCertResponse,
282 static const MAP_TABLE fingerprintMapTable[] = {
298 status = mapValue( protocolInfo->
confHashAlgo, &fingerprintType,
313 writeSequence( stream,
objSize( length ) );
314 writeSequence( stream, length );
316 return( writeShortInteger( stream, 0,
DEFAULT_TAG ) );
344 static
int writeGenMsgRequestBody(
INOUT STREAM *stream,
358 static
int writeGenMsgResponseBody(
INOUT STREAM *stream,
382 CRYPT_IATTRIBUTE_CTL );
403 CRYPT_IATTRIBUTE_CERTCOLLECTION );
435 writeSequence( stream, msgData.
length );
452 const int statusInfoLength = \
463 writeSequence( stream, statusInfoLength );
464 return( writePkiStatusInfo( stream, protocolInfo->
status,
476 const WRITEMESSAGE_FUNCTION
function;
478 static const MESSAGEWRITE_INFO
FAR_BSS messageWriteClientTable[] = {
485 static const MESSAGEWRITE_INFO
FAR_BSS messageWriteServerTable[] = {
509 if( messageWriteServerTable[ i ].
type == bodyType )
510 return( messageWriteServerTable[ i ].
function );
521 if( messageWriteClientTable[ i ].
type == bodyType )
522 return( messageWriteClientTable[ i ].
function );