Merge pull request 'Changes to compile openssl-3.1.7 in vx6.9' (#4) from ossl_compilation into master
Reviewed-on: http://13.234.246.121:3000/Neominds/ossl35vx69/pulls/4
This commit is contained in:
@@ -0,0 +1,237 @@
|
||||
/* ipcrypto.h - public API of Wind River Crypto */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2006-2014, 2019-2021, 2023-2024 Wind River Systems, Inc.
|
||||
*
|
||||
* The right to copy, distribute, modify or otherwise make use
|
||||
* of this software may be licensed only pursuant to the terms
|
||||
* of an applicable Wind River license agreement.
|
||||
*/
|
||||
|
||||
#ifndef IPCRYPTO_H
|
||||
#define IPCRYPTO_H
|
||||
|
||||
/*
|
||||
****************************************************************************
|
||||
* 1 DESCRIPTION
|
||||
****************************************************************************
|
||||
*/
|
||||
|
||||
/*
|
||||
DESCRIPTION
|
||||
This library contains the API for Wind River Crypto
|
||||
*/
|
||||
|
||||
/*
|
||||
****************************************************************************
|
||||
* 2 CONFIGURATION
|
||||
****************************************************************************
|
||||
*/
|
||||
#include "ipcrypto_config.h"
|
||||
|
||||
|
||||
/*
|
||||
****************************************************************************
|
||||
* 3 INCLUDE FILES
|
||||
****************************************************************************
|
||||
*/
|
||||
|
||||
|
||||
#include <openssl/ossl_typ.h>
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/*
|
||||
****************************************************************************
|
||||
* 4 DEFINES
|
||||
****************************************************************************
|
||||
*/
|
||||
|
||||
/* IPCRYPTO release XYyZz,
|
||||
* X = major version
|
||||
* Yy = minor version (two different versions might be incompatible)
|
||||
* Zz = patch version (two different versions are always compatible)
|
||||
*/
|
||||
#define IPCRYPTO_RELEASE 70
|
||||
|
||||
#ifndef AES_BLOCKSIZE
|
||||
#define AES_BLOCKSIZE 16
|
||||
#endif
|
||||
|
||||
#define AES_KEY_128_BYTES 16
|
||||
#define AES_KEY_192_BYTES 24
|
||||
#define AES_KEY_256_BYTES 32
|
||||
#define AESKW_BLOCKSIZE 8
|
||||
|
||||
/*this LOCK is useless in openssl1.1.1, will be delete after all 3rd update*/
|
||||
#define CRYPTO_NUM_LOCKS 41
|
||||
|
||||
/*
|
||||
****************************************************************************
|
||||
* 5 TYPES
|
||||
****************************************************************************
|
||||
*/
|
||||
|
||||
/* Forward declaration */
|
||||
struct env_md_st;
|
||||
|
||||
/*
|
||||
****************************************************************************
|
||||
* 6 FUNCTIONS
|
||||
****************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* ipcrypto_crc32 -
|
||||
*
|
||||
* \NOMANUAL:
|
||||
*
|
||||
*/
|
||||
extern unsigned int ipcrypto_crc32(
|
||||
const unsigned char* s,
|
||||
unsigned int len
|
||||
);
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* ipcrypto_key_fingerprint_bubblebabble -
|
||||
*
|
||||
* \NOMANUAL:
|
||||
*
|
||||
*/
|
||||
extern char * ipcrypto_key_fingerprint_bubblebabble(
|
||||
unsigned char* dgst_raw,
|
||||
unsigned int dgst_raw_len
|
||||
);
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* aeskw_wrap - encrypt a key using AES Keywrap
|
||||
*
|
||||
* This routine encrypts a key using AES Keywrap.
|
||||
*
|
||||
* Parameters:
|
||||
* \is
|
||||
* \i <key>
|
||||
* Pointer to key encryption key buffer.
|
||||
*
|
||||
* \i <keyLength>
|
||||
* Length of key in key buffer in bytes. Must be 16, 24 or 32 bytes.
|
||||
*
|
||||
* \i <iv>
|
||||
* Pointer to initialization vector buffer.
|
||||
*
|
||||
* \i <ivLength>
|
||||
* Length of IV in bytes. Must be AESKW_BLOCKSIZE.
|
||||
*
|
||||
* \i <plainText>
|
||||
* Pointer to buffer to encrypt.
|
||||
*
|
||||
* \i <plainTextLength>
|
||||
* Length of plainText buffer. Must be a multiple of AESKW_BLOCKSIZE.
|
||||
*
|
||||
* \i <cipherText>
|
||||
* Pointer to output buffer.
|
||||
*
|
||||
* \i <cipherTextLength>
|
||||
* Pointer to a variable containing the length of the output buffer. On input, '*cipherTextLength'
|
||||
* must be set to the size of the 'cipherText' buffer. On output, '*cipherTextLength' is updated to the length
|
||||
* of data copied into the 'cipherText' buffer.
|
||||
*
|
||||
* \ie
|
||||
*
|
||||
* RETURNS: 1 on success, -1 on error
|
||||
*
|
||||
*/
|
||||
extern int aeskw_wrap(
|
||||
unsigned char *key,
|
||||
int keyLength,
|
||||
unsigned char *iv,
|
||||
int ivLength,
|
||||
unsigned char *plainText,
|
||||
int plainTextLength,
|
||||
unsigned char *cipherText,
|
||||
int *cipherTextLength
|
||||
);
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* aeskw_unwrap - decrypt a key using AES Keywrap
|
||||
*
|
||||
* This routine decrypts a key using AES Keywrap.
|
||||
*
|
||||
* Parameters:
|
||||
* \is
|
||||
* \i <key>
|
||||
* Pointer to key encryption key buffer.
|
||||
*
|
||||
* \i <keyLength>
|
||||
* Length of key in key buffer in bytes. Must be 16, 24 or 32 bytes.
|
||||
*
|
||||
* \i <iv>
|
||||
* Pointer to initialization vector buffer.
|
||||
*
|
||||
* \i <ivLength>
|
||||
* Length of IV in bytes. Must be AESKW_BLOCKSIZE.
|
||||
*
|
||||
* \i <cipherText>
|
||||
* Pointer to buffer to decrypt.
|
||||
*
|
||||
* \i <cipherTextLength>
|
||||
* Length of cipherText buffer. Must be a multiple of AESKW_BLOCKSIZE.
|
||||
*
|
||||
* \i <plainText>
|
||||
* Pointer to output buffer.
|
||||
*
|
||||
* \i <plainTextLength>
|
||||
* Pointer to a variable containing the length of the output buffer. On input, '*plainTextLength'
|
||||
* must be set to the size of the 'plainText' buffer. On output, '*plainTextLength' is updated to the length
|
||||
* of data copied into the 'plainText' buffer.
|
||||
*
|
||||
* \ie
|
||||
*
|
||||
* RETURNS: 1 on success, -1 on error
|
||||
*
|
||||
*/
|
||||
|
||||
extern int aeskw_unwrap(
|
||||
unsigned char *key,
|
||||
int keyLength,
|
||||
unsigned char *iv,
|
||||
int ivLength,
|
||||
unsigned char *cipherText,
|
||||
int cipherTextLength,
|
||||
unsigned char *plainText,
|
||||
int *plainTextLength
|
||||
);
|
||||
|
||||
|
||||
void ipcrypto_rsa_oaep_encode(const EVP_MD* hash,
|
||||
unsigned char *in,
|
||||
int inlen,
|
||||
unsigned char *out,
|
||||
int outlen);
|
||||
|
||||
int ipcrypto_rsa_oaep_decode(const EVP_MD* hash,
|
||||
unsigned char *in,
|
||||
int in_len,
|
||||
unsigned char *out,
|
||||
int* out_len);
|
||||
|
||||
struct rand_meth_st * vxRandLibMeth(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
/*
|
||||
****************************************************************************
|
||||
* END OF FILE
|
||||
****************************************************************************
|
||||
*/
|
||||
@@ -0,0 +1,140 @@
|
||||
/*
|
||||
* Copyright (c) 2006-2014, 2021, 2024 Wind River Systems, Inc.
|
||||
*
|
||||
* The right to copy, distribute, modify or otherwise make use
|
||||
* of this software may be licensed only pursuant to the terms
|
||||
* of an applicable Wind River license agreement.
|
||||
*/
|
||||
|
||||
#ifndef IPCRYPTO_CONFIG_H
|
||||
#define IPCRYPTO_CONFIG_H
|
||||
|
||||
/*
|
||||
****************************************************************************
|
||||
* 1 DESCRIPTION
|
||||
****************************************************************************
|
||||
*/
|
||||
|
||||
/*
|
||||
****************************************************************************
|
||||
* 2 INCLUDE FILES
|
||||
****************************************************************************
|
||||
*/
|
||||
|
||||
#include <openssl/opensslconf.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
/*
|
||||
****************************************************************************
|
||||
* 3 DEFINES
|
||||
****************************************************************************
|
||||
*/
|
||||
|
||||
#ifdef IPCRYPTO_MINIMUM_FOOTPRINT
|
||||
|
||||
/* Hash algorithms */
|
||||
#define OPENSSL_NO_MD2
|
||||
#define OPENSSL_NO_MD4
|
||||
#define OPENSSL_NO_RIPEMD
|
||||
#define OPENSSL_NO_RIPEMD160
|
||||
#define OPENSSL_NO_RMD160
|
||||
|
||||
/* Symmetrical algorithms */
|
||||
/*#define OPENSSL_NO_AES*/
|
||||
#define OPENSSL_NO_BF
|
||||
#define OPENSSL_NO_CAST
|
||||
#define OPENSSL_NO_CHAIN_VERIFY
|
||||
#define OPENSSL_NO_DESCBCM
|
||||
#define OPENSSL_NO_RC4
|
||||
#define OPENSSL_NO_RC2
|
||||
|
||||
/* Asymmetrical algorithms */
|
||||
/* These algorithms are needed by IPIKE, IPSSH, IPSSL, IPWEBS */
|
||||
/* #define OPENSSL_NO_DH */
|
||||
/* #define OPENSSL_NO_DSA */
|
||||
/* ipwebs and ipsslproxy require RSA */
|
||||
/* #define OPENSSL_NO_RSA */
|
||||
|
||||
|
||||
#define OPENSSL_NO_KRB5
|
||||
/* #define OPENSSL_NO_OCSP */
|
||||
|
||||
#endif
|
||||
|
||||
/* The following algorithms have an unclear patent situation, hence we exclude them */
|
||||
#define OPENSSL_NO_MDC2
|
||||
#define OPENSSL_NO_IDEA
|
||||
|
||||
|
||||
#ifdef OPENSSL_FIPS
|
||||
#define OPENSSL_NO_MD2
|
||||
/*#define OPENSSL_NO_MD4*/
|
||||
#define OPENSSL_NO_RIPEMD
|
||||
#define OPENSSL_NO_RIPEMD160
|
||||
#define OPENSSL_NO_RMD160
|
||||
|
||||
#define OPENSSL_NO_BF
|
||||
#define OPENSSL_NO_CAST
|
||||
#define OPENSSL_NO_RC4
|
||||
#define OPENSSL_NO_RC2
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
*===========================================================================
|
||||
* IPCRYPTO_DEFAULT_CONFIG_FILE
|
||||
*===========================================================================
|
||||
*/
|
||||
#define IPCRYPTO_DEFAULT_CONFIG_FILE "/ram/openssl.cnf"
|
||||
|
||||
|
||||
/*
|
||||
*===========================================================================
|
||||
* IPCRYPTO_USE_APPS
|
||||
*===========================================================================
|
||||
* Define to include openssl shell command applications.
|
||||
*/
|
||||
#if !defined(IPCRYPTO_MINIMUM_FOOTPRINT)
|
||||
#define IPCRYPTO_USE_APPS
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
*===========================================================================
|
||||
* IPCRYPTO_USE_TEST
|
||||
*===========================================================================
|
||||
* Define to include openssl shell command test tools.
|
||||
#if !defined(IPCRYPTO_MINIMUM_FOOTPRINT)
|
||||
#endif
|
||||
*/
|
||||
#define IPCRYPTO_USE_TEST
|
||||
|
||||
|
||||
|
||||
/*
|
||||
****************************************************************************
|
||||
* 4 TYPES
|
||||
****************************************************************************
|
||||
*/
|
||||
|
||||
/*
|
||||
****************************************************************************
|
||||
* 5 FUNCTIONS
|
||||
****************************************************************************
|
||||
*/
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
****************************************************************************
|
||||
* END OF FILE
|
||||
****************************************************************************
|
||||
*/
|
||||
@@ -0,0 +1,25 @@
|
||||
/*
|
||||
* Copyright (c) 2016, 2021, 2024 Wind River Systems, Inc.
|
||||
*
|
||||
* The right to copy, distribute, modify or otherwise make use
|
||||
* of this software may be licensed only pursuant to the terms
|
||||
* of an applicable Wind River license agreement.
|
||||
*/
|
||||
|
||||
#ifndef IPCRYPTO_SHELL_H
|
||||
#define IPCRYPTO_SHELL_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef int (* Ipcrypto_shell_cmd_type) (int argc, char ** argv);
|
||||
|
||||
int ipcrypto_shell_add_cmd(const char *name, const char *usage,
|
||||
const char *description, Ipcrypto_shell_cmd_type hook);
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#endif /*IPCRYPTO_SHELL_H*/
|
||||
@@ -0,0 +1,48 @@
|
||||
/*
|
||||
* Copyright (c) 2014, 2016, 2021, 2024 Wind River Systems, Inc.
|
||||
*
|
||||
* The right to copy, distribute, modify or otherwise make use
|
||||
* of this software may be licensed only pursuant to the terms
|
||||
* of an applicable Wind River license agreement.
|
||||
*/
|
||||
|
||||
#ifndef IPCRYPTO_UTIL_H
|
||||
#define IPCRYPTO_UTIL_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Operation timed out and failed. */
|
||||
#define IPCRYPTO_ERR_TIMEOUT -1120
|
||||
|
||||
/* Operation failed because blocking is illegal. */
|
||||
#define IPCRYPTO_ERR_WOULDBLOCK -1121
|
||||
|
||||
/* Operation was interrupted */
|
||||
#define IPCRYPTO_ERR_INTERRUPT -1122
|
||||
|
||||
typedef void *mutex_t;
|
||||
/* Block type */
|
||||
typedef void * Ipcrypto_block;
|
||||
|
||||
struct sockaddr;
|
||||
struct timeval;
|
||||
struct tms;
|
||||
|
||||
int mutex_create(mutex_t *mutex);
|
||||
int mutex_delete(mutex_t *mutex);
|
||||
void mutex_lock(mutex_t mutex);
|
||||
void mutex_unlock(mutex_t mutex);
|
||||
int ipcrypto_block_create(Ipcrypto_block *block);
|
||||
int ipcrypto_block_delete(Ipcrypto_block *block);
|
||||
int ipcrypto_block_wait(Ipcrypto_block block, int milli_seconds);
|
||||
void ipcrypto_block_post(Ipcrypto_block block);
|
||||
void ipcrypto_microtime(struct timeval *tv);
|
||||
clock_t ipcrypto_times(struct tms *buf);
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#endif /*IPCRYPTO_UTIL_H*/
|
||||
@@ -0,0 +1,86 @@
|
||||
/* sys/select.h */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2005, 2009-2010, 2016, 2018, 2021 Wind River Systems, Inc.
|
||||
*
|
||||
* The right to copy, distribute, modify or otherwise make use
|
||||
* of this software may be licensed only pursuant to the terms
|
||||
* of an applicable Wind River license agreement.
|
||||
*/
|
||||
#ifndef _SYS_SELECT_H_
|
||||
#define _SYS_SELECT_H_
|
||||
#if !defined(_POSIX_C_SOURCE) && !defined(_XOPEN_SOURCE) && \
|
||||
!defined(_POSIX_AEP_RT_CONTROLLER_C_SOURCE)
|
||||
|
||||
#include <sys/types.h>
|
||||
|
||||
#else
|
||||
|
||||
#include <base/e_vxTypesOld.h> /* _VX_FD_SETSIZE, etc. */
|
||||
|
||||
#endif /* _POSIX_xxx_SOURCE */
|
||||
|
||||
#include <sys/time.h> /* timeval */
|
||||
#include <signal.h> /* sigset_t */
|
||||
#include <time.h> /* timespec */
|
||||
#include <strings.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#ifndef FD_SETSIZE
|
||||
#define FD_SETSIZE _VX_FD_SETSIZE
|
||||
#endif /* FD_SETSIZE */
|
||||
|
||||
#ifndef _FD_MASK_DEFINED
|
||||
#define _FD_MASK_DEFINED
|
||||
typedef long fd_mask;
|
||||
#endif /* _FD_MASK_DEFINED */
|
||||
|
||||
#ifndef NBBY
|
||||
#define NBBY 8
|
||||
#endif
|
||||
|
||||
#ifndef NFDBITS
|
||||
#define NFDBITS (sizeof(fd_mask) * NBBY) /* bits per mask */
|
||||
#endif
|
||||
|
||||
#ifndef howmany
|
||||
#define howmany(x, y) ((unsigned int)(((x)+((y)-1)))/(unsigned int)(y))
|
||||
#endif
|
||||
|
||||
#ifndef _FD_SET_DEFINED
|
||||
#define _FD_SET_DEFINED
|
||||
typedef struct fd_set
|
||||
{
|
||||
fd_mask fds_bits[howmany(FD_SETSIZE, NFDBITS)];
|
||||
} fd_set;
|
||||
#endif /* _FD_SET_DEFINED */
|
||||
|
||||
#ifndef _FD_FUNC_DEFINED
|
||||
#define _FD_FUNC_DEFINED
|
||||
#define FD_CLR(n, p) ((p)->fds_bits[(n)/NFDBITS] &= ~((fd_mask)1 << ((n) % NFDBITS)))
|
||||
#define FD_ISSET(n, p) ((p)->fds_bits[(n)/NFDBITS] & ((fd_mask)1 << ((n) % NFDBITS)))
|
||||
#define FD_SET(n, p) ((p)->fds_bits[(n)/NFDBITS] |= ((fd_mask)1 << ((n) % NFDBITS)))
|
||||
#define FD_ZERO(p) bzero((char *)(p), sizeof(*(p)))
|
||||
#endif /* _FD_FUNC_DEFINED */
|
||||
|
||||
#ifdef _WRS_KERNEL
|
||||
extern int select (int width, fd_set * pReadFds, fd_set * pWriteFds,
|
||||
fd_set * pExceptFds, struct timeval * pTimeOut);
|
||||
#else
|
||||
extern int select(int, fd_set *_Restrict, fd_set *_Restrict, fd_set *_Restrict,
|
||||
struct timeval *_Restrict);
|
||||
#endif
|
||||
|
||||
#if FALSE /* pselect not implemented */
|
||||
extern int pselect(int, fd_set *_Restrict, fd_set *_Restrict, fd_set *_Restrict,
|
||||
const struct timespec *_Restrict, const sigset_t *_Restrict);
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* _SYS_SELECT_H_ */
|
||||
@@ -96,6 +96,8 @@ modification history
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define thrd_success 0
|
||||
|
||||
/* BUS types */
|
||||
|
||||
#define BUS_TYPE_NONE NONE
|
||||
|
||||
Reference in New Issue
Block a user