Please post a complete test program with a main() function, and give the
error message, and stack trace that you see. Also, what version of
Crypto++, what compiler, OS are you using?

I would think this is common sense, but people keep posting questions 
without these pieces of information. I'll update the web site to tell 
people to submit them. Maybe that'll help.

On Wed, Oct 09, 2002 at 05:05:24PM +0400, Voronkov Konstantin wrote:
> Hello All!
> 
> I have a problem when verifying a signature.
> What have I done wrong and why my stack breaks?
> 
> bool f(PCBYTE pSignature, int signatureSize,
> PCBYTE pModulus, int pModulusSize,
> PCBYTE pKey, int pKeySize,
> PCBYTE pMessage, int pMessageSize)
> {
>   StringSource signature(pSignature, signatureSize, true, new ByteQueue);
>   RSASSA_PKCS1v15_SHA_Verifier *ppub;
>   VerifierFilter *verifierFilter;
> 
>    ppub = new RSASSA_PKCS1v15_SHA_Verifier(Integer(pModulus, pModulusSize),
> Integer(pKey, pKeySize));
> 
>   if(signature.MaxRetrievable() != ppub->SignatureLength())
>   {
>    delete ppub;
>    return false;
>   }
>   SecByteBlock sb_signature(ppub->SignatureLength());
>   signature.Get(sb_signature, sb_signature.size);
>   verifierFilter = new VerifierFilter(*ppub);
>   verifierFilter->PutSignature(sb_signature);
> 
>   StringSource ss(pMessage, pMessageSize, true, verifierFilter);
>   byte result = 0;
>   ss.Get(result);
>   delete ppub;
>   return result == 1;
> }
> 
> 
> Regards,
> Voronkov Konstantin
> ICQ 40202717
> 
> 
> 

Reply via email to