28 int envelopeWrap(
IN_BUFFER( inDataLength )
const void *inData,
31 *outDataLength )
void *outData,
45 assert(
isReadPtr( inData, inDataLength ) );
46 assert(
isWritePtr( outData, outDataMaxLength ) );
47 assert(
isWritePtr( outDataLength,
sizeof(
int ) ) );
51 outDataMaxLength >= inDataLength + 512 && \
73 memset( outData, 0,
min( 16, outDataMaxLength ) );
85 const int value = contentType;
104 memset( outData, 0,
min( 16, outDataMaxLength ) );
119 msgData.
length < outDataMaxLength );
122 *outDataLength = msgData.
length;
128 *outDataLength ) ) );
134 int envelopeUnwrap(
IN_BUFFER( inDataLength )
const void *inData,
137 *outDataLength )
void *outData,
148 assert(
isReadPtr( inData, inDataLength ) );
149 assert(
isWritePtr( outData, outDataMaxLength ) );
150 assert(
isWritePtr( outDataLength,
sizeof(
int ) ) );
153 REQUIRES( outDataMaxLength > 16 && \
154 outDataMaxLength >= inDataLength && \
176 memset( outData, 0,
min( 16, outDataMaxLength ) );
190 memset( outData, 0,
min( 16, outDataMaxLength ) );
217 msgData.
length < outDataMaxLength );
222 *outDataLength = msgData.
length;
235 int envelopeSign(
IN_BUFFER( inDataLength )
const void *inData,
238 *outDataLength )
void *outData,
252 assert(
isReadPtr( inData, inDataLength ) );
253 assert(
isWritePtr( outData, outDataMaxLength ) );
254 assert(
isWritePtr( outDataLength,
sizeof(
int ) ) );
259 inDataLength == 0 ) );
260 REQUIRES( outDataMaxLength > 16 && \
261 outDataMaxLength >= inDataLength + 512 && \
282 memset( outData, 0,
min( 16, outDataMaxLength ) );
294 const int value = contentType;
311 if( inDataLength <= 0 )
315 CRYPT_IATTRIBUTE_ATTRONLY );
328 memset( outData, 0,
min( 16, outDataMaxLength ) );
343 msgData.
length < outDataMaxLength );
346 *outDataLength = msgData.
length;
352 *outDataLength ) ) );
358 int envelopeSigCheck(
IN_BUFFER( inDataLength )
const void *inData,
361 *outDataLength )
void *outData,
375 assert(
isReadPtr( inData, inDataLength ) );
376 assert(
isWritePtr( outData, outDataMaxLength ) );
377 assert(
isWritePtr( outDataLength,
sizeof(
int ) ) );
378 assert(
isWritePtr( sigResult,
sizeof(
int ) ) );
379 assert( iSigningCert == NULL || \
381 assert( iCmsAttributes == NULL || \
385 REQUIRES( outDataMaxLength > 16 && \
386 outDataMaxLength >= inDataLength && \
396 if( iSigningCert != NULL )
398 if( iCmsAttributes != NULL )
417 memset( outData, 0,
min( 16, outDataMaxLength ) );
426 CRYPT_IATTRIBUTE_ATTRONLY );
437 memset( outData, 0,
min( 16, outDataMaxLength ) );
459 msgData.
length < outDataMaxLength );
479 *outDataLength = msgData.
length;