aboutsummaryrefslogtreecommitdiff
path: root/security/cyrus-sasl2
diff options
context:
space:
mode:
authorHajimu UMEMOTO <ume@FreeBSD.org>2018-10-06 04:39:47 +0000
committerHajimu UMEMOTO <ume@FreeBSD.org>2018-10-06 04:39:47 +0000
commite01dcf134a923ccc25b968bea04da6dec2f9b744 (patch)
treec5e83875d4b2793be018e72adb8e9500238d6558 /security/cyrus-sasl2
parent30c1eda7b040b4bf4997be38465ca64df1aaab62 (diff)
downloadports-e01dcf134a923ccc25b968bea04da6dec2f9b744.tar.gz
ports-e01dcf134a923ccc25b968bea04da6dec2f9b744.zip
Fix build the saslauthd when the OPENLDAP option is enabled.
PR: 231871 Reported by: Nathan <ndowens [...] yahoo.com>
Notes
Notes: svn path=/head/; revision=481315
Diffstat (limited to 'security/cyrus-sasl2')
-rw-r--r--security/cyrus-sasl2/files/patch-saslauthd_lak.c45
1 files changed, 41 insertions, 4 deletions
diff --git a/security/cyrus-sasl2/files/patch-saslauthd_lak.c b/security/cyrus-sasl2/files/patch-saslauthd_lak.c
index 3c786230b35d..f489a231581f 100644
--- a/security/cyrus-sasl2/files/patch-saslauthd_lak.c
+++ b/security/cyrus-sasl2/files/patch-saslauthd_lak.c
@@ -1,16 +1,53 @@
--- saslauthd/lak.c.orig 2012-10-12 14:05:48 UTC
+++ saslauthd/lak.c
-@@ -53,6 +53,9 @@
+@@ -53,6 +53,46 @@
#endif
#include <openssl/evp.h>
#include <openssl/des.h>
+
+/* for legacy libcrypto support */
+#include "crypto-compat.h"
++
++#if defined(HAVE_OPENSSL) && (OPENSSL_VERSION_NUMBER < 0x10100000L)
++
++#include <openssl/engine.h>
++
++static void *OPENSSL_zalloc(size_t num)
++{
++ void *ret = OPENSSL_malloc(num);
++
++ if (ret != NULL)
++ memset(ret, 0, num);
++ return ret;
++}
++
++EVP_MD_CTX *EVP_MD_CTX_new(void)
++{
++ return OPENSSL_zalloc(sizeof(EVP_MD_CTX));
++}
++
++void EVP_MD_CTX_free(EVP_MD_CTX *ctx)
++{
++ EVP_MD_CTX_cleanup(ctx);
++ OPENSSL_free(ctx);
++}
++
++EVP_ENCODE_CTX *EVP_ENCODE_CTX_new(void)
++{
++ return OPENSSL_zalloc(sizeof(EVP_ENCODE_CTX));
++}
++
++void EVP_ENCODE_CTX_free(EVP_ENCODE_CTX *ctx)
++{
++ OPENSSL_free(ctx);
++}
++
++#endif /* HAVE_OPENSSL && OPENSSL_VERSION_NUMBER */
++
#endif
#define LDAP_DEPRECATED 1
-@@ -1715,20 +1718,28 @@ static int lak_base64_decode(
+@@ -1715,20 +1755,28 @@ static int lak_base64_decode(
int rc, i, tlen = 0;
char *text;
@@ -44,7 +81,7 @@
*ret = text;
if (rlen != NULL)
-@@ -1744,7 +1755,7 @@ static int lak_check_hashed(
+@@ -1744,7 +1792,7 @@ static int lak_check_hashed(
{
int rc, clen;
LAK_HASH_ROCK *hrock = (LAK_HASH_ROCK *) rock;
@@ -53,7 +90,7 @@
const EVP_MD *md;
unsigned char digest[EVP_MAX_MD_SIZE];
char *cred;
-@@ -1753,17 +1764,24 @@ static int lak_check_hashed(
+@@ -1753,17 +1801,24 @@ static int lak_check_hashed(
if (!md)
return LAK_FAIL;