45 sMemConnect( &stream, data,
min( 16, dataLength ) );
66 readSequence( &stream, NULL );
70 sMemDisconnect( &stream );
86 sMemDisconnect( &stream );
93 status = pgpReadPacketHeader( &stream, NULL, &value, 30 );
96 sMemDisconnect( &stream );
101 sMemDisconnect( &stream );
138 if( signature != NULL )
143 if( !
isWritePtr( signature, signatureMaxLength ) )
149 if( signatureMaxLength != 0 )
154 *signatureLength = 0;
156 formatType >= CRYPT_FORMAT_LAST_EXTERNAL )
237 status = iCryptCreateSignature( signature, signatureMaxLength,
238 signatureLength, formatType, signContext, hashContext,
239 hasSigParams ? &sigParams : NULL );
259 signContext, hashContext,
295 if( !
isReadPtr( signature, signatureLength ) )
297 if( ( formatType = getFormatType( signature, \
339 if( extraData != NULL )
345 if( extraData != NULL )
356 if( extraData != NULL )
366 status = iCryptCheckSignature( signature, signatureLength, formatType,
368 ( extraData != NULL ) ? &iExtraData : NULL );
375 if( extraData == NULL )
388 CRYPT_IATTRIBUTE_INTERNAL );
405 hashContext, NULL ) );
432 assert( signature == NULL ||
isWritePtr( signature, signatureMaxLength ) );
433 assert(
isWritePtr( signatureLength,
sizeof(
int ) ) );
436 REQUIRES( ( signature == NULL && signatureMaxLength == 0 ) || \
437 ( signature != NULL && \
445 formatType == CRYPT_IFORMAT_SSH || \
446 formatType == CRYPT_IFORMAT_TLS12 ) && \
447 sigParams == NULL ) ||
451 formatType == CRYPT_IFORMAT_SSL ) && \
452 sigParams != NULL ) );
459 *signatureLength = 0;
485 CRYPT_IATTRIBUTE_LOCKED );
495 CRYPT_IATTRIBUTE_LOCKED );
505 status = createSignature( signature, signatureMaxLength,
506 signatureLength, iSignContext,
515 sigParams->useDefaultAuthAttr ==
FALSE ) || \
517 sigParams->useDefaultAuthAttr ==
TRUE ) || \
519 sigParams->useDefaultAuthAttr ==
FALSE ) );
523 status = createSignatureCMS( signature, signatureMaxLength,
524 signatureLength, iSignContext,
526 sigParams->useDefaultAuthAttr,
530 CRYPT_UNUSED : sigParams->iTspSession,
545 status = createSignaturePGP( signature, signatureMaxLength,
546 signatureLength, iSignContext,
547 iHashContext, sigParams->sigType );
552 case CRYPT_IFORMAT_SSL:
559 status = createSignature( signature, signatureMaxLength,
560 signatureLength, iSignContext,
561 iHashContext, sigParams->iSecondHash,
565 case CRYPT_IFORMAT_TLS12:
568 status = createSignature( signature, signatureMaxLength,
569 signatureLength, iSignContext,
576 case CRYPT_IFORMAT_SSH:
577 status = createSignature( signature, signatureMaxLength,
578 signatureLength, iSignContext,
590 DEBUG_DIAG((
"Signature creation return argError status" ));
602 CRYPT_IATTRIBUTE_LOCKED );
609 int iCryptCheckSignature(
IN_BUFFER( signatureLength )
const void *signature,
621 assert(
isReadPtr( signature, signatureLength ) );
629 REQUIRES( ( formatType == CRYPT_IFORMAT_SSL && \
633 formatType == CRYPT_IFORMAT_TLS12 ) && \
637 formatType == CRYPT_IFORMAT_TLS12 || \
638 formatType == CRYPT_IFORMAT_SSH ) && \
651 status = checkSignature( signature, signatureLength,
652 sigCheckContext, iHashContext,
658 status = checkSignaturePGP( signature, signatureLength,
659 sigCheckContext, iHashContext );
664 case CRYPT_IFORMAT_SSL:
665 status = checkSignature( signature, signatureLength,
666 sigCheckContext, iHashContext,
670 case CRYPT_IFORMAT_TLS12:
671 status = checkSignature( signature, signatureLength,
672 sigCheckContext, iHashContext,
678 case CRYPT_IFORMAT_SSH:
679 status = checkSignature( signature, signatureLength,
680 sigCheckContext, iHashContext,
687 if( extraData != NULL )
689 status = checkSignatureCMS( signature, signatureLength,
690 sigCheckContext, iHashContext,
691 extraData, iSigCheckKey );
700 DEBUG_DIAG((
"Signature creation return argError status" ));