Andreas Hoffmann wrote:
...
md_ctx = EVP_MD_CTX_create();
EVP_VerifyInit_ex(md_ctx, EVP_sha1(), NULL );
EVP_VerifyUpdate(md_ctx, data, data_length);
sig_err = EVP_VerifyFinal(md_ctx, signature, signature_length, pkey);

if (sig_err == -1) {
       printf("An error occured while verifying the signature!\n");
       ERR_print_errors_fp (stderr);
       exit(1);
}
else if (sig_err == 0) {
       printf("The signature does not match the data\n");
       ERR_print_errors_fp (stderr);
       exit(1);
}
else {
       printf("OK - The signature does match the data\n");
}


But the result is always "signature does not match" - although it should.
The errors are:
9876:error:0D07209B:asn1 encoding routines:ASN1_get_object:too long:asn1_lib.c:132:
9876:error:0D068066:asn1 encoding routines:ASN1_CHECK_TLEN:bad object header:tasn_dec.c:935:
9876:error:0D07803A:asn1 encoding routines:ASN1_ITEM_EX_D2I:nested asn1 error:tasn_dec.c:304:Type=X509_SIG

what's in "signature" ?

Nils
______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
User Support Mailing List                    openssl-users@openssl.org
Automated List Manager                           [EMAIL PROTECTED]

Reply via email to