Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
freebsd
GitHub Repository: freebsd/freebsd-ports-kde
Path: blob/main/ftp/bbftp-server/files/patch-bbftpd__crypt.c
16462 views
1
--- bbftpd_crypt.c.orig 2004-06-30 17:38:50 UTC
2
+++ bbftpd_crypt.c
3
@@ -73,19 +73,25 @@ void sendcrypt()
4
unsigned char pubexponent[NBITSINKEY] ;
5
int lenkey ;
6
int lenexpo ;
7
+ BIGNUM *e = BN_new();
8
9
/*
10
** Ask for the private and public Key
11
*/
12
- if ( (myrsa = RSA_generate_key(NBITSINKEY,3,NULL,NULL)) == NULL) {
13
+ if (e == NULL || (BN_set_word(e,3) && RSA_generate_key_ex(myrsa,NBITSINKEY,e,NULL)) == 0) {
14
syslog(BBFTPD_ERR,"%s",ERR_error_string(ERR_get_error(),NULL) ) ;
15
exit(1) ;
16
}
17
/*
18
** Now extract the public key in order to send it
19
*/
20
+#if OPENSSL_VERSION_NUMBER < 0x10100000L
21
lenkey = BN_bn2mpi(myrsa->n,pubkey) ;
22
lenexpo = BN_bn2mpi(myrsa->e,pubexponent) ;
23
+#else
24
+ lenkey = BN_bn2mpi(RSA_get0_n(myrsa),pubkey) ;
25
+ lenexpo = BN_bn2mpi(RSA_get0_e(myrsa),pubexponent) ;
26
+#endif
27
mess = (struct message *) buf ;
28
mess->code = MSG_CRYPT ;
29
#ifndef WORDS_BIGENDIAN
30
31