diff --git a/components/ip_net2-6.9/common.vxconfig b/components/ip_net2-6.9/common.vxconfig index f4131c2e..cf31d8ca 100644 --- a/components/ip_net2-6.9/common.vxconfig +++ b/components/ip_net2-6.9/common.vxconfig @@ -743,7 +743,7 @@ config IPFTP_USE_TLS bool "Enable FTP with TLS" default n depends on COMPONENT_IPAPPL && MSP_KERNEL - select COMPONENT_IPCRYPTO + select COMPONENT_IPSSL help Enable FTP with TLS @@ -876,7 +876,7 @@ menu "Diameter Components" config IPDIAMETER_SEC_KEY_DB bool "Enable DIAMETER Secure key DB " - depends on (COMPONENT_IPDIAMETERP || COMPONENT_IPDIAMETERC) && COMPONENT_IPCRYPTO + depends on (COMPONENT_IPDIAMETERP || COMPONENT_IPDIAMETERC) && COMPONENT_IPSSL default n help This option enables Secure Key database support for Diameter components. @@ -1456,7 +1456,7 @@ config IPEAP_USE_EAP_PEAP bool "Enable EAP PEAP" default y depends on COMPONENT_IPEAP - select COMPONENT_IPCRYPTO + select COMPONENT_IPSSL help This option enables EAP_PEAP support. @@ -1478,18 +1478,18 @@ config IPEAP_USE_EAP_TLS bool "Enable EAP TLS" default y depends on COMPONENT_IPEAP - select COMPONENT_IPCRYPTO + select COMPONENT_IPSSL help This option enables EAP_TLS support. -comment "EAP TTLS requires COMPONENT_IPCRYPTO to be selected" - depends on COMPONENT_IPEAP && !IPEAP_USE_EAP_TTLS && !COMPONENT_IPCRYPTO +comment "EAP TTLS requires COMPONENT_IPSSL to be selected" + depends on COMPONENT_IPEAP && !IPEAP_USE_EAP_TTLS && !COMPONENT_IPSSL config IPEAP_USE_EAP_TTLS bool "Enable EAP TTLS" default y - depends on COMPONENT_IPEAP && COMPONENT_IPCRYPTO + depends on COMPONENT_IPEAP && COMPONENT_IPSSL help This option enables EAP_TTLS support. @@ -1522,7 +1522,7 @@ config IPEAP_USE_EAP_COMMON_TLS config IPEAP_USE_EAP_COMMON_SIM bool default y if IPEAP_USE_EAP_SIM || IPEAP_USE_EAP_AKA - select COMPONENT_IPCRYPTO + select COMPONENT_IPSSL help This is a hidden component and will be selected if EAP SIM, and/or EAP AKA will be selected. # diff --git a/components/ip_net2-6.9/ipappl/config/00comp_ipnet_appl.cdf b/components/ip_net2-6.9/ipappl/config/00comp_ipnet_appl.cdf index e1ae8c90..96458bd6 100644 --- a/components/ip_net2-6.9/ipappl/config/00comp_ipnet_appl.cdf +++ b/components/ip_net2-6.9/ipappl/config/00comp_ipnet_appl.cdf @@ -141,7 +141,7 @@ Component INCLUDE_IPFTPS_TLS { NAME FTP Server with TLS SYNOPSIS FTP Server with TLS MODULES ipftps_tls.o - REQUIRES INCLUDE_IPFTPS INCLUDE_IPCRYPTO + REQUIRES INCLUDE_IPFTPS INCLUDE_IPSSL CFG_PARAMS FTPS_TLS FTPS_TLS_CERT_FILE FTPS_TLS_KEY_FILE FTPS_TLS_SECRECT_KEY\ ENABLE_ADVANCE_FTPS_KEY_PRIVACY _CHILDREN FOLDER_FTP @@ -678,7 +678,7 @@ Parameter ENABLE_ADVANCE_FTPS_KEY_PRIVACY { Parameter FTPS_TLS_KEY_FILE { NAME TLS key file SYNOPSIS - REQUIRES INCLUDE_IPCRYPTO + REQUIRES INCLUDE_IPSSL TYPE char * DEFAULT "" } @@ -686,7 +686,7 @@ Parameter FTPS_TLS_KEY_FILE { Parameter FTPS_TLS_CERT_FILE { NAME TLS certificate file SYNOPSIS - REQUIRES INCLUDE_IPCRYPTO + REQUIRES INCLUDE_IPSSL TYPE char * DEFAULT "" } @@ -694,7 +694,7 @@ Parameter FTPS_TLS_CERT_FILE { Parameter FTPS_TLS { NAME Enable FTP server with TLS SYNOPSIS - REQUIRES INCLUDE_IPCRYPTO + REQUIRES INCLUDE_IPSSL TYPE char * DEFAULT "0" } @@ -702,7 +702,7 @@ Parameter FTPS_TLS { Parameter FTPS_TLS_SECRECT_KEY { NAME TLS secret key SYNOPSIS - REQUIRES INCLUDE_IPCRYPTO + REQUIRES INCLUDE_IPSSL TYPE char * DEFAULT "" } diff --git a/components/ip_net2-6.9/ipcrypto/config/02comp_crypto.cdf b/components/ip_net2-6.9/ipcrypto/config/02comp_crypto.cdf index 4c9f18bd..6218c0a3 100644 --- a/components/ip_net2-6.9/ipcrypto/config/02comp_crypto.cdf +++ b/components/ip_net2-6.9/ipcrypto/config/02comp_crypto.cdf @@ -1,24 +1,11 @@ -/* 02comp_ipnet_crypto.cdf - IPCRYPTO configuration file */ - /* - * Copyright (c) 2007 Wind River Systems, Inc. + * Copyright (c) 2007, 2014-2019, 2021-2024 Wind River Systems, Inc. * - * The right to copy, distribute or otherwise make use of this software - * may be licensed only pursuant to the terms of an applicable Wind River - * license agreement. No license to Wind River intellectual property rights - * is granted herein. All rights not licensed by Wind River are reserved - * by Wind River. + * 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. */ -/* -modification history --------------------- -01c,18sep07,spw Remove space -01b,10sep07,mze re-added modules back into INCLUDE_IPCRYPTO -01a.16aug07,mze removed MODULES in INCLUDE_IPCRYPTO -*/ - - Folder FOLDER_CRYPTO { NAME CRYPTO Components @@ -26,27 +13,21 @@ Folder FOLDER_CRYPTO DEFAULTS INCLUDE_IPCRYPTO } -Component INCLUDE_IPCRYPTO_USE_CMDS +Folder FOLDER_OPENSSL_3_5_0_USE_CMDS { - NAME CRYPTO Commands + NAME Openssl Commands _CHILDREN FOLDER_CRYPTO SYNOPSIS Crypto Commands - REQUIRES INCLUDE_IPCRYPTO } -Component INCLUDE_IPCRYPTO_USE_TEST_CMDS - { - NAME CRYPTO Test Commands - _CHILDREN FOLDER_CRYPTO - SYNOPSIS Crypto Test Commands - REQUIRES INCLUDE_IPCRYPTO - } - -Component INCLUDE_IPCRYPTO { +Component INCLUDE_IPCRYPTO + { NAME CRYPTO SYNOPSIS Crypto Library _CHILDREN FOLDER_CRYPTO CONFIGLETTES ipcrypto_config.c + INIT_RTN ipcrypto_init(); + _INIT_ORDER usrToolsInit CFG_PARAMS OPENSSL_CONF \ OPENSSL_HOME MODULES ipcrypto_aescmac.o \ @@ -55,7 +36,288 @@ Component INCLUDE_IPCRYPTO { ipcrypto_crc32.o \ ipcrypto_bubble_babble.o \ ipcrypto_cmd_cmp.o -} + } + +Component INCLUDE_VERIFY_CMD + { + NAME OpenSSL verify shell command + SYNOPSIS This component includes the OpenSSL verify shell command. + _CHILDREN FOLDER_OPENSSL_3_5_0_USE_CMDS + REQUIRES INCLUDE_IPCRYPTO INCLUDE_IPCOM_SHELL_CMD + } + +Component INCLUDE_ASN1PARSE_CMD + { + NAME OpenSSL asn1parse shell command + SYNOPSIS This component includes the OpenSSL asn1parse shell command. + _CHILDREN FOLDER_OPENSSL_3_5_0_USE_CMDS + REQUIRES INCLUDE_IPCRYPTO INCLUDE_IPCOM_SHELL_CMD + } + +Component INCLUDE_REQ_CMD + { + NAME OpenSSL req shell command + SYNOPSIS This component includes the OpenSSL req shell command. + _CHILDREN FOLDER_OPENSSL_3_5_0_USE_CMDS + REQUIRES INCLUDE_IPCRYPTO INCLUDE_IPCOM_SHELL_CMD + } + +Component INCLUDE_DGST_CMD + { + NAME OpenSSL dgst shell command + SYNOPSIS This component includes the OpenSSL dgst shell command. + _CHILDREN FOLDER_OPENSSL_3_5_0_USE_CMDS + REQUIRES INCLUDE_IPCRYPTO INCLUDE_IPCOM_SHELL_CMD + } + +Component INCLUDE_DHPARAM_CMD + { + NAME OpenSSL dhparam shell command + SYNOPSIS This component includes the OpenSSL dhparam shell command. + _CHILDREN FOLDER_OPENSSL_3_5_0_USE_CMDS + REQUIRES INCLUDE_IPCRYPTO INCLUDE_IPCOM_SHELL_CMD + } + +Component INCLUDE_ENC_CMD + { + NAME OpenSSL enc shell command + SYNOPSIS This component includes the OpenSSL enc shell command. + _CHILDREN FOLDER_OPENSSL_3_5_0_USE_CMDS + REQUIRES INCLUDE_IPCRYPTO INCLUDE_IPCOM_SHELL_CMD + } + +Component INCLUDE_PASSWD_CMD + { + NAME OpenSSL passwd shell command + SYNOPSIS This component includes the OpenSSL passwd shell command. + _CHILDREN FOLDER_OPENSSL_3_5_0_USE_CMDS + REQUIRES INCLUDE_IPCRYPTO INCLUDE_IPCOM_SHELL_CMD + } + +Component INCLUDE_CA_CMD + { + NAME OpenSSL ca shell command + SYNOPSIS This component includes the OpenSSL ca shell command. + _CHILDREN FOLDER_OPENSSL_3_5_0_USE_CMDS + REQUIRES INCLUDE_IPCRYPTO INCLUDE_IPCOM_SHELL_CMD + } + +Component INCLUDE_CRL_CMD + { + NAME OpenSSL crl shell command + SYNOPSIS This component includes the OpenSSL crl shell command. + _CHILDREN FOLDER_OPENSSL_3_5_0_USE_CMDS + REQUIRES INCLUDE_IPCRYPTO INCLUDE_IPCOM_SHELL_CMD + } + +Component INCLUDE_RSA_CMD + { + NAME OpenSSL rsa shell command + SYNOPSIS This component includes the OpenSSL rsa shell command. + _CHILDREN FOLDER_OPENSSL_3_5_0_USE_CMDS + REQUIRES INCLUDE_IPCRYPTO INCLUDE_IPCOM_SHELL_CMD + } + +Component INCLUDE_RSAUTL_CMD + { + NAME OpenSSL rsautl shell command + SYNOPSIS This component includes the OpenSSL rsautl shell command. + _CHILDREN FOLDER_OPENSSL_3_5_0_USE_CMDS + REQUIRES INCLUDE_IPCRYPTO INCLUDE_IPCOM_SHELL_CMD + } + +Component INCLUDE_GENRSA_CMD + { + NAME OpenSSL genrsa shell command + SYNOPSIS This component includes the OpenSSL genrsa shell command. + _CHILDREN FOLDER_OPENSSL_3_5_0_USE_CMDS + REQUIRES INCLUDE_IPCRYPTO INCLUDE_IPCOM_SHELL_CMD + } + +Component INCLUDE_DSA_CMD + { + NAME OpenSSL dsa shell command + SYNOPSIS This component includes the OpenSSL dsa shell command. + _CHILDREN FOLDER_OPENSSL_3_5_0_USE_CMDS + REQUIRES INCLUDE_IPCRYPTO INCLUDE_IPCOM_SHELL_CMD + } + +Component INCLUDE_DSAPARAM_CMD + { + NAME OpenSSL dsaparam shell command + SYNOPSIS This component includes the OpenSSL dsaparam shell command. + _CHILDREN FOLDER_OPENSSL_3_5_0_USE_CMDS + REQUIRES INCLUDE_IPCRYPTO INCLUDE_IPCOM_SHELL_CMD + } + +Component INCLUDE_GENDSA_CMD + { + NAME OpenSSL gendsa shell command + SYNOPSIS This component includes the OpenSSL gendsa shell command. + _CHILDREN FOLDER_OPENSSL_3_5_0_USE_CMDS + REQUIRES INCLUDE_IPCRYPTO INCLUDE_IPCOM_SHELL_CMD + } + +Component INCLUDE_X509_CMD + { + NAME OpenSSL x509 shell command + SYNOPSIS This component includes the OpenSSL x509 shell command. + _CHILDREN FOLDER_OPENSSL_3_5_0_USE_CMDS + REQUIRES INCLUDE_IPCRYPTO INCLUDE_IPCOM_SHELL_CMD + } + +Component INCLUDE_SPEED_CMD + { + NAME OpenSSL speed shell command + SYNOPSIS This component includes the OpenSSL speed shell command. + _CHILDREN FOLDER_OPENSSL_3_5_0_USE_CMDS + REQUIRES INCLUDE_IPCRYPTO INCLUDE_IPCOM_SHELL_CMD INCLUDE_POSIX_TIMERS + } + +Component INCLUDE_PKCS7_CMD + { + NAME OpenSSL pkcs7 shell command + SYNOPSIS This component includes the OpenSSL pkcs7 shell command. + _CHILDREN FOLDER_OPENSSL_3_5_0_USE_CMDS + REQUIRES INCLUDE_IPCRYPTO INCLUDE_IPCOM_SHELL_CMD + } + +Component INCLUDE_CRL2PKCS7_CMD + { + NAME OpenSSL crl2p7 shell command + SYNOPSIS This component includes the OpenSSL crl2p7 shell command. + _CHILDREN FOLDER_OPENSSL_3_5_0_USE_CMDS + REQUIRES INCLUDE_IPCRYPTO INCLUDE_IPCOM_SHELL_CMD + } + +Component INCLUDE_NSEQ_CMD + { + NAME OpenSSL nseq shell command + SYNOPSIS This component includes the OpenSSL nseq shell command. + _CHILDREN FOLDER_OPENSSL_3_5_0_USE_CMDS + REQUIRES INCLUDE_IPCRYPTO INCLUDE_IPCOM_SHELL_CMD + } + +Component INCLUDE_PKCS12_CMD + { + NAME OpenSSL pkcs12 shell command + SYNOPSIS This component includes the OpenSSL pkcs12 shell command. + _CHILDREN FOLDER_OPENSSL_3_5_0_USE_CMDS + REQUIRES INCLUDE_IPCRYPTO INCLUDE_IPCOM_SHELL_CMD + } + +Component INCLUDE_PKCS8_CMD + { + NAME OpenSSL pkcs8 shell command + SYNOPSIS This component includes the OpenSSL pkcs8 shell command. + _CHILDREN FOLDER_OPENSSL_3_5_0_USE_CMDS + REQUIRES INCLUDE_IPCRYPTO INCLUDE_IPCOM_SHELL_CMD + } + +Component INCLUDE_SPKAC_CMD + { + NAME OpenSSL spkac shell command + SYNOPSIS This component includes the OpenSSL spkac shell command. + _CHILDREN FOLDER_OPENSSL_3_5_0_USE_CMDS + REQUIRES INCLUDE_IPCRYPTO INCLUDE_IPCOM_SHELL_CMD + } + +Component INCLUDE_SMIME_CMD + { + NAME OpenSSL smime shell command + SYNOPSIS This component includes the OpenSSL smime shell command. + _CHILDREN FOLDER_OPENSSL_3_5_0_USE_CMDS + REQUIRES INCLUDE_IPCRYPTO INCLUDE_IPCOM_SHELL_CMD + } + +Component INCLUDE_RAND_CMD + { + NAME OpenSSL rand shell command + SYNOPSIS This component includes the OpenSSL rand shell command. + _CHILDREN FOLDER_OPENSSL_3_5_0_USE_CMDS + REQUIRES INCLUDE_IPCRYPTO INCLUDE_IPCOM_SHELL_CMD + } + +Component INCLUDE_VERSION_CMD + { + NAME OpenSSL ipcrypto_ver shell command + SYNOPSIS This component includes the OpenSSL ipcrypto_ver shell command. + _CHILDREN FOLDER_OPENSSL_3_5_0_USE_CMDS + REQUIRES INCLUDE_IPCRYPTO INCLUDE_IPCOM_SHELL_CMD + } + +Component INCLUDE_ENGINE_CMD + { + NAME OpenSSL engine shell command + SYNOPSIS This component includes the OpenSSL engine shell command. + _CHILDREN FOLDER_OPENSSL_3_5_0_USE_CMDS + REQUIRES INCLUDE_IPCRYPTO INCLUDE_IPCOM_SHELL_CMD + } + +Component INCLUDE_OCSP_CMD + { + NAME OpenSSL ocsp shell command + SYNOPSIS This component includes the OpenSSL ocsp shell command. + _CHILDREN FOLDER_OPENSSL_3_5_0_USE_CMDS + REQUIRES INCLUDE_IPCRYPTO INCLUDE_IPCOM_SHELL_CMD + } + +Component INCLUDE_ECPARAM_CMD + { + NAME OpenSSL ecparam shell command + SYNOPSIS This component includes the OpenSSL ecparam shell command. + _CHILDREN FOLDER_OPENSSL_3_5_0_USE_CMDS + REQUIRES INCLUDE_IPCRYPTO INCLUDE_IPCOM_SHELL_CMD + } + +Component INCLUDE_EC_CMD + { + NAME OpenSSL ec shell command + SYNOPSIS This component includes the OpenSSL ec shell command. + _CHILDREN FOLDER_OPENSSL_3_5_0_USE_CMDS + REQUIRES INCLUDE_IPCRYPTO INCLUDE_IPCOM_SHELL_CMD + } + +Component INCLUDE_GENPKEY_CMD + { + NAME OpenSSL genpkey shell command + SYNOPSIS This component includes the OpenSSL genpkey shell command. + _CHILDREN FOLDER_OPENSSL_3_5_0_USE_CMDS + REQUIRES INCLUDE_IPCRYPTO INCLUDE_IPCOM_SHELL_CMD + } + +Component INCLUDE_PKEY_CMD + { + NAME OpenSSL pkey shell command + SYNOPSIS This component includes the OpenSSL pkey shell command. + _CHILDREN FOLDER_OPENSSL_3_5_0_USE_CMDS + REQUIRES INCLUDE_IPCRYPTO INCLUDE_IPCOM_SHELL_CMD + } + +Component INCLUDE_PKEYPARAM_CMD + { + NAME OpenSSL pkeyparam shell command + SYNOPSIS This component includes the OpenSSL pkeyparam shell command. + _CHILDREN FOLDER_OPENSSL_3_5_0_USE_CMDS + REQUIRES INCLUDE_IPCRYPTO INCLUDE_IPCOM_SHELL_CMD + } + +Component INCLUDE_PKEYUTL_CMD + { + NAME OpenSSL pkeyutl shell command + SYNOPSIS This component includes the OpenSSL pkeyutl shell command. + _CHILDREN FOLDER_OPENSSL_3_5_0_USE_CMDS + REQUIRES INCLUDE_IPCRYPTO INCLUDE_IPCOM_SHELL_CMD + } + +Component INCLUDE_STOREUTL_CMD + { + NAME OpenSSL storeutl shell command + SYNOPSIS This component includes the OpenSSL storeutl shell command. + _CHILDREN FOLDER_OPENSSL_3_5_0_USE_CMDS + REQUIRES INCLUDE_IPCRYPTO INCLUDE_IPCOM_SHELL_CMD + } + Parameter OPENSSL_CONF { NAME OPENSSL_CONF diff --git a/components/ip_net2-6.9/ipcrypto/config/addOssl350ShellCmds.c b/components/ip_net2-6.9/ipcrypto/config/addOssl350ShellCmds.c deleted file mode 100644 index a313dca2..00000000 --- a/components/ip_net2-6.9/ipcrypto/config/addOssl350ShellCmds.c +++ /dev/null @@ -1,226 +0,0 @@ -/* - ****************************************************************************** - * OpenSSL version 3.5.0 Configuration SOURCE FILE - * - * Document no: @(#) $Name: - * $Source: /home/interpeak/CVSRoot/ipcrypto/config/ossl350_cmds.c,v $ - * $Author: ssp - * $State: Exp $ $Locker: $ - * - ****************************************************************************** - */ - - -/* - **************************************************************************** - * 1 DESCRIPTION - **************************************************************************** - */ - -/* - **************************************************************************** - * 2 INCLUDE FILES - **************************************************************************** - */ - -#include -#include "ipcrypto_config.h" - -#include -#include -#include -#include -#include -#include - -int s_server_main(int argc, char *argv[]); -int s_client_main(int argc, char **argv); -int genpkey_main(int argc, char **argv); -int ecparam_main(int argc, char **argv); -int ec_main(int argc, char **argv); -int ciphers_main(int argc, char **argv); -int pkeyparam_main(int argc, char **argv); -int pkeyutl_main(int argc, char **argv); - -int ipcrypto_init(void); -const char *OpenSSL_version(int t); - -/* - *=========================================================================== - * OpenSSL version 3.5.0 commands - *=========================================================================== - * - */ - -int -ipssl_s_server(int argc, char** argv) - { - ipcrypto_cmds_startup(); - return s_server_main(argc, argv); - } - -int -crypto_enc_main(int argc,char *argv[]) - { - ipcrypto_cmds_startup(); - return enc_main(argc, argv); - } - -int -ipssl_s_client(int argc, char** argv) - { - ipcrypto_cmds_startup(); - return s_client_main(argc, argv); - } - -int -crypto_x509_main(int argc, char** argv) - { - ipcrypto_cmds_startup(); - return x509_main(argc, argv); - } - -int -crypto_genrsa_main(int argc, char** argv) - { - ipcrypto_cmds_startup(); - return genrsa_main(argc, argv); - } - -int -crypto_req_main(int argc, char** argv) - { - ipcrypto_cmds_startup(); - return req_main(argc, argv); - } - -int -crypto_rand_main(int argc, char** argv) - { - ipcrypto_cmds_startup(); - return rand_main(argc, argv); - } - -int -crypto_genpkey_main(int argc, char** argv) - { - ipcrypto_cmds_startup(); - return genpkey_main(argc, argv); - } - -int -crypto_dgst_main(int argc, char** argv) - { - ipcrypto_cmds_startup(); - return dgst_main(argc, argv); - } - -int -crypto_ecparam_main(int argc, char** argv) - { - ipcrypto_cmds_startup(); - return ecparam_main(argc, argv); - } - -int -crypto_ec_main(int argc, char** argv) - { - ipcrypto_cmds_startup(); - return ec_main(argc, argv); - } - -int -crypto_dhparam_main(int argc, char** argv) - { - ipcrypto_cmds_startup(); - return dhparam_main(argc, argv); - } - -int -crypto_dsaparam_main(int argc, char** argv) - { - ipcrypto_cmds_startup(); - return dsaparam_main(argc, argv); - } - -int -crypto_ciphers_main(int argc, char** argv) - { - ipcrypto_cmds_startup(); - return ciphers_main(argc, argv); - } - -int -crypto_pkeyparam_main(int argc, char** argv) - { - ipcrypto_cmds_startup(); - return pkeyparam_main(argc, argv); - } - -int -crypto_rsa_main(int argc, char** argv) - { - ipcrypto_cmds_startup(); - return rsa_main(argc, argv); - } - -int -crypto_pkeyutl_main(int argc, char** argv) - { - ipcrypto_cmds_startup(); - return pkeyutl_main(argc, argv); - } - -int -crypto_verify_main(int argc, char** argv) - { - ipcrypto_cmds_startup(); - return verify_main(argc, argv); - } - -int -crypto_dsa_main(int argc, char** argv) - { - ipcrypto_cmds_startup(); - return dsa_main(argc, argv); - } - -void getOpenSSLVersion() - { - printf ("%s\n", OpenSSL_version(0)); - } - - -void addOssl350ShellCmds (void) - { - ipcrypto_init(); - - ipcrypto_shell_add_cmd("enc", "enc [options]", "Encoding with Ciphers", crypto_enc_main); - ipcrypto_shell_add_cmd("x509", "x509 [options]", "Manage certificate", crypto_x509_main); - ipcrypto_shell_add_cmd("genrsa", "genrsa [options]", "generate rsa private key", crypto_genrsa_main); - ipcrypto_shell_add_cmd("req", "req [options]", "certificate request generation", crypto_req_main); - ipcrypto_shell_add_cmd("rand", "rand [options]", "generate random bytes", crypto_rand_main); - ipcrypto_shell_add_cmd("genpkey", "genpkey [options]", "generate any private key", crypto_genpkey_main); - ipcrypto_shell_add_cmd("dgst", "dgst [options]", "hash", crypto_dgst_main); - ipcrypto_shell_add_cmd("ecparam", "ecparam [options]", "ecdsa key generate", crypto_ecparam_main); - ipcrypto_shell_add_cmd("ec", "ec [options]", "ecdsa key generate", crypto_ec_main); - ipcrypto_shell_add_cmd("dhparam", "dhparam [options]", "dh parameters", crypto_dhparam_main); - ipcrypto_shell_add_cmd("dsaparam", "dsaparam [options]", "dsa parameters", crypto_dsaparam_main); - ipcrypto_shell_add_cmd("ciphers", "ciphers [options]", "cipher suites", crypto_ciphers_main); - ipcrypto_shell_add_cmd("pkeyparam", "pkeyparam [options]", "process and manage public key algorithm parameters", crypto_pkeyparam_main); - ipcrypto_shell_add_cmd("rsa", "rsa [options]", "get public key", crypto_rsa_main); - ipcrypto_shell_add_cmd("pkeyutl", "pkeyutl [options]", "encrypt/decrypt", crypto_pkeyutl_main); - ipcrypto_shell_add_cmd("verify", "verify [options]", "certificate verification", crypto_verify_main); - ipcrypto_shell_add_cmd("dsa", "dsa [options]", "dsa", crypto_dsa_main); - - (void)ipcrypto_shell_add_cmd("s_server", "s_server", "SSL server", ipssl_s_server); - (void)ipcrypto_shell_add_cmd("s_client", "s_client", "SSL client", ipssl_s_client); - - } - -/* - **************************************************************************** - * END OF FILE - **************************************************************************** - */ - diff --git a/components/ip_net2-6.9/ipcrypto/config/ipcrypto_config.c b/components/ip_net2-6.9/ipcrypto/config/ipcrypto_config.c index af4cc694..dec94af6 100644 --- a/components/ip_net2-6.9/ipcrypto/config/ipcrypto_config.c +++ b/components/ip_net2-6.9/ipcrypto/config/ipcrypto_config.c @@ -1,18 +1,11 @@ /* - ****************************************************************************** - * INTERPEAK CONFIGURATION SOURCE FILE + * Copyright (c) 2006-2014, 2016-2019, 2021-2024 Wind River Systems, Inc. * - * Document no: @(#) $Name: VXWORKS_ITER40_2019102207 $ $RCSfile: ipcrypto_config.c,v $ $Revision: 1.28.10.5 $ - * $Source: /home/interpeak/CVSRoot/ipcrypto/config/ipcrypto_config.c,v $ - * $Author: yli10 $ - * $State: Exp $ $Locker: $ - * - * INTERPEAK_COPYRIGHT_STRING - * Design and implementation by Lennart Bang - ****************************************************************************** + * 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. */ - /* **************************************************************************** * 1 DESCRIPTION @@ -24,92 +17,16 @@ * 2 INCLUDE FILES **************************************************************************** */ - -#include +#include "ipcrypto_util.h" +#include "ipcrypto_shell.h" #include "ipcrypto_config.h" -#include -#include -#include -#include -#include -#include - - /* **************************************************************************** * 3 DEFINES **************************************************************************** */ -#define SHELL_ADD_CMD(cmd, usage, desc, hook) \ - ipcom_shell_add_cmd(cmd, usage, desc, hook, IPCOM_PRIORITY_MIN, IPCOM_PROC_STACK_MAX*2) - -#if defined(_WRS_CONFIG_COMPONENT_IPCRYPTO_USE_FIPS_140_2) && !defined(OPENSSL_FIPS) -#define OPENSSL_FIPS -#endif - -#ifdef PRJ_BUILD - -#ifdef IPCRYPTO_USE_TEST -#undef IPCRYPTO_USE_TEST -#endif -#ifdef INCLUDE_IPCRYPTO_USE_TEST_CMDS -#define IPCRYPTO_USE_TEST -#endif - -#ifdef IPCRYPTO_USE_KEY_DB_EXAMPLE_KEYS -#undef IPCRYPTO_USE_KEY_DB_EXAMPLE_KEYS -#endif -#ifdef INCLUDE_IPCRYPTO_USE_KEY_DB_EXAMPLE_KEYS -#define IPCRYPTO_USE_KEY_DB_EXAMPLE_KEYS -#endif - -#endif /* PRJ_BUILD */ - -/* - *=========================================================================== - * IPCRYPTO_USE_*_CMD - *=========================================================================== - * Set the defines below to include the correspondig openssl shell command - * applications. - */ - -#if defined(IPCRYPTO_USE_APPS) && !defined(PRJ_BUILD) || defined(INCLUDE_IPCRYPTO_USE_CMDS) -#define IPCRYPTO_USE_VERIFY_CMD -#define IPCRYPTO_USE_ASN1PARSE_CMD -#define IPCRYPTO_USE_REQ_CMD -#define IPCRYPTO_USE_DGST_CMD -#define IPCRYPTO_USE_DH_CMD -#define IPCRYPTO_USE_DHPARAM_CMD -#define IPCRYPTO_USE_GENDH_CMD -#define IPCRYPTO_USE_ENC_CMD -#define IPCRYPTO_USE_PASSWD_CMD -#define IPCRYPTO_USE_CA_CMD -#define IPCRYPTO_USE_CRL_CMD -#define IPCRYPTO_USE_RSA_CMD -#define IPCRYPTO_USE_RSAUTL_CMD -#define IPCRYPTO_USE_GENRSA_CMD -#define IPCRYPTO_USE_DSA_CMD -#define IPCRYPTO_USE_DSAPARAM_CMD -#define IPCRYPTO_USE_GENDSA_CMD -#define IPCRYPTO_USE_X509_CMD -#define IPCRYPTO_USE_PKCS7_CMD -#define IPCRYPTO_USE_CRL2P7_CMD -#define IPCRYPTO_USE_NSEQ_CMD -#define IPCRYPTO_USE_PKCS8_CMD -#define IPCRYPTO_USE_SPKAC_CMD -#define IPCRYPTO_USE_SMIME_CMD -#define IPCRYPTO_USE_RAND_CMD -#define IPCRYPTO_USE_VERSION_CMD -#define IPCRYPTO_USE_ENGINE_CMD -#define IPCRYPTO_USE_SPEED_CMD -#ifdef IPSSL -#define IPCRYPTO_USE_OCSP_CMD -#endif - -#endif /* IPCRYPTO_USE_APPS */ - /* **************************************************************************** @@ -117,31 +34,45 @@ **************************************************************************** */ + /* **************************************************************************** - * 5 EXTERN PROTOTYPES + * 5 LOCAL PROTOTYPES **************************************************************************** */ + +/* + **************************************************************************** + * 6 EXTERN PROTOTYPES + **************************************************************************** + */ + +int ipcom_cmd_keydb(int argc, char** argv); + /* *=========================================================================== * apps *=========================================================================== */ -IP_GLOBAL void ipcrypto_key_db_install_example_keys(void); - extern void ipcrypto_cmds_startup(void); extern int verify_main(int argc, char ** argv); extern int asn1parse_main(int argc, char ** argv); extern int req_main(int argc,char *argv[]); extern int dgst_main(int argc,char *argv[]); -extern int dh_main(int argc,char *argv[]); +/* + * dh command has been obsoleted by dhparam since OpenSSL 1.1.1. + * extern int dh_main(int argc,char *argv[]); + */ extern int dhparam_main(int argc,char *argv[]); extern int enc_main(int argc,char *argv[]); extern int passwd_main(int argc,char *argv[]); -extern int gendh_main(int argc,char *argv[]); +/* + * gendh command has been obsoleted by dhparam since OpenSSL 1.1.1. + * extern int gendh_main(int argc,char *argv[]); + */ extern int ca_main(int argc,char *argv[]); extern int crl_main(int argc,char *argv[]); extern int rsa_main(int argc,char *argv[]); @@ -163,11 +94,18 @@ extern int smime_main(int argc,char *argv[]); extern int rand_main(int argc,char *argv[]); extern int engine_main(int argc,char *argv[]); extern int ocsp_main(int argc,char *argv[]); - +extern int ecparam_main(int argc,char *argv[]); +extern int ec_main(int argc,char *argv[]); +extern int genpkey_main(int argc,char *argv[]); +extern int pkey_main(int argc,char *argv[]); +extern int pkeyparam_main(int argc,char *argv[]); +extern int pkeyutl_main(int argc,char *argv[]); +extern int storeutl_main(int argc,char *argv[]); +extern int fipsinstall_main(int argc,char *argv[]); extern int ipcrypto_cmd_cmp(int argc, char **argv); extern int ipcrypto_cmd_memory(int argc, char **argv); -extern int ipcrypto_cmd_fips_ctrl(int argc, char **argv); +extern int ipcrypto_init(void); /* *=========================================================================== @@ -202,145 +140,186 @@ extern int rsa_test(int argc, char **argv); extern int sha1test(int argc, char **argv); extern int shatest(int argc, char **argv); extern int sha512test(int argc, char **argv); +extern int sha256test(int argc, char **argv); extern int tabtest(int argc, char **argv); -extern int ipcrypto_cmd_aescmac_test(int argc, char **argv); + +extern int ideatest(int argc, char **argv); +extern int asn1_internal_test(int argc, char **argv); +extern int chacha_internal_test(int argc, char **argv); +extern int clienthellotest(int argc, char **argv); +extern int crltest(int argc, char **argv); +extern int curve448_internal_test(int argc, char **argv); +extern int igetest(int argc, char **argv); +extern int lhash_test(int argc, char **argv); +extern int modes_internal_test(int argc, char **argv); +extern int siphash_internal_test(int argc, char **argv); +extern int sm2_internal_test(int argc, char **argv); +extern int sm4_internal_test(int argc, char **argv); +extern int sslapitest(int argc, char **argv); +extern int sslbuffertest(int argc, char **argv); +extern int ssl_cert_table_internal_test(int argc, char **argv); +extern int sslcorrupttest(int argc, char *argv[]); +extern int tls13ccstest(int argc, char *argv[]); +extern int tls13encryptiontest(int argc, char *argv[]); +extern int x509_time_test(int argc, char *argv[]); + extern int ipcrypto_cmd_aeskeywrap_test(int argc, char **argv); -extern int aesgcmtest_main(int argc, char **argv); -extern int aes_ccm_test_main(int argc,char *argv[]); -extern int constant_time_test(int argc, char *argv[]); /* **************************************************************************** - * 6 LOCAL PROTOTYPES + * 7 LOCAL PROTOTYPES **************************************************************************** */ -#if IPCOM_USE_SHELL != IPCOM_SHELL_NONE - -#ifdef IPCRYPTO_USE_VERIFY_CMD -IP_STATIC int ipcrypto_verify_main(int argc, char ** argv); +#ifdef INCLUDE_VERIFY_CMD +static int ipcrypto_verify_main(int argc, char ** argv); #endif -#ifdef IPCRYPTO_USE_ASN1PARSE_CMD -IP_STATIC int ipcrypto_asn1parse_main(int argc, char ** argv); +#ifdef INCLUDE_ASN1PARSE_CMD +static int ipcrypto_asn1parse_main(int argc, char ** argv); #endif -#ifdef IPCRYPTO_USE_REQ_CMD -IP_STATIC int ipcrypto_req_main(int argc,char *argv[]); +#ifdef INCLUDE_REQ_CMD +static int ipcrypto_req_main(int argc,char *argv[]); #endif -#ifdef IPCRYPTO_USE_DGST_CMD -IP_STATIC int ipcrypto_dgst_main(int argc,char *argv[]); +#ifdef INCLUDE_DGST_CMD +static int ipcrypto_dgst_main(int argc,char *argv[]); #endif -#ifdef IPCRYPTO_USE_DH_CMD -IP_STATIC int ipcrypto_dh_main(int argc,char *argv[]); +#ifdef INCLUDE_DH_CMD +static int ipcrypto_dh_main(int argc,char *argv[]); #endif -#ifdef IPCRYPTO_USE_DHPARAM_CMD -IP_STATIC int ipcrypto_dhparam_main(int argc,char *argv[]); +#ifdef INCLUDE_DHPARAM_CMD +static int ipcrypto_dhparam_main(int argc,char *argv[]); #endif -#ifdef IPCRYPTO_USE_ENC_CMD -IP_STATIC int ipcrypto_enc_main(int argc,char *argv[]); +#ifdef INCLUDE_ENC_CMD +static int ipcrypto_enc_main(int argc,char *argv[]); #endif -#ifdef IPCRYPTO_USE_PASSWD_CMD -IP_STATIC int ipcrypto_passwd_main(int argc,char *argv[]); +#ifdef INCLUDE_PASSWD_CMD +static int ipcrypto_passwd_main(int argc,char *argv[]); #endif -#ifdef IPCRYPTO_USE_GENDH_CMD -IP_STATIC int ipcrypto_gendh_main(int argc,char *argv[]); +#ifdef INCLUDE_GENDH_CMD +static int ipcrypto_gendh_main(int argc,char *argv[]); #endif -#ifdef IPCRYPTO_USE_CA_CMD -IP_STATIC int ipcrypto_ca_main(int argc,char *argv[]); +#ifdef INCLUDE_CA_CMD +static int ipcrypto_ca_main(int argc,char *argv[]); #endif -#ifdef IPCRYPTO_USE_CRL_CMD -IP_STATIC int ipcrypto_crl_main(int argc,char *argv[]); +#ifdef INCLUDE_CRL_CMD +static int ipcrypto_crl_main(int argc,char *argv[]); #endif -#ifdef IPCRYPTO_USE_RSA_CMD -IP_STATIC int ipcrypto_rsa_main(int argc,char *argv[]); +#ifdef INCLUDE_RSA_CMD +static int ipcrypto_rsa_main(int argc,char *argv[]); #endif -#ifdef IPCRYPTO_USE_RSAUTL_CMD -IP_STATIC int ipcrypto_rsautl_main(int argc,char *argv[]); +#ifdef INCLUDE_RSAUTL_CMD +static int ipcrypto_rsautl_main(int argc,char *argv[]); #endif -#ifdef IPCRYPTO_USE_DSA_CMD -IP_STATIC int ipcrypto_dsa_main(int argc,char *argv[]); +#ifdef INCLUDE_DSA_CMD +static int ipcrypto_dsa_main(int argc,char *argv[]); #endif -#ifdef IPCRYPTO_USE_DSAPARAM_CMD -IP_STATIC int ipcrypto_dsaparam_main(int argc,char *argv[]); +#ifdef INCLUDE_DSAPARAM_CMD +static int ipcrypto_dsaparam_main(int argc,char *argv[]); #endif -#ifdef IPCRYPTO_USE_X509_CMD -IP_STATIC int ipcrypto_x509_main(int argc,char *argv[]); +#ifdef INCLUDE_X509_CMD +static int ipcrypto_x509_main(int argc,char *argv[]); #endif -#ifdef IPCRYPTO_USE_GENRSA_CMD -IP_STATIC int ipcrypto_genrsa_main(int argc,char *argv[]); +#ifdef INCLUDE_GENRSA_CMD +static int ipcrypto_genrsa_main(int argc,char *argv[]); #endif -#ifdef IPCRYPTO_USE_GENDSA_CMD -IP_STATIC int ipcrypto_gendsa_main(int argc,char *argv[]); +#ifdef INCLUDE_GENDSA_CMD +static int ipcrypto_gendsa_main(int argc,char *argv[]); #endif -#ifdef IPCRYPTO_USE_SPEED_CMD -IP_STATIC int ipcrypto_speed_main(int argc,char *argv[]); +#ifdef INCLUDE_SPEED_CMD +static int ipcrypto_speed_main(int argc,char *argv[]); #endif -#ifdef IPCRYPTO_USE_VERSION_CMD -IP_STATIC int ipcrypto_version_main(int argc,char *argv[]); +#ifdef INCLUDE_VERSION_CMD +static int ipcrypto_version_main(int argc,char *argv[]); #endif -#ifdef IPCRYPTO_USE_PKCS7_CMD -IP_STATIC int ipcrypto_pkcs7_main(int argc,char *argv[]); +#ifdef INCLUDE_PKCS7_CMD +static int ipcrypto_pkcs7_main(int argc,char *argv[]); #endif -#ifdef IPCRYPTO_USE_CRL2PKCS7_CMD -IP_STATIC int ipcrypto_crl2pkcs7_main(int argc,char *argv[]); +#ifdef INCLUDE_CRL2PKCS7_CMD +static int ipcrypto_crl2pkcs7_main(int argc,char *argv[]); #endif -#ifdef IPCRYPTO_USE_NSEQ_CMD -IP_STATIC int ipcrypto_nseq_main(int argc,char *argv[]); +#ifdef INCLUDE_NSEQ_CMD +static int ipcrypto_nseq_main(int argc,char *argv[]); #endif -#ifdef IPCRYPTO_USE_PKCS12_CMD -IP_STATIC int ipcrypto_pkcs12_main(int argc,char *argv[]); +#ifdef INCLUDE_PKCS12_CMD +static int ipcrypto_pkcs12_main(int argc,char *argv[]); #endif -#ifdef IPCRYPTO_USE_PKCS8_CMD -IP_STATIC int ipcrypto_pkcs8_main(int argc,char *argv[]); +#ifdef INCLUDE_PKCS8_CMD +static int ipcrypto_pkcs8_main(int argc,char *argv[]); #endif -#ifdef IPCRYPTO_USE_SPKAC_CMD -IP_STATIC int ipcrypto_spkac_main(int argc,char *argv[]); +#ifdef INCLUDE_SPKAC_CMD +static int ipcrypto_spkac_main(int argc,char *argv[]); #endif -#ifdef IPCRYPTO_USE_SMIME_CMD -IP_STATIC int ipcrypto_smime_main(int argc,char *argv[]); +#ifdef INCLUDE_SMIME_CMD +static int ipcrypto_smime_main(int argc,char *argv[]); #endif -#ifdef IPCRYPTO_USE_RAND_CMD -IP_STATIC int ipcrypto_rand_main(int argc,char *argv[]); +#ifdef INCLUDE_RAND_CMD +static int ipcrypto_rand_main(int argc,char *argv[]); #endif -#ifdef IPCRYPTO_USE_ENGINE_CMD -IP_STATIC int ipcrypto_engine_main(int argc,char *argv[]); +#ifdef INCLUDE_ENGINE_CMD +static int ipcrypto_engine_main(int argc,char *argv[]); #endif -#ifdef IPCRYPTO_USE_OCSP_CMD -IP_STATIC int ipcrypto_ocsp_main(int argc,char *argv[]); +#ifdef INCLUDE_OCSP_CMD +static int ipcrypto_ocsp_main(int argc,char *argv[]); #endif -#endif /* IPCOM_USE_SHELL != IPCOM_SHELL_NONE */ +#ifdef INCLUDE_ECPARAM_CMD +static int ipcrypto_ecparam_main(int argc,char *argv[]); +#endif +#ifdef INCLUDE_EC_CMD +static int ipcrypto_ec_main(int argc,char *argv[]); +#endif -IP_PUBLIC Ip_err ipcrypto_configure(void); +#ifdef INCLUDE_GENPKEY_CMD +static int ipcrypto_genpkey_main(int argc,char *argv[]); +#endif + +#ifdef INCLUDE_PKEY_CMD +static int ipcrypto_pkey_main(int argc,char *argv[]); +#endif + +#ifdef INCLUDE_PKEYPARAM_CMD +static int ipcrypto_pkeyparam_main(int argc,char *argv[]); +#endif + +#ifdef INCLUDE_PKEYUTL_CMD +static int ipcrypto_pkeyutl_main(int argc,char *argv[]); +#endif + +#ifdef INCLUDE_STOREUTL_CMD +static int ipcrypto_storeutl_main(int argc,char *argv[]); +#endif + +int ipcrypto_configure(void); /* **************************************************************************** @@ -354,44 +333,22 @@ IP_PUBLIC Ip_err ipcrypto_configure(void); *=========================================================================== */ -IP_STATIC IP_CONST Ipcom_sysvar ipcrypto_conf_sysvar[] = -{ - IP_SYSVAR("OPENSSL_CONF", IPCOM_FILE_ROOT "openssl/openssl.cnf", OPENSSL_CONF), - IP_SYSVAR("HOME", IPCOM_FILE_ROOT "openssl", OPENSSL_HOME), - { IP_NULL, IP_NULL } -}; - - -#ifdef OPENSSL_FIPS -/* When running ipcrypto in FIPS 140-2 mode, a fingerprint (hash) is calculated - * of the FIPS module implementation. This fingerprint is compared to an expected - * value (ipcrypto_fips_signature). If the value matches, the system is allowed - * to enter FIPS 140-2 mode. Initializing ipcrypto_fips_signature to all 0xEE - * will not enable FIPS 140-2 mode. After you have booted your image you can - * use the shell command 'fips_ctrl hash' to calculate the fips_signature. - * Thereafter update ipcrypto_fips_signature below, rebuild and reboot and - * ipcrypto will start in FIPS 140-2 mode. */ -unsigned char ipcrypto_fips_signature[20] = - { 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, - 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE }; -#endif /* **************************************************************************** - * 8 STATIC FUNCTIONS + * 9 STATIC FUNCTIONS **************************************************************************** */ -#if IPCOM_USE_SHELL != IPCOM_SHELL_NONE /* *=========================================================================== * SHELL COMMANDS *=========================================================================== */ -#ifdef IPCRYPTO_USE_VERIFY_CMD -IP_STATIC int +#ifdef INCLUDE_VERIFY_CMD +static int ipcrypto_verify_main(int argc, char ** argv) { ipcrypto_cmds_startup(); @@ -399,8 +356,8 @@ ipcrypto_verify_main(int argc, char ** argv) } #endif -#ifdef IPCRYPTO_USE_ASN1PARSE_CMD -IP_STATIC int +#ifdef INCLUDE_ASN1PARSE_CMD +static int ipcrypto_asn1parse_main(int argc, char ** argv) { ipcrypto_cmds_startup(); @@ -408,8 +365,8 @@ ipcrypto_asn1parse_main(int argc, char ** argv) } #endif -#ifdef IPCRYPTO_USE_REQ_CMD -IP_STATIC int +#ifdef INCLUDE_REQ_CMD +static int ipcrypto_req_main(int argc,char *argv[]) { ipcrypto_cmds_startup(); @@ -417,8 +374,8 @@ ipcrypto_req_main(int argc,char *argv[]) } #endif -#ifdef IPCRYPTO_USE_DGST_CMD -IP_STATIC int +#ifdef INCLUDE_DGST_CMD +static int ipcrypto_dgst_main(int argc,char *argv[]) { ipcrypto_cmds_startup(); @@ -426,17 +383,23 @@ ipcrypto_dgst_main(int argc,char *argv[]) } #endif -#ifdef IPCRYPTO_USE_DH_CMD -IP_STATIC int +#ifdef INCLUDE_DH_CMD +static int ipcrypto_dh_main(int argc,char *argv[]) { + /* + * dh command has been obsoleted by dhparam since OpenSSL 1.1.1. + */ + #if 0 ipcrypto_cmds_startup(); return dh_main(argc, argv); + #endif + return 0; } #endif -#ifdef IPCRYPTO_USE_DHPARAM_CMD -IP_STATIC int +#ifdef INCLUDE_DHPARAM_CMD +static int ipcrypto_dhparam_main(int argc,char *argv[]) { ipcrypto_cmds_startup(); @@ -444,8 +407,8 @@ ipcrypto_dhparam_main(int argc,char *argv[]) } #endif -#ifdef IPCRYPTO_USE_ENC_CMD -IP_STATIC int +#ifdef INCLUDE_ENC_CMD +static int ipcrypto_enc_main(int argc,char *argv[]) { ipcrypto_cmds_startup(); @@ -453,8 +416,8 @@ ipcrypto_enc_main(int argc,char *argv[]) } #endif -#ifdef IPCRYPTO_USE_PASSWD_CMD -IP_STATIC int +#ifdef INCLUDE_PASSWD_CMD +static int ipcrypto_passwd_main(int argc,char *argv[]) { ipcrypto_cmds_startup(); @@ -462,17 +425,23 @@ ipcrypto_passwd_main(int argc,char *argv[]) } #endif -#ifdef IPCRYPTO_USE_GENDH_CMD -IP_STATIC int +#ifdef INCLUDE_GENDH_CMD +static int ipcrypto_gendh_main(int argc,char *argv[]) { + /* + * gendh command has been obsoleted by dhparam since OpenSSL 1.1.1. + */ + #if 0 ipcrypto_cmds_startup(); return gendh_main(argc, argv); + #endif + return 0; } #endif -#ifdef IPCRYPTO_USE_CA_CMD -IP_STATIC int +#ifdef INCLUDE_CA_CMD +static int ipcrypto_ca_main(int argc,char *argv[]) { ipcrypto_cmds_startup(); @@ -480,8 +449,8 @@ ipcrypto_ca_main(int argc,char *argv[]) } #endif -#ifdef IPCRYPTO_USE_CRL_CMD -IP_STATIC int +#ifdef INCLUDE_CRL_CMD +static int ipcrypto_crl_main(int argc,char *argv[]) { ipcrypto_cmds_startup(); @@ -489,8 +458,8 @@ ipcrypto_crl_main(int argc,char *argv[]) } #endif -#ifdef IPCRYPTO_USE_RSA_CMD -IP_STATIC int +#ifdef INCLUDE_RSA_CMD +static int ipcrypto_rsa_main(int argc,char *argv[]) { ipcrypto_cmds_startup(); @@ -498,8 +467,8 @@ ipcrypto_rsa_main(int argc,char *argv[]) } #endif -#ifdef IPCRYPTO_USE_RSAUTL_CMD -IP_STATIC int +#ifdef INCLUDE_RSAUTL_CMD +static int ipcrypto_rsautl_main(int argc,char *argv[]) { ipcrypto_cmds_startup(); @@ -508,8 +477,8 @@ ipcrypto_rsautl_main(int argc,char *argv[]) #endif #ifndef OPENSSL_NO_DSA -#ifdef IPCRYPTO_USE_DSA_CMD -IP_STATIC int +#ifdef INCLUDE_DSA_CMD +static int ipcrypto_dsa_main(int argc,char *argv[]) { ipcrypto_cmds_startup(); @@ -517,8 +486,8 @@ ipcrypto_dsa_main(int argc,char *argv[]) } #endif -#ifdef IPCRYPTO_USE_GENDSA_CMD -IP_STATIC int +#ifdef INCLUDE_GENDSA_CMD +static int ipcrypto_gendsa_main(int argc,char *argv[]) { ipcrypto_cmds_startup(); @@ -526,8 +495,8 @@ ipcrypto_gendsa_main(int argc,char *argv[]) } #endif -#ifdef IPCRYPTO_USE_DSAPARAM_CMD -IP_STATIC int +#ifdef INCLUDE_DSAPARAM_CMD +static int ipcrypto_dsaparam_main(int argc,char *argv[]) { ipcrypto_cmds_startup(); @@ -536,8 +505,8 @@ ipcrypto_dsaparam_main(int argc,char *argv[]) #endif #endif /* OPENSSL_NO_DSA */ -#ifdef IPCRYPTO_USE_X509_CMD -IP_STATIC int +#ifdef INCLUDE_X509_CMD +static int ipcrypto_x509_main(int argc,char *argv[]) { ipcrypto_cmds_startup(); @@ -545,8 +514,8 @@ ipcrypto_x509_main(int argc,char *argv[]) } #endif -#ifdef IPCRYPTO_USE_GENRSA_CMD -IP_STATIC int +#ifdef INCLUDE_GENRSA_CMD +static int ipcrypto_genrsa_main(int argc,char *argv[]) { ipcrypto_cmds_startup(); @@ -554,8 +523,8 @@ ipcrypto_genrsa_main(int argc,char *argv[]) } #endif -#ifdef IPCRYPTO_USE_SPEED_CMD -IP_STATIC int +#ifdef INCLUDE_SPEED_CMD +static int ipcrypto_speed_main(int argc,char *argv[]) { ipcrypto_cmds_startup(); @@ -563,8 +532,8 @@ ipcrypto_speed_main(int argc,char *argv[]) } #endif -#ifdef IPCRYPTO_USE_VERSION_CMD -IP_STATIC int +#ifdef INCLUDE_VERSION_CMD +static int ipcrypto_version_main(int argc,char *argv[]) { ipcrypto_cmds_startup(); @@ -572,8 +541,8 @@ ipcrypto_version_main(int argc,char *argv[]) } #endif -#ifdef IPCRYPTO_USE_PKCS7_CMD -IP_STATIC int +#ifdef INCLUDE_PKCS7_CMD +static int ipcrypto_pkcs7_main(int argc,char *argv[]) { ipcrypto_cmds_startup(); @@ -581,8 +550,8 @@ ipcrypto_pkcs7_main(int argc,char *argv[]) } #endif -#ifdef IPCRYPTO_USE_CRL2PKCS7_CMD -IP_STATIC int +#ifdef INCLUDE_CRL2PKCS7_CMD +static int ipcrypto_crl2pkcs7_main(int argc,char *argv[]) { ipcrypto_cmds_startup(); @@ -590,8 +559,8 @@ ipcrypto_crl2pkcs7_main(int argc,char *argv[]) } #endif -#ifdef IPCRYPTO_USE_NSEQ_CMD -IP_STATIC int +#ifdef INCLUDE_NSEQ_CMD +static int ipcrypto_nseq_main(int argc,char *argv[]) { ipcrypto_cmds_startup(); @@ -599,8 +568,8 @@ ipcrypto_nseq_main(int argc,char *argv[]) } #endif -#ifdef IPCRYPTO_USE_PKCS12_CMD -IP_STATIC int +#ifdef INCLUDE_PKCS12_CMD +static int ipcrypto_pkcs12_main(int argc,char *argv[]) { ipcrypto_cmds_startup(); @@ -608,8 +577,8 @@ ipcrypto_pkcs12_main(int argc,char *argv[]) } #endif -#ifdef IPCRYPTO_USE_PKCS8_CMD -IP_STATIC int +#ifdef INCLUDE_PKCS8_CMD +static int ipcrypto_pkcs8_main(int argc,char *argv[]) { ipcrypto_cmds_startup(); @@ -617,8 +586,8 @@ ipcrypto_pkcs8_main(int argc,char *argv[]) } #endif -#ifdef IPCRYPTO_USE_SPKAC_CMD -IP_STATIC int +#ifdef INCLUDE_SPKAC_CMD +static int ipcrypto_spkac_main(int argc,char *argv[]) { ipcrypto_cmds_startup(); @@ -626,8 +595,8 @@ ipcrypto_spkac_main(int argc,char *argv[]) } #endif -#ifdef IPCRYPTO_USE_SMIME_CMD -IP_STATIC int +#ifdef INCLUDE_SMIME_CMD +static int ipcrypto_smime_main(int argc,char *argv[]) { ipcrypto_cmds_startup(); @@ -635,8 +604,8 @@ ipcrypto_smime_main(int argc,char *argv[]) } #endif -#ifdef IPCRYPTO_USE_RAND_CMD -IP_STATIC int +#ifdef INCLUDE_RAND_CMD +static int ipcrypto_rand_main(int argc,char *argv[]) { ipcrypto_cmds_startup(); @@ -644,8 +613,8 @@ ipcrypto_rand_main(int argc,char *argv[]) } #endif -#ifdef IPCRYPTO_USE_ENGINE_CMD -IP_STATIC int +#ifdef INCLUDE_ENGINE_CMD +static int ipcrypto_engine_main(int argc,char *argv[]) { ipcrypto_cmds_startup(); @@ -653,8 +622,8 @@ ipcrypto_engine_main(int argc,char *argv[]) } #endif -#ifdef IPCRYPTO_USE_OCSP_CMD -IP_STATIC int +#ifdef INCLUDE_OCSP_CMD +static int ipcrypto_ocsp_main(int argc,char *argv[]) { ipcrypto_cmds_startup(); @@ -662,17 +631,78 @@ ipcrypto_ocsp_main(int argc,char *argv[]) } #endif -#endif /* IPCOM_USE_SHELL != IPCOM_SHELL_NONE */ +#ifdef INCLUDE_ECPARAM_CMD +static int +ipcrypto_ecparam_main(int argc,char *argv[]) +{ + ipcrypto_cmds_startup(); + return ecparam_main(argc, argv); +} +#endif + +#ifdef INCLUDE_EC_CMD +static int ipcrypto_ec_main(int argc,char *argv[]) +{ + ipcrypto_cmds_startup(); + return ec_main(argc, argv); +} +#endif + +#ifdef INCLUDE_GENPKEY_CMD +static int +ipcrypto_genpkey_main(int argc,char *argv[]) +{ + ipcrypto_cmds_startup(); + return genpkey_main(argc, argv); +} +#endif + +#ifdef INCLUDE_PKEY_CMD +static int +ipcrypto_pkey_main(int argc,char *argv[]) +{ + ipcrypto_cmds_startup(); + return pkey_main(argc, argv); +} +#endif + +#ifdef INCLUDE_PKEYPARAM_CMD +static int +ipcrypto_pkeyparam_main(int argc,char *argv[]) +{ + ipcrypto_cmds_startup(); + return pkeyparam_main(argc, argv); +} +#endif + +#ifdef INCLUDE_PKEYUTL_CMD +static int +ipcrypto_pkeyutl_main(int argc,char *argv[]) +{ + ipcrypto_cmds_startup(); + return pkeyutl_main(argc, argv); +} +#endif + +#ifdef INCLUDE_STOREUTL_CMD +static int +ipcrypto_storeutl_main(int argc,char *argv[]) +{ + ipcrypto_cmds_startup(); + return storeutl_main(argc, argv); +} +#endif + /* **************************************************************************** - * 9 GLOBAL FUNCTIONS + * 10 GLOBAL FUNCTIONS **************************************************************************** */ /* **************************************************************************** - * 10 PUBLIC FUNCTIONS + * 11 PUBLIC FUNCTIONS **************************************************************************** */ @@ -681,231 +711,172 @@ ipcrypto_ocsp_main(int argc,char *argv[]) * ipcrypto_configure *=========================================================================== */ -IP_PUBLIC Ip_err +int ipcrypto_configure(void) { - /* Initialize IPCRYPTO system variables. */ - (void)ipcom_sysvar_setv(ipcrypto_conf_sysvar, IPCOM_SYSVAR_FLAG_OVERWRITE); +#ifdef INCLUDE_IPCOM_KEY_DB_CMD + (void)ipcrypto_shell_add_cmd("keydb", "keydb [options]", "Key DB admin command", + ipcom_cmd_keydb); +#endif -#if IPCOM_USE_SHELL != IPCOM_SHELL_NONE -#ifdef IPCRYPTO_USE_VERIFY_CMD - SHELL_ADD_CMD("verify", +#if defined(INCLUDE_VERIFY_CMD) + (void)ipcrypto_shell_add_cmd("verify", "verify [-verbose] [-CApath path] [-CAfile file] [-purpose purpose] cert1 cert2 ...", "X.509 Certificate Verification", ipcrypto_verify_main); #endif -#ifdef IPCRYPTO_USE_ASN1PARSE_CMD - SHELL_ADD_CMD("asn1parse", "asn1parse [options]", +#if defined(INCLUDE_ASN1PARSE_CMD) + (void)ipcrypto_shell_add_cmd("asn1parse", "asn1parse [options]", "Parse an ASN.1 sequence", ipcrypto_asn1parse_main); #endif -#ifdef IPCRYPTO_USE_REQ_CMD - SHELL_ADD_CMD("req", "req [options]", +#if defined(INCLUDE_REQ_CMD) + (void)ipcrypto_shell_add_cmd("req", "req [options]", "X.509 Certificate Signing Request (CSR) Management", ipcrypto_req_main); #endif -#ifdef IPCRYPTO_USE_DGST_CMD - SHELL_ADD_CMD("dgst", "dgst [options] [file ...]", "Message Digest Calculation", ipcrypto_dgst_main); +#if defined(INCLUDE_DGST_CMD) + (void)ipcrypto_shell_add_cmd("dgst", "dgst [options] [file ...]", "Message Digest Calculation", ipcrypto_dgst_main); #endif #ifndef OPENSSL_NO_DH -#ifdef IPCRYPTO_USE_DH_CMD - SHELL_ADD_CMD("dh", "dh [options]", +#if defined(INCLUDE_DH_CMD) + (void)ipcrypto_shell_add_cmd("dh", "dh [options]", "Diffie-Hellman Parameter Management. Obsoleted by dhparam", ipcrypto_dh_main); #endif -#ifdef IPCRYPTO_USE_DHPARAM_CMD - SHELL_ADD_CMD("dhparam", "dhparam [options] [numbits]", +#if defined(INCLUDE_DHPARAM_CMD) + (void)ipcrypto_shell_add_cmd("dhparam", "dhparam [options] [numbits]", "Generation and Management of Diffie-Hellman Parameters", ipcrypto_dhparam_main); #endif -#ifdef IPCRYPTO_USE_GENDH_CMD - SHELL_ADD_CMD("gendh", "x", "Generation of Diffie-Hellman Parameters. Obsoleted by dhparam", ipcrypto_gendh_main); +#if defined(INCLUDE_GENDH_CMD) + (void)ipcrypto_shell_add_cmd("gendh", "x", "Generation of Diffie-Hellman Parameters. Obsoleted by dhparam", ipcrypto_gendh_main); #endif #endif /* OPENSSL_NO_DH */ -#ifdef IPCRYPTO_USE_ENC_CMD - SHELL_ADD_CMD("enc", "enc [options]", "Encoding with Ciphers", ipcrypto_enc_main); +#if defined(INCLUDE_ENC_CMD) + (void)ipcrypto_shell_add_cmd("enc", "enc [options]", "Encoding with Ciphers", ipcrypto_enc_main); #endif -#ifdef IPCRYPTO_USE_PASSWD_CMD - SHELL_ADD_CMD("passwd", "passwd [options] [passwords]", "Generation of hashed passwords", ipcrypto_passwd_main); +#if defined(INCLUDE_PASSWD_CMD) + (void)ipcrypto_shell_add_cmd("passwd", "passwd [options] [passwords]", "Generation of hashed passwords", ipcrypto_passwd_main); #endif -#ifdef IPCRYPTO_USE_CA_CMD - SHELL_ADD_CMD("ca", "ca args", "Certificate Authority (CA) Management", ipcrypto_ca_main); +#if defined(INCLUDE_CA_CMD) + (void)ipcrypto_shell_add_cmd("ca", "ca args", "Certificate Authority (CA) Management", ipcrypto_ca_main); #endif -#ifdef IPCRYPTO_USE_CRL_CMD - SHELL_ADD_CMD("crl", "crl args", "Certificate Revocation List (CRL) Management", ipcrypto_crl_main); +#if defined(INCLUDE_CRL_CMD) + (void)ipcrypto_shell_add_cmd("crl", "crl args", "Certificate Revocation List (CRL) Management", ipcrypto_crl_main); #endif #ifndef OPENSSL_NO_RSA -#ifdef IPCRYPTO_USE_RSA_CMD - SHELL_ADD_CMD("rsa", "rsa [options]", "RSA Data Management", ipcrypto_rsa_main); +#if defined(INCLUDE_RSA_CMD) + (void)ipcrypto_shell_add_cmd("rsa", "rsa [options]", "RSA Data Management", ipcrypto_rsa_main); #endif -#ifdef IPCRYPTO_USE_RSAUTL_CMD - SHELL_ADD_CMD("rsautl", "rsautl [options]", +#if defined(INCLUDE_RSAUTL_CMD) + (void)ipcrypto_shell_add_cmd("rsautl", "rsautl [options]", "RSA utility for signing, verification, encryption, and decryption", ipcrypto_rsautl_main); #endif -#ifdef IPCRYPTO_USE_GENRSA_CMD - SHELL_ADD_CMD("genrsa", "genrsa [args] [numbits]", "Generation of RSA keys", ipcrypto_genrsa_main); +#if defined(INCLUDE_GENRSA_CMD) + (void)ipcrypto_shell_add_cmd("genrsa", "genrsa [args] [numbits]", "Generation of RSA keys", ipcrypto_genrsa_main); #endif #endif /* OPENSSL_NO_RSA */ #ifndef OPENSSL_NO_DSA -#ifdef IPCRYPTO_USE_DSA_CMD - SHELL_ADD_CMD("dsa", "dsa [options]", "DSA key processing", ipcrypto_dsa_main); +#if defined(INCLUDE_DSA_CMD) + (void)ipcrypto_shell_add_cmd("dsa", "dsa [options]", "DSA key processing", ipcrypto_dsa_main); #endif -#ifdef IPCRYPTO_USE_DSAPARAM_CMD - SHELL_ADD_CMD("dsaparam", "dsaparam [options]", "DSA parameter manipulation and generation", ipcrypto_dsaparam_main); +#if defined(INCLUDE_DSAPARAM_CMD) + (void)ipcrypto_shell_add_cmd("dsaparam", "dsaparam [options]", "DSA parameter manipulation and generation", ipcrypto_dsaparam_main); #endif -#ifdef IPCRYPTO_USE_GENDSA_CMD - SHELL_ADD_CMD("gendsa", "gendsa [args] dsaparam-file", +#if defined(INCLUDE_GENDSA_CMD) + (void)ipcrypto_shell_add_cmd("gendsa", "gendsa [args] dsaparam-file", "Generation of DSA Parameters", ipcrypto_gendsa_main); #endif #endif /* OPENSSL_NO_DSA */ -#ifdef IPCRYPTO_USE_X509_CMD - SHELL_ADD_CMD("x509", "x509 [options]", "Certificate display and signing utility", ipcrypto_x509_main); +#if defined(INCLUDE_X509_CMD) + (void)ipcrypto_shell_add_cmd("x509", "x509 [options]", "Certificate display and signing utility", ipcrypto_x509_main); #endif -#ifdef IPCRYPTO_USE_SPEED_CMD - SHELL_ADD_CMD("speed", "speed [options]", "Test encryption performance", ipcrypto_speed_main); +#if defined(INCLUDE_SPEED_CMD) + (void)ipcrypto_shell_add_cmd("speed", "speed [options]", "Test encryption performance", ipcrypto_speed_main); #endif -#ifdef IPCRYPTO_USE_PKCS7_CMD - SHELL_ADD_CMD("pkcs7", "pkcs7 [options]", "PKCS#7 Data Management", ipcrypto_pkcs7_main); +#if defined(INCLUDE_PKCS7_CMD) + (void)ipcrypto_shell_add_cmd("pkcs7", "pkcs7 [options]", "PKCS#7 Data Management", ipcrypto_pkcs7_main); #endif -#ifdef IPCRYPTO_USE_CRL2PKCS7_CMD - SHELL_ADD_CMD("crl2p7", "crl2p7 [options]", "CRL to PKCS#7 Conversion", ipcrypto_crl2pkcs7_main); +#if defined(INCLUDE_CRL2PKCS7_CMD) + (void)ipcrypto_shell_add_cmd("crl2p7", "crl2p7 [options]", "CRL to PKCS#7 Conversion", ipcrypto_crl2pkcs7_main); #endif -#ifdef IPCRYPTO_USE_NSEQ_CMD - SHELL_ADD_CMD("nseq", "nseq [options]", "Create or examine a netscape certificate sequence", ipcrypto_nseq_main); +#if defined(INCLUDE_NSEQ_CMD) + (void)ipcrypto_shell_add_cmd("nseq", "nseq [options]", "Create or examine a netscape certificate sequence", ipcrypto_nseq_main); #endif -#if defined(IPCRYPTO_USE_PKCS12_CMD) &&!defined(OPENSSL_NO_DES) && !defined(OPENSSL_NO_SHA1) - SHELL_ADD_CMD("pkcs12", "pkcs12 [options]", "PKCS#12 file utility", ipcrypto_pkcs12_main); +#if defined(INCLUDE_PKCS12_CMD) &&!defined(OPENSSL_NO_DES) && !defined(OPENSSL_NO_SHA1) + (void)ipcrypto_shell_add_cmd("pkcs12", "pkcs12 [options]", "PKCS#12 file utility", ipcrypto_pkcs12_main); #endif -#ifdef IPCRYPTO_USE_PKCS8_CMD - SHELL_ADD_CMD("pkcs8", "pkcs8 [options]", "PKCS#8 format private key conversion tool", ipcrypto_pkcs8_main); +#if defined(INCLUDE_PKCS8_CMD) + (void)ipcrypto_shell_add_cmd("pkcs8", "pkcs8 [options]", "PKCS#8 format private key conversion tool", ipcrypto_pkcs8_main); #endif -#ifdef IPCRYPTO_USE_SPKAC_CMD - SHELL_ADD_CMD("spkac", "spkac [options]", "SPKAC printing and generating utility", ipcrypto_spkac_main); +#if defined(INCLUDE_SPKAC_CMD) + (void)ipcrypto_shell_add_cmd("spkac", "spkac [options]", "SPKAC printing and generating utility", ipcrypto_spkac_main); #endif -#ifdef IPCRYPTO_USE_SMIME_CMD - SHELL_ADD_CMD("smime", "smime [options]", "S/MIME mail processing", ipcrypto_smime_main); +#if defined(INCLUDE_SMIME_CMD) + (void)ipcrypto_shell_add_cmd("smime", "smime [options]", "S/MIME mail processing", ipcrypto_smime_main); #endif -#ifdef IPCRYPTO_USE_RAND_CMD - SHELL_ADD_CMD("rand", "rand [options]", "Generate pseudo-random bytes", ipcrypto_rand_main); +#if defined(INCLUDE_RAND_CMD) + (void)ipcrypto_shell_add_cmd("rand", "rand [options]", "Generate pseudo-random bytes", ipcrypto_rand_main); #endif -#ifdef IPCRYPTO_USE_VERSION_CMD - SHELL_ADD_CMD("ipcrypto_ver", "ipcrypto_ver", "Show IPCRYPTO version", ipcrypto_version_main); +#if defined(INCLUDE_VERSION_CMD) + (void)ipcrypto_shell_add_cmd("ipcrypto_ver", "ipcrypto_ver", "Show IPCRYPTO version", ipcrypto_version_main); #endif -#ifdef IPCRYPTO_USE_ENGINE_CMD - SHELL_ADD_CMD("engine", "engine", "Hardware Crypto Support", ipcrypto_engine_main); +#if defined(INCLUDE_ENGINE_CMD) + (void)ipcrypto_shell_add_cmd("engine", "engine", "Hardware Crypto Support", ipcrypto_engine_main); #endif -#ifdef IPCRYPTO_USE_OCSP_CMD - SHELL_ADD_CMD("ocsp", "ocsp", "ocsp - Online Certificate Status Protocol utility", ipcrypto_ocsp_main); +#if defined(INCLUDE_OCSP_CMD) + (void)ipcrypto_shell_add_cmd("ocsp", "ocsp", "ocsp - Online Certificate Status Protocol utility", ipcrypto_ocsp_main); #endif -#ifdef OPENSSL_FIPS - SHELL_ADD_CMD("fips_ctrl", "fips_ctrl", "FIPS control command", ipcrypto_cmd_fips_ctrl); +#if defined(INCLUDE_ECPARAM_CMD) + (void)ipcrypto_shell_add_cmd("ecparam", "ecparam", "ecparam - Elliptic-curve parameter manipulation and generation", ipcrypto_ecparam_main); #endif -#ifdef IPCRYPTO_USE_TEST - SHELL_ADD_CMD("cmp", "cmp", "cmp", ipcrypto_cmd_cmp); - SHELL_ADD_CMD("sslmem", "sslmem", "sslmem", ipcrypto_cmd_memory); - - /* general test/ progs. */ - SHELL_ADD_CMD("bntest", "bntest", "Big number test utility.", bntest); - SHELL_ADD_CMD("exptest", "exptest", "Big number test utility.", exptest); -#ifndef OPENSSL_NO_EC - SHELL_ADD_CMD("ectest", "ectest", "ectest test utility.", ectest); - SHELL_ADD_CMD("ecdhtest", "ecdhtest", "ecdhtest test utility.", ecdhtest); - SHELL_ADD_CMD("ecdsatest", "ecdsatest", "ecdsatest test utility.", ecdsatest); -#endif -#ifndef OPENSSL_NO_ENGINE - SHELL_ADD_CMD("enginetest", "enginetest", "engine test utility.", enginetest); -#endif -#ifndef OPENSSL_NO_MD2 - SHELL_ADD_CMD("md2test", "md2test", "md2test test utility.", md2test); -#endif -#ifndef OPENSSL_NO_MD4 - SHELL_ADD_CMD("md4test", "md4test", "md4test test utility.", md4test); -#endif -#ifndef OPENSSL_NO_MD5 - SHELL_ADD_CMD("md5test", "md5test", "md5test test utility.", md5test); -#endif -#ifndef OPENSSL_NO_HMAC - SHELL_ADD_CMD("hmactest", "hmactest", "hmactest test utility.", hmactest); -#endif -#ifndef OPENSSL_NO_RC2 - SHELL_ADD_CMD("rc2test", "rc2test", "RC2 test utility.", rc2test); -#endif -#ifndef OPENSSL_NO_RC4 - SHELL_ADD_CMD("rc4test", "rc4test", "RC4 test utility.", rc4test); -#endif -#ifndef OPENSSL_NO_DES - SHELL_ADD_CMD("destest", "destest", "destest test utility.", destest); -#endif -#ifndef OPENSSL_NO_SHA -#ifndef OPENSSL_FIPS - SHELL_ADD_CMD("shatest", "shatest", "shatest test utility.", shatest); - SHELL_ADD_CMD("sha512test", "sha512test", "sha512 test utility.", sha512test); -#endif - SHELL_ADD_CMD("sha1test", "sha1test", "sha1test test utility.", sha1test); - -#endif -#ifndef OPENSSL_NO_MDC2 - SHELL_ADD_CMD("mdc2test", "mdc2test", "mdc2test test utility.", mdc2test); -#endif -#ifndef OPENSSL_NO_RIPEMD - SHELL_ADD_CMD("rmdtest", "rmdtest", "rmdtest test utility.", rmdtest); -#endif - SHELL_ADD_CMD("randtest", "randtest", "randtest test utility.", randtest); -#ifndef OPENSSL_NO_DH - SHELL_ADD_CMD("dhtest", "dhtest", "dhtest test utility.", dhtest); -#endif -#ifndef OPENSSL_NO_CAST - SHELL_ADD_CMD("casttest", "casttest", "casttest test utility.", casttest); -#endif -#ifndef OPENSSL_NO_BF - SHELL_ADD_CMD("bftest", "bftest", "bftest test utility.", bftest); -#endif -#ifndef OPENSSL_NO_DSA - SHELL_ADD_CMD("dsatest", "dsatest", "dsatest test utility.", dsatest); -#endif - SHELL_ADD_CMD("exptest", "exptest", "exptest test utility.", exptest); -#ifndef OPENSSL_NO_RSA - SHELL_ADD_CMD("rsa_test", "rsa_test", "rsa_test test utility.", rsa_test); -#endif -#ifndef OPENSSL_NO_EVP - SHELL_ADD_CMD("evp_test", "evp_test", "evp_test test utility.", evp_test); +#if defined(INCLUDE_EC_CMD) + (void)ipcrypto_shell_add_cmd("ec", "ec", "ec - Elliptic-curve key processing", ipcrypto_ec_main); #endif - SHELL_ADD_CMD("tabtest", "tabtest", "X509 test utility.", tabtest); - SHELL_ADD_CMD("cmactest", "cmactest", "AES-CMAC test utility.",ipcrypto_cmd_aescmac_test); - SHELL_ADD_CMD("aeskeywraptest", "aeskeywraptest", "AES-Keywrap test utility.",ipcrypto_cmd_aeskeywrap_test); - /* Openssl-1.0.1 have AES GCM and CCM support out of the box. For the time being we leave the WR - * modifications/additions for these algorithms out. We need to decide if we shall continue the - * support for the WR variants or if we shall rely on the std openssl variants only */ -#ifndef IPCRYPTO_OPENSSL_1_0_2 - SHELL_ADD_CMD("aesgcmtest", "aesgcmtest", "aesgcmtest", aesgcmtest_main); - SHELL_ADD_CMD("aes_ccm_test", "aes_ccm_test", "aes_ccm_test", aes_ccm_test_main); -#endif - SHELL_ADD_CMD("constant_time_test", "constant_time_test", "constant_time_test test utility.", constant_time_test); - -#endif /* IPCRYPTO_USE_TEST */ - -#endif /* IPCOM_USE_SHELL != IPCOM_SHELL_NONE */ - -#ifdef IPCRYPTO_USE_KEY_DB_EXAMPLE_KEYS - ipcrypto_key_db_install_example_keys(); +#if defined(INCLUDE_GENPKEY_CMD) + (void)ipcrypto_shell_add_cmd("genpkey", "genpkey", "genpkey - Generate a private key", ipcrypto_genpkey_main); #endif +#if defined(INCLUDE_PKEY_CMD) + (void)ipcrypto_shell_add_cmd("pkey", "pkey", "pkey - Public or private key processing command", ipcrypto_pkey_main); +#endif + +#if defined(INCLUDE_PKEYPARAM_CMD) + (void)ipcrypto_shell_add_cmd("pkeyparam", "pkeyparam", "pkeyparam - Public key algorithm parameter processing command", ipcrypto_pkeyparam_main); +#endif + +#if defined(INCLUDE_PKEYUTL_CMD) + (void)ipcrypto_shell_add_cmd("pkeyutl", "pkeyutl", "pkeyutl - Public key algorithm command", ipcrypto_pkeyutl_main); +#endif + +#if defined(INCLUDE_STOREUTL_CMD) + (void)ipcrypto_shell_add_cmd("storeutl", "storeutl", "storeutl - STORE command", ipcrypto_storeutl_main); +#endif /* No configuration to enter */ - return IPCOM_SUCCESS; + return 0; } +/* + *=========================================================================== + * ipcrypto_get_root_stack_size + *=========================================================================== + */ +size_t ipcrypto_get_root_stack_size(void) +{ + return ROOT_STACK_SIZE; +} /* **************************************************************************** * END OF FILE **************************************************************************** */ - diff --git a/components/ip_net2-6.9/ipcrypto/config/ipcrypto_config.h b/components/ip_net2-6.9/ipcrypto/config/ipcrypto_config.h index d8a4f611..ad99d2c1 100644 --- a/components/ip_net2-6.9/ipcrypto/config/ipcrypto_config.h +++ b/components/ip_net2-6.9/ipcrypto/config/ipcrypto_config.h @@ -1,16 +1,11 @@ /* - ****************************************************************************** - * INTERPEAK CONFIGURATION HEADER FILE + * Copyright (c) 2006-2014, 2021, 2024 Wind River Systems, Inc. * - * Document no: @(#) $Name: VXWORKS_ITER40_2019102207 $ $RCSfile: ipcrypto_config.h,v $ $Revision: 1.37.10.2 $ - * $Source: /home/interpeak/CVSRoot/ipcrypto/config/ipcrypto_config.h,v $ - * $Author: jli7 $ $Date: 2017-08-23 07:57:49 $ - * $State: Exp $ $Locker: $ - * - * Copyright Interpeak AB 2000-2003 . All rights reserved. - * Design and implementation by Roger Boden - ****************************************************************************** + * 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 @@ -30,30 +25,12 @@ #ifdef __cplusplus extern "C" { #endif - /* **************************************************************************** * 3 DEFINES **************************************************************************** */ -/* - *=========================================================================== - * IPCRYPTO_SYSLOG_PRIORITY - *=========================================================================== - * Default syslog priority. - */ -#ifdef IP_DEBUG -#define IPCRYPTO_SYSLOG_PRIORITY IPCOM_LOG_DEBUG /* (see ipcom_syslog.h) */ -#else -#define IPCRYPTO_SYSLOG_PRIORITY IPCOM_LOG_WARNING -#endif - - -#ifdef IP_SIZE -#define IPCRYPTO_MINIMUM_FOOTPRINT -#endif - #ifdef IPCRYPTO_MINIMUM_FOOTPRINT /* Hash algorithms */ @@ -87,13 +64,9 @@ extern "C" { /* The following algorithms have an unclear patent situation, hence we exclude them */ #define OPENSSL_NO_MDC2 -#ifndef IPCRYPTO_OPENSSL_1_0_2 -#define OPENSSL_NO_EC -#define OPENSSL_NO_ECDH -#define OPENSSL_NO_ECDSA -#endif #define OPENSSL_NO_IDEA + #ifdef OPENSSL_FIPS #define OPENSSL_NO_MD2 /*#define OPENSSL_NO_MD4*/ @@ -107,20 +80,6 @@ extern "C" { #define OPENSSL_NO_RC2 #endif -/* - *=========================================================================== - * OPENSSL_NO_S - *=========================================================================== - */ -#ifdef IPSSL -#include -#else -#define OPENSSL_NO_SSL2 -#define OPENSSL_NO_SSL3 -#define OPENSSL_NO_TLS -#define OPENSSL_NO_TLS1 -#endif - /* *=========================================================================== @@ -136,7 +95,7 @@ extern "C" { *=========================================================================== * Define to include openssl shell command applications. */ -#if !defined(IP_PORT_ITRON) && !defined(IP_PORT_WIN32) && !defined(IPCRYPTO_MINIMUM_FOOTPRINT) +#if !defined(IPCRYPTO_MINIMUM_FOOTPRINT) #define IPCRYPTO_USE_APPS #endif @@ -146,21 +105,12 @@ extern "C" { * IPCRYPTO_USE_TEST *=========================================================================== * Define to include openssl shell command test tools. -#if !defined(IP_PORT_ITRON) && !defined(IPCRYPTO_MINIMUM_FOOTPRINT) +#if !defined(IPCRYPTO_MINIMUM_FOOTPRINT) #endif */ #define IPCRYPTO_USE_TEST -/* - *=========================================================================== - * IPCRYPTO_USE_KEY_DB_EXAMPLE_KEYS - *=========================================================================== - * Define to install example DSA and RSA keys in the key db. - */ -#ifdef IPCOM_USE_KEY_DB -#define IPCRYPTO_USE_KEY_DB_EXAMPLE_KEYS -#endif /* **************************************************************************** diff --git a/components/ip_net2-6.9/ipdiameter/config/02comp_ipnet_diameter.cdf b/components/ip_net2-6.9/ipdiameter/config/02comp_ipnet_diameter.cdf index 03beee59..377a5f35 100644 --- a/components/ip_net2-6.9/ipdiameter/config/02comp_ipnet_diameter.cdf +++ b/components/ip_net2-6.9/ipdiameter/config/02comp_ipnet_diameter.cdf @@ -102,7 +102,7 @@ Component INCLUDE_IPDIAMETERP_CMD { Component INCLUDE_IPDIAMETER_TLS_CFG { NAME Diameter TLS Configuration SYNOPSIS Diameter TLS configuration parameters - REQUIRES INCLUDE_IPCRYPTO + REQUIRES INCLUDE_IPSSL CFG_PARAMS DIAMETER_TLS_ENABLED \ DIAMETER_TLS_CERTIFICATE \ DIAMETER_TLS_ROOT_CERTIFICATE \ @@ -275,7 +275,7 @@ Parameter DIAMETER_TLS_ENABLED { NAME Enable TLS SYNOPSIS Control whether TLS is enabled or not on the local node. \ If set to "1", TLS is enabled on the local node; if set \ - to "0", it is disabled. If TLS is enabled, IPCRYPTO and its \ + to "0", it is disabled. If TLS is enabled, IPSSL and its \ requirements must be built, the other Diameter TLS \ configuration parameters must be configured properly, \ and certiface files and private key file must be loaded. diff --git a/components/ip_net2-6.9/ipeap/config/02comp_ipnet_eap.cdf b/components/ip_net2-6.9/ipeap/config/02comp_ipnet_eap.cdf index bab19ac4..6b05bc3f 100644 --- a/components/ip_net2-6.9/ipeap/config/02comp_ipnet_eap.cdf +++ b/components/ip_net2-6.9/ipeap/config/02comp_ipnet_eap.cdf @@ -36,7 +36,7 @@ Component INCLUDE_IPEAP { #if defined(_WRS_CONFIG_IPEAP_USE_EAP_COMMON_TLS) || defined(_WRS_CONFIG_IPEAP_USE_EAP_SIM) || defined(_WRS_CONFIG_IPEAP_USE_EAP_AKA) Component INCLUDE_IPEAP { -REQUIRES INCLUDE_IPCRYPTO +REQUIRES INCLUDE_IPSSL } #endif diff --git a/components/ip_net2-6.9/ipssl2/config/02comp_ssl.cdf b/components/ip_net2-6.9/ipssl2/config/02comp_ssl.cdf index 3783ac09..290dcd5b 100644 --- a/components/ip_net2-6.9/ipssl2/config/02comp_ssl.cdf +++ b/components/ip_net2-6.9/ipssl2/config/02comp_ssl.cdf @@ -1,21 +1,11 @@ -/* 02comp_ipnet_ssl.cdf - IPSSL configuration file */ - /* - * Copyright (c) 2007 Wind River Systems, Inc. + * Copyright (c) 2014, 2016, 2018, 2021-2022, 2024 Wind River Systems, Inc. * - * The right to copy, distribute or otherwise make use of this software - * may be licensed only pursuant to the terms of an applicable Wind River - * license agreement. No license to Wind River intellectual property rights - * is granted herein. All rights not licensed by Wind River are reserved - * by Wind River. + * 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. */ -/* -modification history --------------------- -01a,10sep07,mze re-added missing LINK_SYMS -*/ - Folder FOLDER_SSL { NAME SSL Components @@ -25,10 +15,14 @@ Folder FOLDER_SSL Component INCLUDE_IPSSL { - NAME SSL + NAME SSL module _CHILDREN FOLDER_SSL - SYNOPSIS SSL Library + SYNOPSIS This component includes Wind River SSL in the image + and loads the ciphers. CONFIGLETTES ipssl_config.c + INIT_RTN ipssl_init(); + _INIT_ORDER usrToolsInit + INIT_AFTER INCLUDE_IPCRYPTO MODULES ipssl.o REQUIRES INCLUDE_IPCRYPTO } @@ -37,7 +31,9 @@ Component INCLUDE_IPSSL_USE_CMDS { NAME SSL Cmds _CHILDREN FOLDER_SSL - SYNOPSIS SSL Cmds + MODULES ipssl_cmds.o + SYNOPSIS This component enables the command-interpreter commands \ + ciphers: s_client, s_server, s_time, ssl_clt, and ssl_srv. LINK_SYMS ipssl_cmd_ssl_srv \ ipssl_cmd_ssl_clt \ s_time_main \ @@ -46,13 +42,3 @@ Component INCLUDE_IPSSL_USE_CMDS REQUIRES INCLUDE_IPSSL } -Component INCLUDE_IPSSL_USE_TEST_CMDS - { - NAME SSL Test Cmds - _CHILDREN FOLDER_SSL - SYNOPSIS SSL Test Cmds - LINK_SYMS ssltest_main - REQUIRES INCLUDE_IPSSL - } - - diff --git a/components/ip_net2-6.9/ipssl2/config/ipssl.c b/components/ip_net2-6.9/ipssl2/config/ipssl.c new file mode 100644 index 00000000..23b45c3d --- /dev/null +++ b/components/ip_net2-6.9/ipssl2/config/ipssl.c @@ -0,0 +1,175 @@ +/* + ****************************************************************************** + * INTERPEAK SOURCE FILE + * + * Document no: @(#) $Name: VXWORKS_ITER40_2019102207 $ $RCSfile: ipssl.c,v $ $Revision: 1.18 $ + * $Source: /home/interpeak/CVSRoot/ipssl2/src/ipssl.c,v $ + * $Author: rboden $ + * $State: Exp $ $Locker: $ + * + * Copyright Interpeak AB 2000-2004 . All rights reserved. + * Design and implementation by Roger Boden + ****************************************************************************** + */ + + +/* + **************************************************************************** + * 1 DESCRIPTION + **************************************************************************** + */ + +/* + **************************************************************************** + * 2 CONFIGURATION + **************************************************************************** + */ + +#include "ipssl_config.h" + + +/* + **************************************************************************** + * 3 INCLUDE FILES + **************************************************************************** + */ + +#include +#include +#include +#include +#include +#include + +#include + + +/* + **************************************************************************** + * 4 DEFINES + **************************************************************************** + */ + +/* + **************************************************************************** + * 5 TYPES + **************************************************************************** + */ + +/* + **************************************************************************** + * 6 EXTERN PROTOTYPES + **************************************************************************** + */ + +void ssl_load_ciphers(void); + +/* + **************************************************************************** + * 7 LOCAL PROTOTYPES + **************************************************************************** + */ + +IP_PUBLIC Ip_fd ipssl_get_stdio_fd(void); +IP_PUBLIC const char *ipssl_version(void); +IP_GLOBAL int SSL_library_init(void); + + +/* + **************************************************************************** + * 8 DATA + **************************************************************************** + */ + +/* + **************************************************************************** + * 9 STATIC FUNCTIONS + **************************************************************************** + */ + +/* + **************************************************************************** + * 10 GLOBAL FUNCTIONS + **************************************************************************** + */ + +IP_GLOBAL int +SSL_library_init(void) +{ + return 1; +} + +/* + **************************************************************************** + * 11 PUBLIC FUNCTIONS + **************************************************************************** + */ + +/* + *=========================================================================== + * ipssl_create + *=========================================================================== + */ +IP_PUBLIC Ip_err +ipssl_create() +{ + ssl_load_ciphers(); + return IPCOM_SUCCESS; +} + + +/* + *=========================================================================== + * ipssl_get_stdio_fd + *=========================================================================== + */ +IP_PUBLIC Ip_fd +ipssl_get_stdio_fd(void) +{ +#if IPCOM_USE_SHELL == IPCOM_SHELL_IPCOM + Ipcom_proc *proc; + + /* Find my shell socket. */ + proc = ipcom_proc_self(); + if(proc != IP_NULL) + return proc->shell_fd; + else + return IP_INVALID_SOCKET; +#endif + + return ipcom_fileno(ip_stdin); +} + +/* + *=========================================================================== + * ipssl_start + *=========================================================================== + */ +IP_PUBLIC Ip_err +ipssl_start(void) +{ + return IPCOM_SUCCESS; +} + + +/* + *=========================================================================== + * ipssl_version + *=========================================================================== + * Description: + * Parameters: + * Returns: + * + */ +IP_PUBLIC const char * +ipssl_version(void) +{ + return "@(#) IPSSL $Name: VXWORKS_ITER40_2019102207 $ - INTERPEAK_COPYRIGHT_STRING"; +} + +/* + **************************************************************************** + * END OF FILE + **************************************************************************** + */ + diff --git a/components/ip_net2-6.9/ipssl2/config/ipssl_config.c b/components/ip_net2-6.9/ipssl2/config/ipssl_config.c index 850cbcd0..dd1cef46 100644 --- a/components/ip_net2-6.9/ipssl2/config/ipssl_config.c +++ b/components/ip_net2-6.9/ipssl2/config/ipssl_config.c @@ -1,15 +1,9 @@ /* - ****************************************************************************** - * INTERPEAK CONFIGURATION SOURCE FILE + * Copyright (c) 2006-2014, 2016, 2021, 2024 Wind River Systems, Inc. * - * Document no: @(#) $Name: VXWORKS_ITER40_2019102207 $ $RCSfile: ipssl_config.c,v $ $Revision: 1.10 $ - * $Source: /home/interpeak/CVSRoot/ipssl2/config/ipssl_config.c,v $ - * $Author: rboden $ - * $State: Exp $ $Locker: $ - * - * Copyright Interpeak AB 2000-2003 . All rights reserved. - * Design and implementation by Roger Boden - ****************************************************************************** + * 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. */ @@ -24,21 +18,16 @@ * 2 INCLUDE FILES **************************************************************************** */ - -#include "ipssl.h" -#include "ipssl_config.h" - -#include -#include -#include -#include -#include +#include +#include /* **************************************************************************** * 3 DEFINES **************************************************************************** */ +#define IPSSL_USE_TEST_CMDS +#define IPSSL_USE_CMDS #ifdef PRJ_BUILD @@ -48,108 +37,59 @@ #ifdef INCLUDE_IPSSL_USE_TEST_CMDS #define IPSSL_USE_TEST_CMDS #endif +#ifdef INCLUDE_IPSSL_USE_CMDS +#define IPSSL_USE_CMDS +#endif #endif /* PRJ_BUILD */ -#if defined(IPSSL_USE_CMDS) && !defined(IP_PORT_VXWORKS) || defined(INCLUDE_IPSSL_USE_CMDS) - -/* - *=========================================================================== - * IPSSL_USE_CIPHERS_CMD - *=========================================================================== - * Define to include the ciphers shell command - */ -#ifndef IP_PORT_LAS +#if defined(IPSSL_USE_CMDS) && defined(INCLUDE_IPSSL_USE_CMDS) #define IPSSL_USE_CIPHERS_CMD -#endif - -/* - *=========================================================================== - * IPSSL_USE_S_CLIENT_CMD - *=========================================================================== - * Define to include the s_client shell command - */ -#if !defined(IP_PORT_ITRON) && !defined(IP_PORT_LAS) #define IPSSL_USE_S_CLIENT_CMD -#endif - -/* - *=========================================================================== - * IPSSL_USE_S_SERVER_CMD - *=========================================================================== - * Define to include the s_server shell command - */ -#if !defined(IP_PORT_ITRON) && !defined(IP_PORT_LAS) #define IPSSL_USE_S_SERVER_CMD -#endif - -/* - *=========================================================================== - * IPSSL_USE_S_TIME_CMD - *=========================================================================== - * Define to include the s_time shell command - */ -#ifndef IP_PORT_LAS #define IPSSL_USE_S_TIME_CMD -#endif - -/* - *=========================================================================== - * IPSSL_USE_SSL_SRV_CMD - *=========================================================================== - * Define to include the ssl_srv shell command - */ -#ifndef IP_PORT_LAS +#ifdef INCLUDE_IPNET #define IPSSL_USE_SSL_SRV_CMD -#endif - -/* - *=========================================================================== - * IPSSL_USE_SSL_CLT_CMD - *=========================================================================== - * Define to include the ssl_clt shell command - */ -#ifndef IP_PORT_LAS #define IPSSL_USE_SSL_CLT_CMD -#endif - +#endif /*INCLUDE_IPNET*/ #endif /* IPSSL_USE_CMDS */ - -/* - **************************************************************************** - * 4 TYPES - **************************************************************************** - */ - -/* - **************************************************************************** - * 5 EXTERN PROTOTYPES - **************************************************************************** - */ - +extern int ipssl_init(void); /* **************************************************************************** * 6 LOCAL PROTOTYPES **************************************************************************** */ #ifdef IPSSL_USE_CMDS -IP_PUBLIC void ipcrypto_cmds_startup(void); + void ipcrypto_cmds_startup(void); + +#ifndef OPENSSL_NO_STDIO #ifdef IPSSL_USE_CIPHERS_CMD -IP_PUBLIC int ciphers_main(int argc, char** argv); + int ciphers_main(int argc, char** argv); #endif #ifdef IPSSL_USE_S_CLIENT_CMD -IP_PUBLIC int s_client_main(int argc, char** argv); + int s_client_main(int argc, char** argv); #endif #ifdef IPSSL_USE_S_SERVER_CMD -IP_PUBLIC int s_server_main(int argc, char** argv); + int s_server_main(int argc, char** argv); #endif #ifdef IPSSL_USE_S_TIME_CMD -IP_PUBLIC int s_time_main(int argc, char** argv); + int s_time_main(int argc, char** argv); #endif +#ifdef IPSSL_USE_SSL_CLT_CMD + int ipssl_cmd_ssl_clt(int argc, char** argv); +#endif +#ifdef IPSSL_USE_SSL_SRV_CMD + int ipssl_cmd_ssl_srv(int argc, char** argv); +#endif +#ifdef IPSSL_USE_TEST_CMDS + int ssltest_main(int argc, char** argv); #endif -IP_PUBLIC Ip_err ipssl_configure(void); +#endif /*OPENSSL_NO_STDIO*/ +#endif /*IPSSL_USE_CMDS*/ + + /* **************************************************************************** @@ -163,48 +103,48 @@ IP_PUBLIC Ip_err ipssl_configure(void); **************************************************************************** */ -#ifdef IPSSL_USE_CIPHERS_CMD -IP_GLOBAL int -ipssl_ciphers(int argc, char** argv) -{ - ipcrypto_cmds_startup(); - return ciphers_main(argc, argv); -} -#endif - -#ifdef IPSSL_USE_S_TIME_CMD -IP_GLOBAL int -ipssl_s_time(int argc, char** argv) -{ - ipcrypto_cmds_startup(); - return s_time_main(argc, argv); -} -#endif - -#ifdef IPSSL_USE_S_CLIENT_CMD -IP_GLOBAL int -ipssl_s_client(int argc, char** argv) -{ - ipcrypto_cmds_startup(); - return s_client_main(argc, argv); -} -#endif - -#ifdef IPSSL_USE_S_SERVER_CMD -IP_GLOBAL int -ipssl_s_server(int argc, char** argv) -{ - ipcrypto_cmds_startup(); - return s_server_main(argc, argv); -} -#endif - /* **************************************************************************** * 9 GLOBAL FUNCTIONS **************************************************************************** */ +#if defined(IPSSL_USE_CIPHERS_CMD) && !defined(OPENSSL_NO_STDIO) + int + ipssl_ciphers(int argc, char** argv) + { + ipcrypto_cmds_startup(); + return ciphers_main(argc, argv); + } +#endif + +#if defined(IPSSL_USE_S_TIME_CMD) && !defined(OPENSSL_NO_STDIO) + int + ipssl_s_time(int argc, char** argv) + { + ipcrypto_cmds_startup(); + return s_time_main(argc, argv); + } +#endif + +#if defined(IPSSL_USE_S_CLIENT_CMD) && !defined(OPENSSL_NO_STDIO) + int + ipssl_s_client(int argc, char** argv) + { + ipcrypto_cmds_startup(); + return s_client_main(argc, argv); + } +#endif + +#if defined(IPSSL_USE_S_SERVER_CMD) && !defined(OPENSSL_NO_STDIO) + int + ipssl_s_server(int argc, char** argv) + { + ipcrypto_cmds_startup(); + return s_server_main(argc, argv); + } +#endif + /* **************************************************************************** * 10 PUBLIC FUNCTIONS @@ -216,41 +156,36 @@ ipssl_s_server(int argc, char** argv) * ipssl_configure *=========================================================================== */ -IP_PUBLIC Ip_err +int ipssl_configure(void) { +#ifndef OPENSSL_NO_STDIO #ifdef IPSSL_USE_CIPHERS_CMD - ipcom_shell_add_cmd("ciphers", "ciphers", "SSL Cipher Suites", ipssl_ciphers, - IPCOM_PRIORITY_DEFAULT, IPCOM_PROC_STACK_MAX); + (void)ipcrypto_shell_add_cmd("ciphers", "ciphers", "SSL Cipher Suites", ipssl_ciphers); #endif + #ifdef IPSSL_USE_S_CLIENT_CMD - ipcom_shell_add_cmd("s_client", "s_client", "SSL client", ipssl_s_client, - IPCOM_PRIORITY_DEFAULT, IPCOM_PROC_STACK_MAX); + (void)ipcrypto_shell_add_cmd("s_client", "s_client", "SSL client", ipssl_s_client); #endif + #ifdef IPSSL_USE_S_SERVER_CMD - ipcom_shell_add_cmd("s_server", "s_server", "SSL server", ipssl_s_server, - IPCOM_PRIORITY_DEFAULT, IPCOM_PROC_STACK_MAX); + (void)ipcrypto_shell_add_cmd("s_server", "s_server", "SSL server", ipssl_s_server); #endif + #ifdef IPSSL_USE_S_TIME_CMD - ipcom_shell_add_cmd("s_time", "s_time", "Time SSL connection", ipssl_s_time, - IPCOM_PRIORITY_DEFAULT, IPCOM_PROC_STACK_MAX); + (void)ipcrypto_shell_add_cmd("s_time", "s_time", "Time SSL connection", ipssl_s_time); #endif - +#ifdef _WRS_CONFIG_IPNET_COREIP #ifdef IPSSL_USE_SSL_CLT_CMD - ipcom_shell_add_cmd("ssl_clt", "ssl_clt", "SSL client for performance measurements ", ipssl_cmd_ssl_clt, - IPCOM_PRIORITY_DEFAULT, IPCOM_PROC_STACK_MAX); + (void)ipcrypto_shell_add_cmd("ssl_clt", "ssl_clt", "SSL client for performance measurements ", ipssl_cmd_ssl_clt); #endif + #ifdef IPSSL_USE_SSL_SRV_CMD - ipcom_shell_add_cmd("ssl_srv", "ssl_srv", "SSL server for performance measurements ", ipssl_cmd_ssl_srv, - IPCOM_PRIORITY_DEFAULT, IPCOM_PROC_STACK_MAX); + (void)ipcrypto_shell_add_cmd("ssl_srv", "ssl_srv", "SSL server for performance measurements ", ipssl_cmd_ssl_srv); #endif - -#ifdef IPSSL_USE_TEST_CMDS - ipcom_shell_add_cmd("ssltest", "ssltest", "ssltest", ssltest_main, - IPCOM_PRIORITY_DEFAULT, (64*1024-1)); +#endif /*_WRS_CONFIG_IPNET_COREIP*/ #endif - - return IPCOM_SUCCESS; + return 0; } @@ -259,4 +194,3 @@ ipssl_configure(void) * END OF FILE **************************************************************************** */ - diff --git a/vxworks-6.9/target/config/comps/vxWorks/01comp_ossl.cdf b/vxworks-6.9/target/config/comps/vxWorks/01comp_ossl.cdf deleted file mode 100644 index 2fb102ba..00000000 --- a/vxworks-6.9/target/config/comps/vxWorks/01comp_ossl.cdf +++ /dev/null @@ -1,29 +0,0 @@ -/* 02comp_ossl.cdf - OpenSSL 3.5.0 configuration file */ - -/* - * Copyright (c) 2026 Wind River Systems, Inc. - * - * The right to copy, distribute or otherwise make use of this software - * may be licensed only pursuant to the terms of an applicable Wind River - * license agreement. No license to Wind River intellectual property rights - * is granted herein. All rights not licensed by Wind River are reserved - * by Wind River. - */ - -/* -modification history --------------------- -01a.22may26,ssp created -*/ - - -Component INCLUDE_OPENSSL_350_SHELL_CMDS - { - NAME OpenSSL 3.5.0 Commands - _CHILDREN FOLDER_CRYPTO - SYNOPSIS OpenSSL version 3.5.0 Commands - CONFIGLETTES addOssl350ShellCmds.c - _INIT_ORDER usrToolsInit - INIT_RTN addOssl350ShellCmds (); - REQUIRES INCLUDE_IPCRYPTO - } diff --git a/vxworks-6.9/target/src/openssl/ipcrypto/Makefile b/vxworks-6.9/target/src/openssl/ipcrypto/Makefile index a169f51f..29e763f6 100644 --- a/vxworks-6.9/target/src/openssl/ipcrypto/Makefile +++ b/vxworks-6.9/target/src/openssl/ipcrypto/Makefile @@ -63,6 +63,7 @@ OBJS += ipcrypto_util.o OBJS += ipcrypto.o OBJS += ipcrypto_aescmac.o OBJS += ipcrypto_start.o +OBJS += ipssl_start.o include $(WIND_BASE)/target/h/make/rules.library 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 044d19cf..604a2b08 100644 --- a/vxworks-6.9/target/src/openssl/ipcrypto/ipssl_cmds.c +++ b/vxworks-6.9/target/src/openssl/ipcrypto/ipssl_cmds.c @@ -27,6 +27,8 @@ * 3 INCLUDE FILES **************************************************************************** */ +#define IPCOM_USE_SHELL IPCOM_SHELL_NATIVE + #include #include #include @@ -50,7 +52,6 @@ #define IPSSL_CMD_PORT 5005 #define IPSSL_CMD_BUF_LEN 1440 #define IPSSL_CMD_TIME 3 - /* **************************************************************************** * 5 TYPES diff --git a/vxworks-6.9/target/src/openssl/ipcrypto/ipssl_start.c b/vxworks-6.9/target/src/openssl/ipcrypto/ipssl_start.c new file mode 100644 index 00000000..7c6f74da --- /dev/null +++ b/vxworks-6.9/target/src/openssl/ipcrypto/ipssl_start.c @@ -0,0 +1,168 @@ +/* + ****************************************************************************** + * INTERPEAK SOURCE FILE + * + * Document no: @(#) $Name: VXWORKS_ITER40_2019102207 $ $RCSfile: ipssl.c,v $ $Revision: 1.18 $ + * $Source: /home/interpeak/CVSRoot/ipssl2/src/ipssl.c,v $ + * $Author: rboden $ + * $State: Exp $ $Locker: $ + * + * Copyright Interpeak AB 2000-2004 . All rights reserved. + * Design and implementation by Roger Boden + ****************************************************************************** + */ + + +/* + **************************************************************************** + * 1 DESCRIPTION + **************************************************************************** + */ + +/* + **************************************************************************** + * 2 CONFIGURATION + **************************************************************************** + */ + +/* + **************************************************************************** + * 3 INCLUDE FILES + **************************************************************************** + */ + +#include +#include +#include +#include +#include +#include + +/* + **************************************************************************** + * 4 DEFINES + **************************************************************************** + */ + +/* + **************************************************************************** + * 5 TYPES + **************************************************************************** + */ + +/* + **************************************************************************** + * 6 EXTERN PROTOTYPES + **************************************************************************** + */ + +void ssl_load_ciphers(void); + +/* + **************************************************************************** + * 7 LOCAL PROTOTYPES + **************************************************************************** + */ + +IP_PUBLIC Ip_fd ipssl_get_stdio_fd(void); +IP_PUBLIC const char *ipssl_version(void); +IP_GLOBAL int SSL_library_init(void); + + +/* + **************************************************************************** + * 8 DATA + **************************************************************************** + */ + +/* + **************************************************************************** + * 9 STATIC FUNCTIONS + **************************************************************************** + */ + +/* + **************************************************************************** + * 10 GLOBAL FUNCTIONS + **************************************************************************** + */ + +IP_GLOBAL int +SSL_library_init(void) +{ + return 1; +} + +/* + **************************************************************************** + * 11 PUBLIC FUNCTIONS + **************************************************************************** + */ + +/* + *=========================================================================== + * ipssl_create + *=========================================================================== + */ +IP_PUBLIC Ip_err +ipssl_create() +{ + return IPCOM_SUCCESS; +} + + +/* + *=========================================================================== + * ipssl_get_stdio_fd + *=========================================================================== + */ +IP_PUBLIC Ip_fd +ipssl_get_stdio_fd(void) +{ +#if IPCOM_USE_SHELL == IPCOM_SHELL_IPCOM + Ipcom_proc *proc; + + /* Find my shell socket. */ + proc = ipcom_proc_self(); + if(proc != IP_NULL) + return proc->shell_fd; + else + return IP_INVALID_SOCKET; +#endif + + return ipcom_fileno(ip_stdin); +} + +/* + *=========================================================================== + * ipssl_start + *=========================================================================== + */ +IP_PUBLIC Ip_err +ipssl_start(void) +{ + return IPCOM_SUCCESS; +} + + +/* + *=========================================================================== + * ipssl_version + *=========================================================================== + * Description: + * Parameters: + * Returns: + * + */ +IP_PUBLIC const char * +ipssl_version(void) +{ + return "@(#) IPSSL $Name: VXWORKS_ITER40_2019102207 $ - INTERPEAK_COPYRIGHT_STRING"; +} + +/* + **************************************************************************** + * END OF FILE + **************************************************************************** + */ + diff --git a/vxworks-6.9/target/src/openssl/ipcrypto/ipssl_start.h b/vxworks-6.9/target/src/openssl/ipcrypto/ipssl_start.h new file mode 100644 index 00000000..d0a7aa79 --- /dev/null +++ b/vxworks-6.9/target/src/openssl/ipcrypto/ipssl_start.h @@ -0,0 +1,125 @@ +/* + ****************************************************************************** + * INTERPEAK API HEADER FILE + * + * Document no: @(#) $Name: VXWORKS_ITER40_2019102207 $ $RCSfile: ipssl.h,v $ $Revision: 1.9.10.2 $ + * $Source: /home/interpeak/CVSRoot/ipssl2/include/ipssl.h,v $ + * $Author: jli7 $ $Date: 2016-12-20 08:08:58 $ + * $State: Exp $ $Locker: $ + * + * Copyright Interpeak AB 2000-2007 . All rights reserved. + * Design and implementation by Roger Boden + ****************************************************************************** + */ +#ifndef IPSSL_H +#define IPSSL_H + +/* + **************************************************************************** + * 1 DESCRIPTION + **************************************************************************** + */ + +/* + **************************************************************************** + * 2 CONFIGURATION + **************************************************************************** + */ + + + +/* + **************************************************************************** + * 3 INCLUDE FILES + **************************************************************************** + */ + +#include +#include + +#include "ipssl_config.h" + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* + **************************************************************************** + * 4 DEFINES + **************************************************************************** + */ + +#define IPSSL_RELEASE 60900 + +/* + **************************************************************************** + * 5 TYPES + **************************************************************************** + */ + +/* + **************************************************************************** + * 6 FUNCTIONS + **************************************************************************** + */ + +#ifdef IPSSL_USE_CMDS +#ifdef IPSSL_USE_CIPHERS_CMD + IP_GLOBAL int ipssl_ciphers(int argc, char** argv); +#endif + +#ifdef IPSSL_USE_S_CLIENT_CMD + IP_GLOBAL int ipssl_s_client(int argc, char** argv); +#endif + +#ifdef IPSSL_USE_S_SERVER_CMD + IP_GLOBAL int ipssl_s_server(int argc, char** argv); +#endif + +#ifdef IPSSL_USE_S_TIME_CMD + IP_GLOBAL int ipssl_s_time(int argc, char** argv); +#endif + + IP_GLOBAL int ipssl_cmd_ssl_clt(int argc, char** argv); + + IP_GLOBAL int ipssl_cmd_ssl_srv(int argc, char** argv); +#endif /* IPSSL_USE_CMDS */ + +#ifdef IPSSL_USE_TEST_CMDS + IP_PUBLIC int ssltest_main(int argc, char** argv); +#endif + + IP_PUBLIC Ip_err ipssl_create(void); + IP_PUBLIC Ip_err ipssl_start(void); + +#ifdef IPCRYPTO_OPENSSL_1_0_2 + + void ipssl_tls1_PRF(long digest_mask, + const void *seed1, int seed1_len, + const void *seed2, int seed2_len, + const void *seed3, int seed3_len, + const void *seed4, int seed4_len, + const void *seed5, int seed5_len, + const unsigned char *sec, int slen, + unsigned char *out1, + unsigned char *out2, int olen); + +#else + void ipssl_tls1_PRF(const EVP_MD *md5, const EVP_MD *sha1, + unsigned char *label, int label_len, + const unsigned char *sec, int slen, unsigned char *out1, + unsigned char *out2, int olen); +#endif +#ifdef __cplusplus +} +#endif + +#endif + +/* + **************************************************************************** + * END OF FILE + **************************************************************************** + */