53 if(
findAction( envelopeInfoPtr->preActionList,
61 envelopeInfoPtr->postActionList != NULL )
67 envelopeInfoPtr->actionList != NULL )
96 assert( ( iv == NULL && ivLength == 0 ) || \
104 REQUIRES( ( iv == NULL && ivLength == 0 ) || \
122 ( contextAlgorithm != algorithm || contextMode != mode ) )
129 if( ivLength != 0 && ivLength != blockSize )
186 envelopeInfoPtr->blockSizeMask = ~( blockSize - 1 );
196 IN_INT_Z const int signingKeyPresent )
222 switch( envelopeInfoPtr->usage )
229 DEBUG_DIAG((
"Hashed (rather than MAC'd) enveloping isn't supported" ));
242 if(
findAction( envelopeInfoPtr->preActionList, \
262 if(
findAction( envelopeInfoPtr->preActionList, \
277 if(
findAction( envelopeInfoPtr->postActionList, \
284 signingKeyPresent =
TRUE;
294 if( envelopeInfoPtr->postActionList != NULL )
298 status = checkActionIndirect( envelopeInfoPtr->postActionList,
299 checkSignatureActionFunction,
338 switch( keysetFunction )
341 iKeysetPtr = &envelopeInfoPtr->iEncryptionKeyset;
345 iKeysetPtr = &envelopeInfoPtr->iDecryptionKeyset;
349 iKeysetPtr = &envelopeInfoPtr->iSigCheckKeyset;
385 assert(
isReadPtr( password, passwordLength ) );
442 static
int addPgpPasswordInfo(
ENVELOPE_INFO *envelopeInfoPtr,
443 IN_BUFFER( passwordLength )
const void *password,
445 const int passwordLength )
456 assert(
isReadPtr( password, passwordLength ) );
501 &msgData, CRYPT_IATTRIBUTE_RANDOM_NONCE );
505 password, passwordLength,
518 status = addAction( &envelopeInfoPtr->
actionList,
563 if( !envelopeInfoPtr->checkAlgo( algorithm, mode ) )
575 actionResult = checkAction( *actionListHeadPtrPtr, actionType,
577 switch( actionResult )
624 status = addActionEx( &actionListPtr, actionListHeadPtrPtr,
625 envelopeInfoPtr->memPoolState, actionType,
651 &certHashAlgo, CRYPT_IATTRIBUTE_CERTHASHALGO );
654 envelopeInfoPtr->defaultHash = certHashAlgo;
658 if( envelopeInfoPtr->actionList == NULL )
671 status = addActionEx( &hashActionPtr, &envelopeInfoPtr->actionList,
685 ACTION_NEEDSCONTROLLER;
690 hashActionPtr = findLastAction( envelopeInfoPtr->actionList,
692 if( hashActionPtr == NULL )
726 REQUIRES( ( envInfo == CRYPT_IATTRIBUTE_INCLUDESIGCERT ) || \
727 ( envInfo == CRYPT_IATTRIBUTE_ATTRONLY ) || \
739 const int status = checkPgpUsage( envelopeInfoPtr, envInfo );
752 case CRYPT_IATTRIBUTE_INCLUDESIGCERT:
759 case CRYPT_IATTRIBUTE_ATTRONLY:
775 envelopeInfoPtr->payloadSize =
value;
779 envelopeInfoPtr->contentType =
value;
819 if( envelopeInfoPtr->actionList != NULL )
838 return( addKeysetInfo( envelopeInfoPtr, envInfo, cryptHandle ) );
848 actionListPtr = findLastAction( envelopeInfoPtr->postActionList,
850 if( actionListPtr == NULL )
877 #ifdef USE_COMPRESSION
900 return( addContextInfo( envelopeInfoPtr, cryptHandle,
901 &envelopeInfoPtr->preActionList,
909 return( addContextInfo( envelopeInfoPtr, cryptHandle,
910 &envelopeInfoPtr->preActionList,
917 if( envelopeInfoPtr->actionList != NULL )
935 return( addContextInfo( envelopeInfoPtr, cryptHandle,
936 &envelopeInfoPtr->actionList,
940 return( addContextInfo( envelopeInfoPtr, cryptHandle,
941 &envelopeInfoPtr->actionList,
945 return( addContextInfo( envelopeInfoPtr, cryptHandle,
946 &envelopeInfoPtr->postActionList,
963 assert(
isReadPtr( value, valueLength ) );
970 return( addPgpPasswordInfo( envelopeInfoPtr, value, valueLength ) );
972 return( addPasswordInfo( envelopeInfoPtr, value, valueLength ) );
989 envelopeInfoPtr->addInfo = addEnvelopeInfo;
990 envelopeInfoPtr->addInfoString = addEnvelopeInfoString;
991 envelopeInfoPtr->checkMissingInfo = checkMissingInfo;