aboutsummaryrefslogtreecommitdiff
path: root/sysutils/rsyncrypto
diff options
context:
space:
mode:
authorAlexey Dokuchaev <danfe@FreeBSD.org>2020-07-28 06:29:12 +0000
committerAlexey Dokuchaev <danfe@FreeBSD.org>2020-07-28 06:29:12 +0000
commit241522286abcc2b6860715dcc6e59593d24bae99 (patch)
tree271ef6e545e17aa2fb0b35f858df3de7ab99d839 /sysutils/rsyncrypto
parent5a1ed1e399eed69e2ac20a77f1bfc0a47d6638a5 (diff)
downloadports-241522286abcc2b6860715dcc6e59593d24bae99.tar.gz
ports-241522286abcc2b6860715dcc6e59593d24bae99.zip
Notes
Diffstat (limited to 'sysutils/rsyncrypto')
-rw-r--r--sysutils/rsyncrypto/Makefile4
-rw-r--r--sysutils/rsyncrypto/files/patch-crypto.cpp16
2 files changed, 20 insertions, 0 deletions
diff --git a/sysutils/rsyncrypto/Makefile b/sysutils/rsyncrypto/Makefile
index 86ea9179e82f..dbd492d2857b 100644
--- a/sysutils/rsyncrypto/Makefile
+++ b/sysutils/rsyncrypto/Makefile
@@ -25,6 +25,10 @@ PORTDOCS= AUTHORS ChangeLog NEWS README
OPTIONS_DEFINE= DOCS
+post-patch:
+# Inhibit the check for RSA_get0_factors() to support older OpenSSL versions
+ @${REINPLACE_CMD} -e '/RSA_get0_factors/,+49d' ${WRKSRC}/configure
+
post-install-DOCS-on:
@${MKDIR} ${STAGEDIR}${DOCSDIR}
${INSTALL_DATA} ${PORTDOCS:S,^,${WRKSRC}/,} ${STAGEDIR}${DOCSDIR}
diff --git a/sysutils/rsyncrypto/files/patch-crypto.cpp b/sysutils/rsyncrypto/files/patch-crypto.cpp
new file mode 100644
index 000000000000..1a6d439b2298
--- /dev/null
+++ b/sysutils/rsyncrypto/files/patch-crypto.cpp
@@ -0,0 +1,16 @@
+--- crypto.cpp.orig 2016-11-11 20:23:00 UTC
++++ crypto.cpp
+@@ -155,9 +155,13 @@ std::unique_ptr<key> decrypt_header( file_t fromfd, RS
+ unsigned char *buff=filemap.get_uc()+sizeof(HEADER_ENCRYPTION_VERSION);
+ auto_array<unsigned char> decrypted(new unsigned char[headsize]);
+
++#if OPENSSL_VERSION_NUMBER < 0x10100000L
++ if( (prv->p==nullptr || prv->q==nullptr) ) {
++#else
+ const BIGNUM *p, *q;
+ RSA_get0_factors(prv, &p, &q);
+ if( (p==nullptr || q==nullptr) ) {
++#endif
+ // This is not a private key!
+ throw rscerror("Neither AES session key nor RSA private key present - cannot decrypt using only public key");
+ }