Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 1 Feb 2021 02:30:40 +0000 (UTC)
From:      Alexey Dokuchaev <danfe@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r563542 - in head/ftp/bbftp-server: . files
Message-ID:  <202102010230.1112Ue1U092624@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: danfe
Date: Mon Feb  1 02:30:39 2021
New Revision: 563542
URL: https://svnweb.freebsd.org/changeset/ports/563542

Log:
  - 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

Modified:
  head/ftp/bbftp-server/Makefile
  head/ftp/bbftp-server/files/patch-bbftpd.c
  head/ftp/bbftp-server/files/patch-bbftpd__crypt.c

Modified: head/ftp/bbftp-server/Makefile
==============================================================================
--- head/ftp/bbftp-server/Makefile	Mon Feb  1 02:26:28 2021	(r563541)
+++ head/ftp/bbftp-server/Makefile	Mon Feb  1 02:30:39 2021	(r563542)
@@ -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

Modified: head/ftp/bbftp-server/files/patch-bbftpd.c
==============================================================================
--- head/ftp/bbftp-server/files/patch-bbftpd.c	Mon Feb  1 02:26:28 2021	(r563541)
+++ head/ftp/bbftp-server/files/patch-bbftpd.c	Mon Feb  1 02:30:39 2021	(r563542)
@@ -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

Modified: head/ftp/bbftp-server/files/patch-bbftpd__crypt.c
==============================================================================
--- head/ftp/bbftp-server/files/patch-bbftpd__crypt.c	Mon Feb  1 02:26:28 2021	(r563541)
+++ head/ftp/bbftp-server/files/patch-bbftpd__crypt.c	Mon Feb  1 02:30:39 2021	(r563542)
@@ -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
      */



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202102010230.1112Ue1U092624>