EVP_get_digestbyname returns null

#17 · open · 1 comments

View on GitHub ↗

axtux

When I run the software on Ubuntu 18.04, I get this error message: ``` Cannot initialize the default message digest sha256, aborting ``` Following the Linux Die manual at [https://linux.die.net/man/3/evp_get_digestbyname](https://linux.die.net/man/3/evp_get_digestbyname): > EVP_get_digestbyname(), EVP_get_digestbynid() and EVP_get_digestbyobj() return an EVP_MD structure when passed a digest name, a digest NID or an ASN1_OBJECT structure respectively. The digest table must be initialized using, for example, OpenSSL_add_all_digests() for these functions to work. Following the instructions from the manual, I added `OpenSSL_add_all_digests();` before line `203` in `main.c` and it works. I'll open a PR when I have time.

Comments

jarryxy

Your code needs to add **OpenSSL_add_all_digests ()** in main.c; Otherwise, EVP_get_digestbyname () will return as a NULL pointer. Causes the program to fail to run normally.