diff --git a/components/ip_net2-6.9/ipappl/src/ipftps_tls.c b/components/ip_net2-6.9/ipappl/src/ipftps_tls.c index a8516293..a987fec2 100644 --- a/components/ip_net2-6.9/ipappl/src/ipftps_tls.c +++ b/components/ip_net2-6.9/ipappl/src/ipftps_tls.c @@ -27,7 +27,6 @@ #include "ipftps_config.h" -#define IPCOM_USE_CLIB_PROTO #include #include #include @@ -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; } diff --git a/vxworks-6.9/target/src/os/security/secCrypto/src/ipcrypto_key_db_example_keys.c b/vxworks-6.9/target/src/os/security/secCrypto/src/ipcrypto_key_db_example_keys.c index 493d60f0..f250b950 100644 --- a/vxworks-6.9/target/src/os/security/secCrypto/src/ipcrypto_key_db_example_keys.c +++ b/vxworks-6.9/target/src/os/security/secCrypto/src/ipcrypto_key_db_example_keys.c @@ -25,7 +25,6 @@ **************************************************************************** */ -#define IPCOM_USE_CLIB_PROTO #include #include "ipcrypto_config.h" @@ -50,7 +49,7 @@ * 3 DEFINES **************************************************************************** */ -#define IPCOM_SYSLOG_PRIORITY IPCRYPTO_SYSLOG_PRIORITY +#define IPCOM_SYSLOG_PRIORITY IPCOM_LOG_DEBUG #define IPCOM_SYSLOG_FACILITY IPCOM_LOG_IPCRYPTO #define IPCRYPTO_KEY_DB_EXAMPLE_DSA_KEY \