Skip to content

Commit

Permalink
fixup! Make crypto.c compile/link with OpenSSL 3
Browse files Browse the repository at this point in the history
  • Loading branch information
ngie-eign committed May 12, 2023
1 parent f786a3b commit 2f08dd6
Showing 1 changed file with 4 additions and 10 deletions.
14 changes: 4 additions & 10 deletions crypto.c
Original file line number Diff line number Diff line change
Expand Up @@ -121,13 +121,7 @@ smtp_init_crypto(int fd, int feature, struct smtp_features* features)

/* XXX clean up on error/close */
/* Init SSL library */
#if (OPENSSL_VERSION_NUMBER >= 0x10100000L)
error = OPENSSL_init_ssl(0, NULL);
if (error != 1) {
syslog(LOG_WARNING, "remote delivery deferred: SSL init failed: %s", ssl_errstr());
return (1);
}
#else
#if (OPENSSL_VERSION_NUMBER < 0x10100000L)
SSL_library_init();
SSL_load_error_strings();
#endif
Expand Down Expand Up @@ -316,8 +310,8 @@ hmac_md5(unsigned char *text, int text_len, unsigned char *key, int key_len,
EVP_DigestFinal_ex(context, digest, NULL);

/**
* Perform outer MD5.
*/
* Perform outer MD5.
*/

/* Re-init context for second pass. */
EVP_DigestInit_ex(context, md, NULL);
Expand All @@ -338,7 +332,7 @@ hmac_md5(unsigned char *text, int text_len, unsigned char *key, int key_len,
MD5_Update(&context, k_ipad, 64); /* start with inner pad */
MD5_Update(&context, text, text_len); /* then text of datagram */

MD5_Final(digest, &context); /* finish up 1st pass */
MD5_Final(digest, &context); /* finish up 1st pass */
/*
* perform outer MD5
*/
Expand Down

0 comments on commit 2f08dd6

Please sign in to comment.