43 assert( ( buffer == NULL && bufSize == 0 ) || \
47 REQUIRES( ( buffer == NULL && bufSize == 0 ) || \
83 if( !isECC && hashSize != 20 )
115 2 * ( 2 + sigComponentSize ) : \
116 sizeofObject( ( 2 * sizeofObject( \
117 sigComponentSize + 1 ) ) );
122 setDLPParams( &dlpParams, hash, hashSize, buffer, bufSize );
130 *length = dlpParams.
outLen;
137 static
int checkDlpSignature(
IN_BUFFER( signatureDataLength ) \
138 const void *signatureData,
152 signatureDataLength == 40 ) || \
153 ( signatureDataLength > 40 && \
166 hashSize = msgData.
length;
172 if( !isECC && hashSize != 20 )
182 dlpParams.inParam2 = signatureData;
183 dlpParams.
inLen2 = signatureDataLength;
213 BYTE *bufPtr = ( signature == NULL ) ? NULL : buffer;
218 assert( ( signature == NULL && sigMaxLength == 0 ) || \
220 assert(
isWritePtr( signatureLength,
sizeof(
int ) ) );
222 REQUIRES( ( signature == NULL && sigMaxLength == 0 ) || \
223 ( signature != NULL && \
240 if( writeSigFunction == NULL )
263 status = createDlpSignature( bufPtr, bufSize, &length, iSignContext,
264 isSSLsig ? iHashContext2 : iHashContext,
274 iHashContext2, iSignContext );
300 if( signature == NULL )
301 memset( buffer, 0x01, length );
304 sMemOpenOpt( &stream, signature, sigMaxLength );
305 status = writeSigFunction( &stream, iSignContext, hashAlgo, hashParam,
306 signAlgo, buffer, length );
308 *signatureLength = stell( &stream );
309 sMemDisconnect( &stream );
325 int checkSignature(
IN_BUFFER( signatureLength )
const void *signature,
338 int signAlgo,
hashAlgo, signatureDataLength, hashParam = 0,
status;
340 assert(
isReadPtr( signature, signatureLength ) );
358 if( readSigFunction == NULL )
375 sMemConnect( &stream, signature, signatureLength );
376 status = readSigFunction( &stream, &queryInfo );
377 sMemDisconnect( &stream );
393 if( hashAlgo != queryInfo.
hashAlgo )
446 return( checkDlpSignature( signatureData, signatureDataLength,
448 isSSLsig ? iHashContext2 : iHashContext,
455 iHashContext, iHashContext2, iSigCheckContext );