aboutsummaryrefslogtreecommitdiff
path: root/ftp
diff options
context:
space:
mode:
authorAlexey Dokuchaev <danfe@FreeBSD.org>2021-02-01 02:30:39 +0000
committerAlexey Dokuchaev <danfe@FreeBSD.org>2021-02-01 02:30:39 +0000
commitb37a13c3228c8a0de70d32da051c2d2fcfd861ed (patch)
tree679d31956a24aa084640a15339e092f867aa813a /ftp
parentdae6c0bb079336edab81eb1b2d919aa0c3124120 (diff)
downloadports-b37a13c3228c8a0de70d32da051c2d2fcfd861ed.tar.gz
ports-b37a13c3228c8a0de70d32da051c2d2fcfd861ed.zip
- Use a better way to deal with deprecated ERR_load_crypto_strings()
function by #includ'ing <openssl/err.h> header which already takes the proper care of it - Move away from using another deprecated RSA_generate_key() function - Apply the same hack as for the client port so it dynamically links against libcrypto.so, rather than statically against libcrypto.a
Notes
Notes: svn path=/head/; revision=563542
Diffstat (limited to 'ftp')
-rw-r--r--ftp/bbftp-server/Makefile2
-rw-r--r--ftp/bbftp-server/files/patch-bbftpd.c21
-rw-r--r--ftp/bbftp-server/files/patch-bbftpd__crypt.c15
3 files changed, 24 insertions, 14 deletions
diff --git a/ftp/bbftp-server/Makefile b/ftp/bbftp-server/Makefile
index 7afe5cf96750..46167394f9ad 100644
--- a/ftp/bbftp-server/Makefile
+++ b/ftp/bbftp-server/Makefile
@@ -23,6 +23,8 @@ OPTIONS_DEFINE= DOCS
post-patch:
@${REINPLACE_CMD} -e '/^#include/s,malloc,stdlib,' \
${WRKSRC}/bbftpd_cd.c ${WRKSRC}/bbftpd_statfs.c
+ @${REINPLACE_CMD} -e '/with_ssl\/lib\/libcrypto/s,\.a,.so,' \
+ ${WRKSRC}/${CONFIGURE_SCRIPT}
do-install:
${INSTALL_PROGRAM} ${WRKSRC}/bbftpd ${STAGEDIR}${PREFIX}/bin
diff --git a/ftp/bbftp-server/files/patch-bbftpd.c b/ftp/bbftp-server/files/patch-bbftpd.c
index 5fc376daee1a..661563641c24 100644
--- a/ftp/bbftp-server/files/patch-bbftpd.c
+++ b/ftp/bbftp-server/files/patch-bbftpd.c
@@ -1,15 +1,10 @@
--- bbftpd.c.orig 2005-05-03 08:43:34 UTC
+++ bbftpd.c
-@@ -842,10 +842,12 @@ main (argc,argv,envp)
- char buffrand[NBITSINKEY] ;
- struct timeval tp ;
- unsigned int seed ;
-+#if OPENSSL_VERSION_NUMBER < 0x10100000L
- /*
- ** Load the error message from the crypto lib
- */
- ERR_load_crypto_strings() ;
-+#endif
- /*
- ** Initialize the buffrand buffer which is giong to be used to initialize the
- ** random generator
+@@ -104,6 +104,7 @@
+ #include <byteswap.h>
+ #endif
+
++#include <openssl/err.h>
+ #include <openssl/rsa.h>
+
+ #ifdef WITH_GZIP
diff --git a/ftp/bbftp-server/files/patch-bbftpd__crypt.c b/ftp/bbftp-server/files/patch-bbftpd__crypt.c
index be464b9c7e45..e9a96cf8f852 100644
--- a/ftp/bbftp-server/files/patch-bbftpd__crypt.c
+++ b/ftp/bbftp-server/files/patch-bbftpd__crypt.c
@@ -1,6 +1,19 @@
--- bbftpd_crypt.c.orig 2004-06-30 17:38:50 UTC
+++ bbftpd_crypt.c
-@@ -84,8 +84,13 @@ void sendcrypt()
+@@ -73,19 +73,25 @@ void sendcrypt()
+ unsigned char pubexponent[NBITSINKEY] ;
+ int lenkey ;
+ int lenexpo ;
++ BIGNUM *e = BN_new();
+
+ /*
+ ** Ask for the private and public Key
+ */
+- if ( (myrsa = RSA_generate_key(NBITSINKEY,3,NULL,NULL)) == NULL) {
++ if (e == NULL || (BN_set_word(e,3) && RSA_generate_key_ex(myrsa,NBITSINKEY,e,NULL)) == 0) {
+ syslog(BBFTPD_ERR,"%s",ERR_error_string(ERR_get_error(),NULL) ) ;
+ exit(1) ;
+ }
/*
** Now extract the public key in order to send it
*/