Merge pull request 'updating security misc for vx6.9' (#6) from updating_security_misc into master
Reviewed-on: http://13.234.246.121:3000/Neominds/ossl35vx69/pulls/6 Reviewed-by: Siddhant Singh <siddhant.singh@neominds.in>
This commit is contained in:
@@ -8,4 +8,16 @@
|
||||
#
|
||||
|
||||
|
||||
include $(WIND_KRNL_MK)/rules.layers.mk
|
||||
TGT_DIR=$(WIND_BASE)/target
|
||||
|
||||
|
||||
all: hash crypto
|
||||
|
||||
hash:
|
||||
cd secHash && $(MAKE) -f Makefile
|
||||
|
||||
crypto:
|
||||
cd secCrypto && $(MAKE) -f Makefile
|
||||
|
||||
|
||||
include $(TGT_DIR)/h/make/rules.library
|
||||
@@ -6,7 +6,6 @@
|
||||
# of this software may be licensed only pursuant to the terms
|
||||
# of an applicable Wind River license agreement.
|
||||
#
|
||||
include $(WIND_KRNL_MK)/defs.layers.mk
|
||||
|
||||
|
||||
# When using the SEC_CRYPTO encryption API, you must include OPENSSL
|
||||
@@ -17,22 +16,24 @@ include $(WIND_KRNL_MK)/defs.layers.mk
|
||||
|
||||
# if CRYPTO_SUPPORTED is not set then fail with an error
|
||||
|
||||
ifdef _WRS_CONFIG_SEC_CRYPTO
|
||||
KERNEL_PUBLIC_H_DIRS += h
|
||||
KERNEL_PROTECTED_H_DIRS += protectedh
|
||||
BUILD_DIRS += src
|
||||
POST_NOBUILD_CDFDIRS += cdf
|
||||
POST_NOBUILD_CFGDIRS += cfg
|
||||
endif
|
||||
#ifdef _WRS_CONFIG_SEC_CRYPTO
|
||||
#KERNEL_PUBLIC_H_DIRS += h
|
||||
#KERNEL_PROTECTED_H_DIRS += protectedh
|
||||
#BUILD_DIRS += src
|
||||
#POST_NOBUILD_CDFDIRS += cdf
|
||||
#POST_NOBUILD_CFGDIRS += cfg
|
||||
#endif
|
||||
|
||||
ifneq ("$(wildcard vxTest/src/Makefile)","")
|
||||
ifdef _WRS_CONFIG_SEC_CRYPTO_VXTEST
|
||||
BUILD_DIRS += vxTest/src
|
||||
POST_NOBUILD_CDFDIRS += vxTest/cdf
|
||||
endif
|
||||
endif
|
||||
#ifneq ("$(wildcard vxTest/src/Makefile)","")
|
||||
#ifdef _WRS_CONFIG_SEC_CRYPTO_VXTEST
|
||||
#BUILD_DIRS += vxTest/src
|
||||
#POST_NOBUILD_CDFDIRS += vxTest/cdf
|
||||
#endif
|
||||
#endif
|
||||
|
||||
CC_WARNINGS_BUILD_DIRS = CC_WARNINGS_HIGH_SYS
|
||||
CC_WARNINGS_BUILD_USER_DIRS = CC_WARNINGS_HIGH_SYS
|
||||
#CC_WARNINGS_BUILD_DIRS = CC_WARNINGS_HIGH_SYS
|
||||
#CC_WARNINGS_BUILD_USER_DIRS = CC_WARNINGS_HIGH_SYS
|
||||
|
||||
include $(WIND_KRNL_MK)/rules.layers.mk
|
||||
TGT_DIR=$(WIND_BASE)/target
|
||||
|
||||
include $(TGT_DIR)/h/make/rules.library
|
||||
@@ -9,11 +9,18 @@
|
||||
# DESCRIPTION
|
||||
# Makefile for secCrypto
|
||||
#
|
||||
TGT_DIR=$(WIND_BASE)/target
|
||||
IPCOM_DIR=$(WIND_HOME)/components/ip_net2-6.9/ipcom
|
||||
|
||||
LIB_BASE_NAME = SECCRYPTO
|
||||
|
||||
include $(WIND_KRNL_MK)/defs.library.mk
|
||||
include $(WIND_BASE)/target/h/make/defs.library
|
||||
|
||||
EXTRA_INCLUDE += -I$(TGT_DIR)/h/security
|
||||
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
|
||||
ifdef _WRS_CONFIG_CORE__BANNED_H
|
||||
ADDED_CFLAGS += -include banned.h
|
||||
endif
|
||||
@@ -67,4 +74,4 @@ OBJS += secKeyIvGenLib.o
|
||||
endif # _WRS_ALL_DOCS
|
||||
|
||||
|
||||
include $(WIND_KRNL_MK)/rules.library.mk
|
||||
include $(WIND_BASE)/target/h/make/rules.library
|
||||
|
||||
@@ -72,10 +72,13 @@ SEE ALSO
|
||||
#include <private/iosLibP.h>
|
||||
#include <secHash.h>
|
||||
#include <secCrypto.h>
|
||||
#include <fsUtilityFuncs.h>
|
||||
#include <taskLib.h>
|
||||
#include <errno.h>
|
||||
#include <sysLib.h>
|
||||
|
||||
/* typedefs */
|
||||
typedef __SIZE_TYPE__ rsize_t;
|
||||
typedef int errno_t;
|
||||
|
||||
typedef struct secVaultHandle
|
||||
{
|
||||
@@ -90,6 +93,32 @@ typedef struct secVaultHandle
|
||||
|
||||
LOCAL SEC_VAULT_HANDLE secVault = {0};
|
||||
|
||||
/****************************************************************************
|
||||
* memset_s and memcpy_s are not present in VxWorks 6.9, so wrapper routines are used.
|
||||
*/
|
||||
|
||||
errno_t memset_s(void *s, rsize_t smax, int c, rsize_t n)
|
||||
{
|
||||
if (s == NULL) return EINVAL;
|
||||
if (n > smax) return ERANGE;
|
||||
memset(s, c, n);
|
||||
return 0;
|
||||
}
|
||||
|
||||
errno_t memcpy_s(void *dest, rsize_t destsz,
|
||||
const void *src, rsize_t count)
|
||||
{
|
||||
if (dest == NULL || src == NULL) {
|
||||
return EINVAL; /* invalid pointer */
|
||||
}
|
||||
if (count > destsz) {
|
||||
/* would overflow destination buffer */
|
||||
return ERANGE;
|
||||
}
|
||||
memcpy(dest, src, count);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* secSecretCreateDirs - create directories for vault
|
||||
@@ -120,7 +149,7 @@ void secSecretCreateDirs
|
||||
{
|
||||
/* No slashes in path => path is a relative 'leaf' path */
|
||||
|
||||
(void)mkdir (path, 0777);
|
||||
(void)mkdir (path);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -148,14 +177,14 @@ void secSecretCreateDirs
|
||||
/* If we have an absolute path it will start with a slash */
|
||||
|
||||
if (strlen (tmpPath) > 0 && strcmp (tmpPath, ".") != 0)
|
||||
(void)mkdir (tmpPath, 0777);
|
||||
(void)mkdir (tmpPath);
|
||||
free (tmpPath);
|
||||
}
|
||||
|
||||
/* Create the final 'leaf' directory */
|
||||
|
||||
if (path[strlen (path)-1] != '/')
|
||||
(void)mkdir (path, 0777);
|
||||
(void)mkdir (path);
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
@@ -1015,14 +1044,14 @@ STATUS securePartitionWaitMount
|
||||
const char * pPartName
|
||||
)
|
||||
{
|
||||
STATUS ret;
|
||||
STATUS ret=ERROR;
|
||||
int nProbe;
|
||||
|
||||
/* Verify the partition is mounted */
|
||||
|
||||
for (nProbe = 10; nProbe >= 0; nProbe--)
|
||||
{
|
||||
ret = fsDeviceValidateMount(pPartName, 0);
|
||||
/* ret = fsDeviceValidateMount(pPartName, 0); */
|
||||
if (ret == OK)
|
||||
{
|
||||
break;
|
||||
|
||||
@@ -17,12 +17,16 @@
|
||||
# provide its own set of hash algorithm implementations.
|
||||
|
||||
# Provides VxWorks Hash, HMAC, and PBKDF2 APIs
|
||||
KERNEL_PUBLIC_H_DIRS += h
|
||||
BUILD_DIRS += src
|
||||
POST_NOBUILD_CDFDIRS += cdf
|
||||
POST_NOBUILD_CFGDIRS += cfg
|
||||
|
||||
CC_WARNINGS_BUILD_DIRS = CC_WARNINGS_HIGH_SYS
|
||||
CC_WARNINGS_BUILD_USER_DIRS = CC_WARNINGS_HIGH_SYS
|
||||
#KERNEL_PUBLIC_H_DIRS += h
|
||||
#BUILD_DIRS += src
|
||||
#POST_NOBUILD_CDFDIRS += cdf
|
||||
#POST_NOBUILD_CFGDIRS += cfg
|
||||
|
||||
include $(WIND_KRNL_MK)/rules.layers.mk
|
||||
#CC_WARNINGS_BUILD_DIRS = CC_WARNINGS_HIGH_SYS
|
||||
#CC_WARNINGS_BUILD_USER_DIRS = CC_WARNINGS_HIGH_SYS
|
||||
|
||||
|
||||
TGT_DIR=$(WIND_BASE)/target
|
||||
|
||||
include $(TGT_DIR)/h/make/rules.library
|
||||
|
||||
@@ -9,10 +9,13 @@
|
||||
# DESCRIPTION
|
||||
# Makefile for sec_hash
|
||||
#
|
||||
TGT_DIR=$(WIND_BASE)/target
|
||||
|
||||
LIB_BASE_NAME = SEC_HASH
|
||||
|
||||
include $(WIND_KRNL_MK)/defs.library.mk
|
||||
include $(WIND_BASE)/target/h/make/defs.library
|
||||
|
||||
EXTRA_INCLUDE += -I$(TGT_DIR)/h/security
|
||||
|
||||
OBJS = secHash.o
|
||||
OBJS += secHmac.o
|
||||
@@ -27,4 +30,4 @@ OBJS += secHashWhirlpool.o
|
||||
|
||||
DOC_FILES = secHash.c secHmac.c secPbkdf2.c
|
||||
|
||||
include $(WIND_KRNL_MK)/rules.library.mk
|
||||
include $(WIND_BASE)/target/h/make/rules.library
|
||||
|
||||
Reference in New Issue
Block a user