On Wed, Jul 23, 2014 at 11:10:28AM -0400, Robert Heller wrote:

> What am I doing wrong?
> 
> [...]
>         EVP_DigestInit_ex(&mdctx,(const EVP_MD *)EVP_sha256,NULL);
> [...]
>     HMAC_Init_ex(ctx,paddedkey,KEYLEN,(const EVP_MD *)EVP_sha256,NULL);
> [...]

The cast to (const EVP_MD *) hides the bug from the compiler.
EVP_sha256 is a function!  The correct code is:

    HMAC_Init_ex(ctx, paddedkey, KEYLEN, EVP_sha256(), NULL);

-- 
        Viktor.
______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
User Support Mailing List                    openssl-users@openssl.org
Automated List Manager                           majord...@openssl.org

Reply via email to