Path: blob/main/ftp/bbftp-server/files/patch-bbftpd__crypt.c
16462 views
--- bbftpd_crypt.c.orig 2004-06-30 17:38:50 UTC1+++ bbftpd_crypt.c2@@ -73,19 +73,25 @@ void sendcrypt()3unsigned char pubexponent[NBITSINKEY] ;4int lenkey ;5int lenexpo ;6+ BIGNUM *e = BN_new();78/*9** Ask for the private and public Key10*/11- if ( (myrsa = RSA_generate_key(NBITSINKEY,3,NULL,NULL)) == NULL) {12+ if (e == NULL || (BN_set_word(e,3) && RSA_generate_key_ex(myrsa,NBITSINKEY,e,NULL)) == 0) {13syslog(BBFTPD_ERR,"%s",ERR_error_string(ERR_get_error(),NULL) ) ;14exit(1) ;15}16/*17** Now extract the public key in order to send it18*/19+#if OPENSSL_VERSION_NUMBER < 0x10100000L20lenkey = BN_bn2mpi(myrsa->n,pubkey) ;21lenexpo = BN_bn2mpi(myrsa->e,pubexponent) ;22+#else23+ lenkey = BN_bn2mpi(RSA_get0_n(myrsa),pubkey) ;24+ lenexpo = BN_bn2mpi(RSA_get0_e(myrsa),pubexponent) ;25+#endif26mess = (struct message *) buf ;27mess->code = MSG_CRYPT ;28#ifndef WORDS_BIGENDIAN293031