added changes from 3.1.7 to open source 3.5.0. NOTE: This commit will NOT COMPILE. (#18)

Reviewed-on: http://13.234.246.121:3000/Neominds/ossl35vx69/pulls/18
Co-authored-by: siddhant <siddhant.singh@neominds.in>
Co-committed-by: siddhant <siddhant.singh@neominds.in>
This commit is contained in:
2026-07-30 19:33:32 +05:30
committed by neelimap
parent 23ab638c92
commit c987d4ef5a
6 changed files with 64 additions and 13 deletions
@@ -840,10 +840,8 @@ int ipcrypto_init_internal(SEM_ID semId)
#if defined (_WRS_KERNEL)
/* use shareable FILEs rather than task-specific stdout/stderr */
FILE * fpout = _Files[1];
FILE * fperr = _Files[2];
bio_out = BIO_new_fp(fpout, BIO_NOCLOSE | BIO_FP_TEXT);
bio_err = BIO_new_fp(fperr, BIO_NOCLOSE | BIO_FP_TEXT);
bio_out = BIO_new_fp(stdout, BIO_NOCLOSE | BIO_FP_TEXT);
bio_err = BIO_new_fp(stderr, BIO_NOCLOSE | BIO_FP_TEXT);
#else
bio_out = BIO_new_fp(stdout, BIO_NOCLOSE | BIO_FP_TEXT);
bio_err = BIO_new_fp(stderr, BIO_NOCLOSE | BIO_FP_TEXT);
@@ -1156,7 +1156,23 @@ int ossl_rand_check_random_provider_on_unload(OSSL_LIB_CTX *ctx,
#if defined(OPENSSL_SYS_VXWORKS_SUPPORT)&&!defined(FIPS_MODULE)
#include <vxWorks.h>
#include <randomNumGen.h>
#include <stdLib.h>
#include <tickLib.h>
int randPseudoBytes(unsigned char * randBuf, int numOfBytes)
{
int i;
srand((unsigned int)tickGet());
for (i = 0; i < numOfBytes; i++)
{
/* take lowest 8 bits */
randBuf[i] = (uint8_t)(rand() & 0xFF);
}
return OK;
}
int RAND_poll(void)
{
@@ -56,10 +56,12 @@ use OpenSSL::stackhash qw(generate_stack_macros);
# if defined(OPENSSL_SYS_VXWORKS) && defined(OPENSSL_THREADS) && !defined(CRYPTO_TDEBUG)
#include <taskLib.h>
/* threads.h cannot be included from C++ files, so define these types */
typedef int once_flag;
typedef struct {
BOOL done;
SEM_ID sem;
} once_flag;
typedef unsigned int tss_t;
# ifndef __cplusplus
#include <threads.h>
# endif
# endif
@@ -518,6 +520,13 @@ typedef LONG CRYPTO_ONCE;
typedef once_flag CRYPTO_ONCE;
typedef tss_t CRYPTO_THREAD_LOCAL;
typedef TASK_ID CRYPTO_THREAD_ID;
typedef struct
{
int initialized;
SEM_ID sem;
}CRYPTO_ONCE_STATIC_INIT;
# define ONCE_FLAG_INIT {0, NULL}
# define CRYPTO_ONCE_STATIC_INIT ONCE_FLAG_INIT
# else
# if defined(__TANDEM) && defined(_SPT_MODEL_)
@@ -31,7 +31,28 @@
#endif
#if defined(OPENSSL_SYS_VXWORKS)
# include <randomNumGen.h>
#include <stdLib.h>
#include <tickLib.h>
int randSecure (void)
{
return OK;
}
STATUS randUBytes (unsigned char * randBuf, int numOfBytes)
{
int i;
srand((unsigned int)tickGet());
for (i = 0; i < numOfBytes; i++)
{
/* take lowest 8 bits */
randBuf[i] = (uint8_t)(rand() & 0xFF);
}
return OK;
}
#endif
/* Macro to convert two thirty two bit values into a sixty four bit one */
@@ -10,6 +10,7 @@
/* This file has quite some overlap with engines/e_loader_attic.c */
#include <string.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <ctype.h> /* isdigit */
#include <assert.h>
@@ -9,14 +9,14 @@
TGT_DIR=$(WIND_BASE)/target
PKG_SRC_BUILD_DIR=$(VSB_DIR)/3pp/openssl-3.1.7
PKG_SRC_BUILD_DIR=$(VSB_DIR)/3pp/openssl-3.5.0
OPENSSL_COMPRSS_DIR=$(WIND_HOME)/vxworks-6.9/target/src/openssl/OPENSSL
KERNEL_PUBLIC_INCLUDE_DIR=$(PKG_SRC_BUILD_DIR)/krnl/h/public
#for applying patch
PATCH=$(WIND_HOME)/vxworks-6.9/host/msys2-x86-win64/usr/bin/patch.exe
OPENSSL_SRC_DIR=$(WIND_HOME)/vxworks-6.9/target/src/openssl/openssl_src
SRC_PATCH_DIR=$(WIND_HOME)/vxworks-6.9/target/src/openssl/OPENSSL/openssl-openssl-3.1.7
SRC_PATCH_DIR=$(WIND_HOME)/vxworks-6.9/target/src/openssl/OPENSSL/openssl-3.5.0
# hardcoded for now -
_WRS_CONFIG_OPENSSL_OPTIONS= no-aria no-blake2 no-camellia no-chacha no-md2 no-ocb no-poly1305 no-rc2 no-scrypt no-seed no-siphash no-sm2 no-sm3 no-sm4 no-cms no-cmp no-err no-autoerrinit no-filenames no-ct no-ec2m no-multiblock no-rfc3779 no-srp no-tests
@@ -24,16 +24,15 @@ _WRS_CONFIG_OPENSSL_OPTIONS= no-aria no-blake2 no-camellia no-chacha no-md2 no-o
_WRS_CONFIG_OPENSSL_IPNET_OPTIONS=
VXWORKS_MAK=vxworks.krnl.mak
VXE=openssl
PKG_NAME=openssl-3.1.7
PKG_NAME=openssl-3.5.0
MAKECMDGOALS=_mk
#MAKE_ARGS needs depends on BSP. Example shown below:-
#CPU=SIMNT TOOL=llvm TOOL_VERSION=llvm_2016_04 _CC_VERSION=llvm_18_1_8_1 _WRS_CONFIG_ENDIAN=little _WRS_CONFIG_FP=hard VSB_DIR=C:/25.09/workbench-4/workspace/VSB2_vxSim ROOT_DIR=C:/25.09/workbench-4/workspace/VSB2_vxSim/usr/root
MAKE_ARGS="CPU=SIMNT TOOL=gnu TOOL_VERSION=llvm_2016_04 _CC_VERSION=llvm_18_1_8_1 _WRS_CONFIG_ENDIAN=little _WRS_CONFIG_FP=hard VSB_DIR=C:/25.09/workbench-4/workspace/VSB2_vxSim ROOT_DIR=C:/25.09/workbench-4/workspace/VSB2_vxSim/usr/root"
include $(VSB_DIR)/h/config/auto.conf
PKG_VER := 3.1.7
PKG_VER := 3.5.0
PKG_URL := https://github.com/openssl/openssl/archive/openssl-$(PKG_VER).tar.gz
PKG_SHA256 := 7f013434c535a0366a610995c4530db6cde0554a0fac331a71a8e98a32b2635f
PKG_FILE_TYPE := unpack
@@ -158,6 +157,13 @@ target: get-openssl \
$(PUBLIC_INCLUDE_DIRS)
cd $(PKG_SRC_BUILD_DIR)/krnl && $(MAKE) -f $(VXWORKS_MAK) VXE=$@ PKG_NAME=$(PKG_NAME) PKG_VER=$(PKG_VER) $(MAKECMDGOALS)
apply-patches:
@echo "Applying patches from $(OPENSSL_SRC_DIR) to $(SRC_PATCH_DIR)..."
@for p in $(OPENSSL_SRC_DIR)/*.patch; do \
echo "Applying $$p"; \
$(PATCH) -d $(SRC_PATCH_DIR) -p1 -N < $$p || exit 1; \
done
get-openssl:
cd $(VSB_DIR) && mkdir -p 3pp
cp -r $(OPENSSL_COMPRSS_DIR)/$(PKG_NAME) $(VSB_DIR)/3pp/$(PKG_NAME)