summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Marino <marino@FreeBSD.org>2016-09-12 02:20:51 +0000
committerJohn Marino <marino@FreeBSD.org>2016-09-12 02:20:51 +0000
commit08844172299177bc170813c60492b8a1c1b95480 (patch)
tree73065ab7ce24706807b10f44b9ceb032323b199e
parent- Update to 4.036 (diff)
net-mgmt/snmp++: Document SSL build requirement, patch for LibreSSL
This allows for ports SSL libraries to be used for the build, including LibreSSL ports. Approved by: SSL blanket
Notes
Notes: svn path=/head/; revision=421896
-rw-r--r--net-mgmt/snmp++/Makefile4
-rw-r--r--net-mgmt/snmp++/files/Makefile.FreeBSD2
-rw-r--r--net-mgmt/snmp++/files/patch-auth__priv.cpp125
3 files changed, 128 insertions, 3 deletions
diff --git a/net-mgmt/snmp++/Makefile b/net-mgmt/snmp++/Makefile
index 8784aa29797e..33dfe0931ce6 100644
--- a/net-mgmt/snmp++/Makefile
+++ b/net-mgmt/snmp++/Makefile
@@ -13,9 +13,9 @@ COMMENT= SNMP C++ library with V3 support
MAKEFILE= Makefile.FreeBSD
WRKSRC= ${WRKDIR}/${PORTNAME}/src
-USES= gmake
+USES= gmake ssl:build
USE_LDCONFIG= yes
-MAKE_ARGS= CC="${CXX}"
+MAKE_ARGS= CC="${CXX}" PORTOPTS="-I${OPENSSLINC} -L${OPENSSLLIB}"
post-extract:
${CP} ${FILESDIR}/Makefile.FreeBSD ${WRKSRC}
diff --git a/net-mgmt/snmp++/files/Makefile.FreeBSD b/net-mgmt/snmp++/files/Makefile.FreeBSD
index c46e313e08d0..43d07cc38d82 100644
--- a/net-mgmt/snmp++/files/Makefile.FreeBSD
+++ b/net-mgmt/snmp++/files/Makefile.FreeBSD
@@ -35,7 +35,7 @@ COPTIONS = -D_XPG4_EXTENDED -D__unix -Wall -D_USE_OPENSSL# -DHEADER_DES_LOCL_H #
TEMPOPTS = -I.
USEROPTS = -g
-CFLAGS = $(COPTIONS) $(CINCDIRS) $(USEROPTS)
+CFLAGS = $(COPTIONS) $(CINCDIRS) $(USEROPTS) $(PORTOPTS)
LDFLAGS = $(CFLAGS)
SHARED = -fPIC -shared
diff --git a/net-mgmt/snmp++/files/patch-auth__priv.cpp b/net-mgmt/snmp++/files/patch-auth__priv.cpp
new file mode 100644
index 000000000000..5fe67e8c0f47
--- /dev/null
+++ b/net-mgmt/snmp++/files/patch-auth__priv.cpp
@@ -0,0 +1,125 @@
+--- auth_priv.cpp.orig 2016-04-15 19:57:59 UTC
++++ auth_priv.cpp
+@@ -89,34 +89,34 @@ typedef MD5_CTX MD5HashSta
+ #define MD5_PROCESS(s, p, l) MD5_Update(s, p, l)
+ #define MD5_DONE(s, k) MD5_Final(k, s)
+
+-typedef des_key_schedule DESCBCType;
++typedef DES_key_schedule DESCBCType;
+ #define DES_CBC_START_ENCRYPT(c, iv, k, kl, r, s) \
+- if (des_key_sched((C_Block*)(k), s) < 0) \
++ if (DES_key_sched((DES_cblock*)(k), &s) < 0) \
+ { \
+ debugprintf(0, "Starting DES encryption failed."); \
+ return SNMPv3_USM_ERROR; \
+ }
+ #define DES_CBC_START_DECRYPT(c, iv, k, kl, r, s) \
+- if (des_key_sched((C_Block*)(k), s) < 0) \
++ if (DES_key_sched((DES_cblock*)(k), &s) < 0) \
+ { \
+ debugprintf(0, "Starting DES decryption failed."); \
+ return SNMPv3_USM_ERROR; \
+ }
+
+ #define DES_CBC_ENCRYPT(pt, ct, s, iv, l) \
+- des_ncbc_encrypt(pt, ct, l, \
+- s, (C_Block*)(iv), DES_ENCRYPT)
++ DES_ncbc_encrypt(pt, ct, l, \
++ &s, (DES_cblock*)(iv), DES_ENCRYPT)
+ #define DES_CBC_DECRYPT(ct, pt, s, iv, l) \
+- des_ncbc_encrypt(ct, pt, l, \
+- s, (C_Block*)(iv), DES_DECRYPT)
++ DES_ncbc_encrypt(ct, pt, l, \
++ &s, (DES_cblock*)(iv), DES_DECRYPT)
+
+ #define DES_EDE3_CBC_ENCRYPT(pt, ct, l, k1, k2, k3, iv) \
+- des_ede3_cbc_encrypt(pt, ct, l, \
+- k1, k2, k3, (C_Block*)(iv), DES_ENCRYPT)
++ DES_ede3_cbc_encrypt(pt, ct, l, \
++ k1, k2, k3, (DES_cblock*)(iv), DES_ENCRYPT)
+
+ #define DES_EDE3_CBC_DECRYPT(ct, pt, l, k1, k2, k3, iv) \
+- des_ede3_cbc_encrypt(ct, pt, l, \
+- k1, k2, k3, (C_Block*)(iv), DES_DECRYPT)
++ DES_ede3_cbc_encrypt(ct, pt, l, \
++ k1, k2, k3, (DES_cblock*)(iv), DES_DECRYPT)
+
+ #define DES_MEMSET(s, c, l) memset(&(s), c, l)
+
+@@ -182,12 +182,12 @@ typedef MD5_CTX MD5HashSta
+ #define MD5_DONE(s, k) MD5Final(k, s)
+
+ #define DES_EDE3_CBC_ENCRYPT(pt, ct, l, k1, k2, k3, iv) \
+- des_ede3_cbc_encrypt((C_Block*)(pt), (C_Block*)(ct), l, \
+- k1, k2, k3, (C_Block*)(iv), DES_ENCRYPT)
++ DES_ede3_cbc_encrypt((DES_cblock*)(pt), (DES_cblock*)(ct), l, \
++ k1, k2, k3, (DES_cblock*)(iv), DES_ENCRYPT)
+
+ #define DES_EDE3_CBC_DECRYPT(ct, pt, l, k1, k2, k3, iv) \
+- des_ede3_cbc_encrypt((C_Block*)(ct), (C_Block*)(pt), l, \
+- k1, k2, k3, (C_Block*)(iv), DES_DECRYPT)
++ DES_ede3_cbc_encrypt((DES_cblock*)(ct), (DES_cblock*)(pt), l, \
++ k1, k2, k3, (DES_cblock*)(iv), DES_DECRYPT)
+
+ #ifdef RSAEURO
+
+@@ -205,26 +205,26 @@ typedef DES_CBC_CTX DESCBCType
+
+ #else // RSAEURO
+
+-typedef des_key_schedule DESCBCType;
++typedef DES_key_schedule DESCBCType;
+ #define DES_CBC_START_ENCRYPT(c, iv, k, kl, r, s) \
+- if (des_key_sched((C_Block*)(k), s) < 0) \
++ if (DES_key_sched((DES_cblock*)(k), &s) < 0) \
+ { \
+ debugprintf(0, "Starting DES encryption failed."); \
+ return SNMPv3_USM_ERROR; \
+ }
+ #define DES_CBC_START_DECRYPT(c, iv, k, kl, r, s) \
+- if (des_key_sched((C_Block*)(k), s) < 0) \
++ if (DES_key_sched((DES_cblock*)(k), &s) < 0) \
+ { \
+ debugprintf(0, "Starting DES decryption failed."); \
+ return SNMPv3_USM_ERROR; \
+ }
+
+ #define DES_CBC_ENCRYPT(pt, ct, s, iv, l) \
+- des_ncbc_encrypt((C_Block*)(pt), (C_Block*)(ct), l, \
+- s, (C_Block*)(iv), DES_ENCRYPT)
++ DES_ncbc_encrypt((DES_cblock*)(pt), (DES_cblock*)(ct), l, \
++ &s, (DES_cblock*)(iv), DES_ENCRYPT)
+ #define DES_CBC_DECRYPT(ct, pt, s, iv, l) \
+- des_ncbc_encrypt((C_Block*)(ct), (C_Block*)(pt), l, \
+- s, (C_Block*)(iv), DES_DECRYPT)
++ DES_ncbc_encrypt((DES_cblock*)(ct), (DES_cblock*)(pt), l, \
++ &s, (DES_cblock*)(iv), DES_DECRYPT)
+ #define DES_MEMSET(s, c, l) memset(&(s), c, l)
+
+ /* -- END: Defines for libdes -- */
+@@ -1939,9 +1939,9 @@ Priv3DES_EDE::encrypt(const unsigned cha
+ #else
+ DESCBCType ks1, ks2, ks3;
+
+- if ((des_key_sched((C_Block*)(key), ks1) < 0) ||
+- (des_key_sched((C_Block*)(key +8), ks2) < 0) ||
+- (des_key_sched((C_Block*)(key +16), ks3) < 0))
++ if ((DES_key_sched((DES_cblock*)(key), &ks1) < 0) ||
++ (DES_key_sched((DES_cblock*)(key +8), &ks2) < 0) ||
++ (DES_key_sched((DES_cblock*)(key +16), &ks3) < 0))
+ {
+ debugprintf(0, "Starting 3DES-EDE encryption failed.");
+ return SNMPv3_USM_ERROR;
+@@ -2028,9 +2028,9 @@ Priv3DES_EDE::decrypt(const unsigned cha
+ #else
+ DESCBCType ks1, ks2, ks3;
+
+- if ((des_key_sched((C_Block*)(key), ks1) < 0) ||
+- (des_key_sched((C_Block*)(key+8), ks2) < 0) ||
+- (des_key_sched((C_Block*)(key+16), ks3) < 0))
++ if ((DES_key_sched((C_Block*)(key), &ks1) < 0) ||
++ (DES_key_sched((C_Block*)(key+8), &ks2) < 0) ||
++ (DES_key_sched((C_Block*)(key+16), &ks3) < 0))
+ {
+ debugprintf(0, "Starting 3DES-EDE decryption failed.");
+ return SNMPv3_USM_ERROR;