From bc87b3aad4629d08ca5d4a99487dc9d1cf94f99d Mon Sep 17 00:00:00 2001 From: Neelima P S Date: Thu, 19 Mar 2026 13:22:36 +0000 Subject: [PATCH] updating_ipcrypto_and_ipcryptohash (#10) pull request for the updated ipcrypto and ipcryptohash Co-authored-by: neelimap Reviewed-on: http://13.234.246.121:3000/Neominds/ossl35vx69/pulls/10 Reviewed-by: Siddhant Singh Co-authored-by: Neelima P S Co-committed-by: Neelima P S --- vxworks-6.9/target/src/openssl/Makefile | 14 ++++++++++- .../target/src/openssl/ipcrypto/Makefile | 24 +++++++++---------- .../src/openssl/ipcrypto/ipcrypto_rsa_oaep.c | 8 +++---- .../src/openssl/ipcrypto/ipcrypto_util.c | 2 +- .../target/src/openssl/ipcrypto/ipssl_cmds.c | 13 ++++++---- .../target/src/openssl/ipcryptohash/Makefile | 18 +++++++------- 6 files changed, 46 insertions(+), 33 deletions(-) diff --git a/vxworks-6.9/target/src/openssl/Makefile b/vxworks-6.9/target/src/openssl/Makefile index 11ff178b..03f85be1 100644 --- a/vxworks-6.9/target/src/openssl/Makefile +++ b/vxworks-6.9/target/src/openssl/Makefile @@ -10,4 +10,16 @@ TGT_DIR=$(WIND_BASE)/target -include $(TGT_DIR)/h/make/rules.library \ No newline at end of file + +all: ossl_src crypto cryptohash + +ossl_src: + cd openssl_src && $(MAKE) -f Makefile + +crypto: + cd ipcrypto && $(MAKE) -f Makefile + +cryptohash: + cd ipcryptohash && $(MAKE) -f Makefile + +include $(TGT_DIR)/h/make/rules.library diff --git a/vxworks-6.9/target/src/openssl/ipcrypto/Makefile b/vxworks-6.9/target/src/openssl/ipcrypto/Makefile index 68203bac..8bfad56f 100644 --- a/vxworks-6.9/target/src/openssl/ipcrypto/Makefile +++ b/vxworks-6.9/target/src/openssl/ipcrypto/Makefile @@ -10,23 +10,26 @@ # Makefile for openssl vxworks interface # - +TGT_DIR=$(WIND_BASE)/target +IPCOM_DIR=$(WIND_HOME)/components/ip_net2-6.9/ipcom LIB_BASE_NAME = ip_crypto LIB_FORMAT = both -ifeq ($(SPACE),user) -include $(WIND_USR_MK)/defs.library.mk -else -include $(WIND_KRNL_MK)/defs.library.mk -endif +include $(WIND_BASE)/target/h/make/defs.library -ADDED_CFLAGS += -Wno-implicit-function-declaration +ADDED_CFLAGS += -Wno-implicit-function-declaration +EXTRA_INCLUDE += -I$(IPCOM_DIR)/include +EXTRA_INCLUDE += -I$(IPCOM_DIR)/config +EXTRA_INCLUDE += -I$(IPCOM_DIR)/port/vxworks/config +EXTRA_INCLUDE += -I$(IPCOM_DIR)/port/vxworks/include +EXTRA_INCLUDE += -I$(TGT_DIR)/h/security ifneq ($(SPACE),user) OBJS = ipcrypto_cmd_cmp.o OBJS += ipcrypto_shell.o OBJS += ipcrypto_cmds.o + ifdef _WRS_CONFIG_IPNET_COREIP OBJS += ipcrypto_aeskeywrap.o OBJS += ipcrypto_bubble_babble.o @@ -52,8 +55,5 @@ endif # ifneq ($(SPACE),user) OBJS += ipcrypto_util.o OBJS += ipcrypto.o -ifeq ($(SPACE),user) -include $(WIND_USR_MK)/rules.library.mk -else -include $(WIND_KRNL_MK)/rules.library.mk -endif +include $(WIND_BASE)/target/h/make/rules.library + diff --git a/vxworks-6.9/target/src/openssl/ipcrypto/ipcrypto_rsa_oaep.c b/vxworks-6.9/target/src/openssl/ipcrypto/ipcrypto_rsa_oaep.c index 108fd993..bb044c31 100644 --- a/vxworks-6.9/target/src/openssl/ipcrypto/ipcrypto_rsa_oaep.c +++ b/vxworks-6.9/target/src/openssl/ipcrypto/ipcrypto_rsa_oaep.c @@ -9,9 +9,6 @@ #include #include #include -#include -#include - #include "ipcrypto_config.h" /* @@ -103,6 +100,8 @@ ipcrypto_oaep_mask(const EVP_MD* hash, * Returns: * */ +extern int fill_random_bytes(uint8_t *buf, int len); + void ipcrypto_rsa_oaep_encode(const EVP_MD* hash, unsigned char *in, @@ -123,7 +122,8 @@ ipcrypto_rsa_oaep_encode(const EVP_MD* hash, for (i = 1; i < hLen+1; i+=4) { unsigned int rnd; - (void)randUBytes((unsigned char*)&rnd, 4); + + (void)fill_random_bytes ((uint8_t *)rnd, 4); if ((hLen+1)-i >=4) memcpy(&out[i], &rnd, 4); else diff --git a/vxworks-6.9/target/src/openssl/ipcrypto/ipcrypto_util.c b/vxworks-6.9/target/src/openssl/ipcrypto/ipcrypto_util.c index d708499a..09cec6a6 100644 --- a/vxworks-6.9/target/src/openssl/ipcrypto/ipcrypto_util.c +++ b/vxworks-6.9/target/src/openssl/ipcrypto/ipcrypto_util.c @@ -11,7 +11,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/vxworks-6.9/target/src/openssl/ipcrypto/ipssl_cmds.c b/vxworks-6.9/target/src/openssl/ipcrypto/ipssl_cmds.c index 3ec55baa..044d19cf 100644 --- a/vxworks-6.9/target/src/openssl/ipcrypto/ipssl_cmds.c +++ b/vxworks-6.9/target/src/openssl/ipcrypto/ipssl_cmds.c @@ -37,6 +37,9 @@ #include #include #include +#include +#include + /* **************************************************************************** @@ -295,7 +298,7 @@ IP_GLOBAL int ipssl_cmd_ssl_clt(int argc, char** argv) { union sockaddr_union addr; - struct addrinfo* addrinfo = NULL; + struct Ip_addrinfo* addrinfo = NULL; int sock = IP_INVALID_SOCKET; Ipssl_cmd_args cmd_args; int rc = IPCOM_ERR_FAILED; @@ -338,7 +341,7 @@ ipssl_cmd_ssl_clt(int argc, char** argv) goto cleanup; } ipcom_memcpy(&addr.sa, addrinfo->ai_addr, addrinfo->ai_addrlen); - addr.sin.sin_port = (in_port_t)htons(cmd_args.port); + addr.sin.sin_port = (Ip_in_port_t)htons(cmd_args.port); sock = socket(addrinfo->ai_family, SOCK_STREAM, 0); if(sock == IP_INVALID_SOCKET) @@ -377,9 +380,9 @@ ipssl_cmd_ssl_clt(int argc, char** argv) if(cmd_args.t > 0) { - if (0 != ioctl(sock, X_SIOCSINTR, &(cmd_args.t) ) ) + if (0 != ioctl(sock, IP_X_SIOCSINTR, &(cmd_args.t) ) ) { - (void)ipcom_printf("ioctl(X_SIOCSINTR) failed: %s"IP_LF, + (void)ipcom_printf("ioctl(IP_X_SIOCSINTR) failed: %s"IP_LF, ipcom_strerror(ipcom_errno)); goto cleanup; } @@ -491,7 +494,7 @@ ipssl_cmd_ssl_srv(int argc, char** argv) SSL_CTX_set_session_id_context(ssl_ctx, (unsigned char*) &sess_id, sizeof(sess_id)); ipcom_memset(&addr, 0, sizeof(addr)); - addr.sin.sin_port = (in_port_t)htons(cmd_args.port); + addr.sin.sin_port = (Ip_in_port_t)htons(cmd_args.port); #ifdef IPCOM_USE_INET6 addr.sa.sa_family = AF_INET6; IPCOM_SA_LEN_SET(&addr.sa, sizeof(struct sockaddr_in6)); diff --git a/vxworks-6.9/target/src/openssl/ipcryptohash/Makefile b/vxworks-6.9/target/src/openssl/ipcryptohash/Makefile index a25b6fdb..7e5c2534 100644 --- a/vxworks-6.9/target/src/openssl/ipcryptohash/Makefile +++ b/vxworks-6.9/target/src/openssl/ipcryptohash/Makefile @@ -9,16 +9,16 @@ # DESCRIPTION # Makefile for hash layer # +TGT_DIR=$(WIND_BASE)/target LIB_BASE_NAME = ip_crypto LIB_FORMAT = both -ifeq ($(SPACE),user) -include $(WIND_USR_MK)/defs.library.mk -else -include $(WIND_KRNL_MK)/defs.library.mk -endif + +include $(WIND_BASE)/target/h/make/defs.library + +EXTRA_INCLUDE += -I$(TGT_DIR)/h/security ifeq ($(_WRS_CONFIG_SEC_HASH),y) ifneq ($(SPACE),user) @@ -32,11 +32,9 @@ OBJS += secHashWhirlpoolOpenssl.o endif endif -ifeq ($(SPACE),user) -include $(WIND_USR_MK)/rules.library.mk -else -include $(WIND_KRNL_MK)/rules.library.mk -endif + +include $(WIND_BASE)/target/h/make/rules.library +