Hi 

I am using RSA_verify to verify that the signiture that I am getting
with a message is correct
The process that I am using is as follows.

Get the user public key from file and put it in a RSA structure
ERR_print_errors returns no error
Get Server private key from file and put in another RSA structure  
(I know it is not used verify but I want to sign late too)
ERR_print_errors returns no error

Read the signed message digest from disk and decode (pASN1-> ... used
later)
ERR_print_errors returns no error

Create a digest of the data using (digest used EVP_sha1()) - (hard coded
string for testing)
EVP_DigestInit
EVP_DigestUpdate
EVP_DigestFinal

ERR_print_errors returns no error

RSA_verify(NID_sha1, (unsigned char *) &md, len_md, pASN1->data,
pASN1->length, PubRsaKey); - 
failed : returns 0
ERR_print_errors returns 
6114:error:0407006A:rsa routines:RSA_padding_check_PKCS1_type_1:block
type is not 01:rsa_pk1.c:100:
6114:error:04067072:rsa routines:RSA_EAY_PUBLIC_DECRYPT:padding check
failed:rsa_eay.c:396:

All data read from disk is from a MS client encoded using
CryptEncodeObject.
All data is read and decoded (d2i finctions) without reported error

Please advise on what action I need to take to resolve this or what the
problem(s) could be.

My app is not too large and is attached for additional info.

Hylton Tregenza

Attachment: z.cpp
Description: z.cpp

Reply via email to