Skip to content

Commit

Permalink
Merge pull request #7 from neheb/patch-1
Browse files Browse the repository at this point in the history
Fix compilation without deprecated OpenSSL APIs
  • Loading branch information
zhao-gang authored Nov 25, 2018
2 parents b59d754 + 68a5904 commit f269510
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions crypto.c
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,11 @@ int get_method(char *password, char *method)

int crypto_init(char *password, char *method)
{
#if OPENSSL_VERSION_NUMBER < 0x10100000L
ERR_load_crypto_strings();
OpenSSL_add_all_algorithms();
OPENSSL_config(NULL);
#endif

if (get_method(password, method) == -1)
return -1;
Expand All @@ -83,8 +85,10 @@ int crypto_init(char *password, char *method)

void crypto_exit(void)
{
#if OPENSSL_VERSION_NUMBER < 0x10100000L
EVP_cleanup();
ERR_free_strings();
#endif
}

int add_iv(int sockfd, struct link *ln)
Expand Down

0 comments on commit f269510

Please sign in to comment.