45 sMemConnect( &stream, data,
min( 16, dataLength ) );
64 readSequence( &stream, NULL );
68 sMemDisconnect( &stream );
84 sMemDisconnect( &stream );
94 sMemDisconnect( &stream );
97 sMemDisconnect( &stream );
105 status = pgpReadPacketHeader( &stream, NULL, &value, 30 );
108 sMemDisconnect( &stream );
113 sMemDisconnect( &stream );
125 int localCryptAlgo,
status;
165 *cryptAlgo = localCryptAlgo;
186 formatType < CRYPT_FORMAT_LAST_EXTERNAL );
234 status =
checkAlgoID( sessionKeyAlgo, sessionKeyMode );
247 cryptlibToPgpAlgo( exportAlgo, &dummy ) ) )
254 cryptlibToPgpAlgo( sessionKeyAlgo, &dummy ) ) )
306 if( !
isReadPtr( encryptedKey, encryptedKeyLength ) )
318 status = checkWrapKey( importKey, &importAlgo,
TRUE );
348 if( returnedContext != NULL )
380 status = iCryptImportKey( encryptedKey, encryptedKeyLength, formatType,
381 importKey, sessionKeyContext,
383 &iReturnedContext : NULL );
427 CRYPT_IATTRIBUTE_INTERNAL );
446 sessionKeyContext, NULL ) );
465 int sessionKeyAlgo,
status;
468 if( encryptedKey != NULL )
473 if( !
isWritePtr( encryptedKey, encryptedKeyMaxLength ) )
479 if( encryptedKeyMaxLength != 0 )
484 *encryptedKeyLength = 0;
496 status = checkWrapKey( exportKey, &exportAlgo,
FALSE );
499 status = checkContextsEncodable( exportKey, exportAlgo,
500 sessionKeyContext, formatType );
520 status = iCryptExportKey( encryptedKey, encryptedKeyMaxLength,
521 encryptedKeyLength, formatType,
522 sessionKeyContext, exportKey );
543 exportKey, sessionKeyContext );
573 assert(
isReadPtr( encryptedKey, encryptedKeyLength ) );
577 iReturnedContext == NULL ) );
589 iReturnedContext != NULL ) || \
591 iReturnedContext == NULL ) );
602 return( importConventionalKey( encryptedKey, encryptedKeyLength,
603 iSessionKeyContext, iImportKey,
606 return( importPublicKey( encryptedKey, encryptedKeyLength,
607 iSessionKeyContext, iImportKey,
608 iReturnedContext, keyexType ) );
624 const int encKeyMaxLength = ( encryptedKey == NULL ) ? \
625 0 : encryptedKeyMaxLength;
628 assert( ( encryptedKey == NULL && encryptedKeyMaxLength == 0 ) || \
630 isWritePtr( encryptedKey, encryptedKeyMaxLength ) ) );
631 assert(
isWritePtr( encryptedKeyLength,
sizeof(
int ) ) );
633 REQUIRES( ( encryptedKey == NULL && encryptedKeyMaxLength == 0 ) || \
646 *encryptedKeyLength = 0;
658 return( exportConventionalKey( encryptedKey, encKeyMaxLength,
659 encryptedKeyLength, iSessionKeyContext,
660 iExportKey, keyexType ) );
669 return( exportPublicKey( encryptedKey, encKeyMaxLength,
670 encryptedKeyLength, iSessionKeyContext,
671 iExportKey, NULL, 0, keyexType ) );
692 CRYPT_IATTRIBUTE_LOCKED );
698 status = dynCreate( &auxDB, iExportKey,
699 CRYPT_IATTRIBUTE_ISSUERANDSERIALNUMBER );
704 CRYPT_IATTRIBUTE_LOCKED );
710 status = exportPublicKey( encryptedKey, encKeyMaxLength,
711 encryptedKeyLength, iSessionKeyContext,
719 dynDestroy( &auxDB );