1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-11-24 00:45:52 +00:00

- 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
This commit is contained in:
Alexey Dokuchaev 2021-02-01 02:30:39 +00:00
parent dae6c0bb07
commit b37a13c322
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=563542
3 changed files with 24 additions and 14 deletions

View File

@ -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

View File

@ -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

View File

@ -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
*/