2011/5/4 Prashant Batra <prashant0...@gmail.com>:
> http://pastebin.com/0BG97RDH
> This does not contain complete source code, but will definitely give you the
> idea about what I am trying to do.
After a quick look, it does not appear there is enough code to say
what is wrong. For example, you perform:
    (key->v)[0]=0x20;
yet there is no definition for syfer_vchar_t.

In HASHAlgSha1::InitializeContext, and presuming hash_key is a good
pointer (and hash_key->v and hash_key->l are valid), I believe the
code should work as expected. I would guess the problem lies elsewhere
in your code.

Also, you appear to ignore return values. It would probably be a good
idea to verify functions such as HMAC_CTX_init. See
http://www.openssl.org/docs/crypto/hmac.html.

Jeff

>
> On Wed, May 4, 2011 at 4:38 PM, derleader mail <derlea...@abv.bg> wrote:
>>
>> Hi all,
>> I am finding a strange problem with HMAC_Init_ex.
>> After the call to this function the stack is getting corrupted.
>> The sequence of functions used are-
>> HMAC_CTX ctx ;
>> HMAC_CTX_init(&ctx);
>> HMAC_Init_ex(&ctx, hash_key->v, hash_key->l, EVP_sha1(), NULL);
>> Key->v points to 20 bytes of memory, while key->l is 20.
>> Are there some necessary pre-requisites to this?
>> Can anyone help?
>> Thanks,
>> Prashant
>>
>>
>> Hi,
>>    Let us see the complete source code to see where is the problem.
>> Paste it into http://pastebin.com/
>>
>> Regards
>>
>> [SNIP]
______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
User Support Mailing List                    openssl-users@openssl.org
Automated List Manager                           majord...@openssl.org

Reply via email to