L.S.

I'm having a problem using DSA_verify. The actual call in my C program (including some context), the results on stdout and lookup of the meaning of openssl error codes are given below. I still cannot conclude from the "meaning" of the error messages what I've done wrong. My initial guess was that some input (hash, sig, ..) has a bad size, but I can't think of which input that could be.

Can any body please help me to find what's wrong

Thanks in advance,

Erik Leunissen
==============


Usage of DSA_verify()
---------------------
Note: all references to $dsa(XXX) have been replaced by their corresponding values. I've shown a template code file for reasons of readability.


        int result;
        DSA *dsa;
        dsa = DSA_new();
        if (BN_hex2bn(&dsa->p, "$dsa(p)") == 0) {
                result = -1;
                goto end;
        }
        if (BN_hex2bn(&dsa->q, "$dsa(q)") == 0) {
                result = -1;
                goto end;
        }
        if (BN_hex2bn(&dsa->g, "$dsa(g)") == 0) {
                result = -1;
                goto end;
        }
        if (BN_hex2bn(&dsa->pub_key, "$dsa(pub_key)") == 0) {
                result = -1;
                goto end;
        }
        print_hex(hash, 20);
        print_hex(sig, 20);
==>  result = DSA_verify(NID_sha1, hash, 20, \
                        sig, 20, dsa);
        if (result == -1) {
                ERR_print_errors_fp(stderr);
        }



Output (stdout) and meaning of error messages
---------------------------------------------

b4367b5daa2a5c457cd31689531c06754ed44c02
302d021500994c418cf2e579276a6b088ad354d8
5529:error:0D07209B:lib(13):func(114):reason(155):asn1_lib.c:132:
5529:error:0D068066:lib(13):func(104):reason(102):tasn_dec.c:935:
5529:error:0D07803A:lib(13):func(120):reason(58):tasn_dec.c:304:Type=DSA_SIG

Looking up the meaning of the error codes, using openssl errstr <errCode>, gives:

error:0D07209B:asn1 encoding routines:ASN1_get_object:too long
error:0D068066:asn1 encoding routines:ASN1_CHECK_TLEN:bad object header
error:0D07803A:asn1 encoding routines:ASN1_ITEM_EX_D2I:nested asn1 error

== end of message ==

______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
User Support Mailing List                    [email protected]
Automated List Manager                           [EMAIL PROTECTED]

Reply via email to