FTP build support for m241 (#97)

Co-authored-by: neelimap <neelimaps@neominds.in>
Reviewed-on: http://13.234.246.121:3000/Neominds/ossl35vx69/pulls/97
Co-authored-by: Neelima P S <neelima.ps@neominds.in>
Co-committed-by: Neelima P S <neelima.ps@neominds.in>
This commit is contained in:
2026-07-30 20:48:01 +05:30
committed by neelimap
co-authored by neelimap
parent 3ded5de19e
commit 0a1429e9fe
2 changed files with 48 additions and 15 deletions
+47 -13
View File
@@ -27,7 +27,6 @@
#include "ipftps_config.h"
#define IPCOM_USE_CLIB_PROTO
#include <ipcom_clib.h>
#include <ipcom_clib2.h>
#include <ipcom_err.h>
@@ -77,19 +76,36 @@ IP_STATIC DH *get_dh512(void)
0x02,
};
DH *dh;
BIGNUM *p = NULL;
BIGNUM *g = NULL;
if ((dh=DH_new()) == IP_NULL)
{
return IP_NULL;
}
dh->p=BN_bin2bn(dh512_p,sizeof(dh512_p),IP_NULL);
dh->g=BN_bin2bn(dh512_g,sizeof(dh512_g),IP_NULL);
p = BN_bin2bn(dh512_p, sizeof(dh512_p), IP_NULL);
g = BN_bin2bn(dh512_g, sizeof(dh512_g), IP_NULL);
if ((dh->p == IP_NULL) || (dh->g == IP_NULL))
if ((p == IP_NULL) || (g == IP_NULL))
{
DH_free(dh);
return IP_NULL;
}
DH_free(dh);
if (p)
BN_free(p);
if (g)
BN_free(g);
return IP_NULL;
}
if (DH_set0_pqg(dh, p, NULL, g) != 1)
{
DH_free(dh);
if (p)
BN_free(p);
if (g)
BN_free(g);
return IP_NULL;
}
return dh;
}
@@ -112,20 +128,38 @@ IP_STATIC DH *get_dh1024(void)
0x02,
};
DH *dh;
BIGNUM *p = NULL;
BIGNUM *g = NULL;
if ((dh=DH_new()) == IP_NULL)
{
return IP_NULL;
}
dh->p=BN_bin2bn(dh1024_p,sizeof(dh1024_p),IP_NULL);
dh->g=BN_bin2bn(dh1024_g,sizeof(dh1024_g),IP_NULL);
p = BN_bin2bn(dh1024_p, sizeof(dh1024_p), IP_NULL);
g = BN_bin2bn(dh1024_g, sizeof(dh1024_g), IP_NULL);
if ((dh->p == IP_NULL) || (dh->g == IP_NULL))
if ((p == IP_NULL) || (g == IP_NULL))
{
DH_free(dh);
return IP_NULL;
}
DH_free(dh);
if (p)
BN_free(p);
if (g)
BN_free(g);
return IP_NULL;
}
if (DH_set0_pqg(dh, p, NULL, g) != 1)
{
DH_free(dh);
if (p)
BN_free(p);
if (g)
BN_free(g);
return IP_NULL;
}
return dh;
}