updating_ipcrypto_and_ipcryptohash (#10)
pull request for the updated ipcrypto and ipcryptohash Co-authored-by: neelimap <neelimaps@neominds.in> Reviewed-on: http://13.234.246.121:3000/Neominds/ossl35vx69/pulls/10 Reviewed-by: Siddhant Singh <siddhant.singh@neominds.in> 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:
committed by
neelimap
co-authored by
neelimap
parent
39a30a0a32
commit
bc87b3aad4
@@ -10,4 +10,16 @@
|
||||
|
||||
TGT_DIR=$(WIND_BASE)/target
|
||||
|
||||
|
||||
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
|
||||
@@ -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
|
||||
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
|
||||
|
||||
|
||||
@@ -9,9 +9,6 @@
|
||||
#include <vxWorksCommon.h>
|
||||
#include <string.h>
|
||||
#include <openssl/evp.h>
|
||||
#include <randomNumGen.h>
|
||||
#include <private/randomNumGenP.h>
|
||||
|
||||
#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
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
#include <vxWorks.h>
|
||||
#include <vsbConfig.h>
|
||||
#include <semLib.h>
|
||||
#include <clockLib.h>
|
||||
#include <time.h>
|
||||
#include <sys/time.h>
|
||||
#include <openssl/crypto.h>
|
||||
#include <errnoLib.h>
|
||||
|
||||
@@ -37,6 +37,9 @@
|
||||
#include <ipcom_err.h>
|
||||
#include <ipcom_tmo.h>
|
||||
#include <openssl/ssl.h>
|
||||
#include <sys/time.h>
|
||||
#include <ipnet/ipioctl_var.h>
|
||||
|
||||
|
||||
/*
|
||||
****************************************************************************
|
||||
@@ -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));
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user