Thanks Tom

Added OpenSSL_add_all_digests()
It is working


From: owner-openssl-us...@openssl.org [mailto:owner-openssl-us...@openssl.org] 
On Behalf Of Tom marchand
Sent: Saturday, August 10, 2013 5:25 AM
To: openssl-users@openssl.org
Subject: Re: Issue facing while using function "const EVP_MD 
*EVP_get_digestbyname(const char *name)"

Do you have to call OpenSSL_add_all_digests() first?


On Aug 9, 2013, at 7:17 PM, Sanjay Kumar (sanjaku5) wrote:


Hello All,

I have a test program to use the function EVP_get_digestbyname as below

I am not able figure out why function  "EVP_get_digestbyname"  return NULL ?

After running the program as below I am getting the print "md is NULL"

Any help ?


#include <stdio.h>
#include <openssl/evp.h>

int main(int argc, char *argv[])
{
  const EVP_MD *md;
  const  char *hash_type = "SHA1";

  md = EVP_get_digestbyname(hash_type);
  if(md == NULL)
  {
    printf("\n md is NULL\n");
  }
  return 0;
}

Compilation:
cc test.c -lcrypto

Running:
./a.out
md is NULL


Thanks,
Sanjay



Reply via email to