Reviewed-on: http://13.234.246.121:3000/Neominds/ossl35vx69/pulls/73 Co-authored-by: siddhant <siddhant.singh@neominds.in> Co-committed-by: siddhant <siddhant.singh@neominds.in>
889 lines
24 KiB
C
889 lines
24 KiB
C
/*
|
|
* Copyright (c) 2006-2014, 2016-2019, 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.
|
|
*/
|
|
|
|
/*
|
|
****************************************************************************
|
|
* 1 DESCRIPTION
|
|
****************************************************************************
|
|
*/
|
|
|
|
/*
|
|
****************************************************************************
|
|
* 2 INCLUDE FILES
|
|
****************************************************************************
|
|
*/
|
|
#include "ipcrypto_util.h"
|
|
#include "ipcrypto_shell.h"
|
|
#include "ipcrypto_config.h"
|
|
|
|
/*
|
|
****************************************************************************
|
|
* 3 DEFINES
|
|
****************************************************************************
|
|
*/
|
|
|
|
|
|
/*
|
|
****************************************************************************
|
|
* 4 TYPES
|
|
****************************************************************************
|
|
*/
|
|
|
|
|
|
/*
|
|
****************************************************************************
|
|
* 5 LOCAL PROTOTYPES
|
|
****************************************************************************
|
|
*/
|
|
|
|
|
|
/*
|
|
****************************************************************************
|
|
* 6 EXTERN PROTOTYPES
|
|
****************************************************************************
|
|
*/
|
|
|
|
int ipcom_cmd_keydb(int argc, char** argv);
|
|
|
|
/*
|
|
*===========================================================================
|
|
* apps
|
|
*===========================================================================
|
|
*/
|
|
|
|
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[]);
|
|
/*
|
|
* 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[]);
|
|
/*
|
|
* 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[]);
|
|
extern int rsautl_main(int argc,char *argv[]);
|
|
extern int dsa_main(int argc,char *argv[]);
|
|
extern int dsaparam_main(int argc,char *argv[]);
|
|
extern int x509_main(int argc,char *argv[]);
|
|
extern int genrsa_main(int argc,char *argv[]);
|
|
extern int gendsa_main(int argc,char *argv[]);
|
|
extern int speed_main(int argc,char *argv[]);
|
|
extern int version_main(int argc,char *argv[]);
|
|
extern int pkcs7_main(int argc,char *argv[]);
|
|
extern int crl2pkcs7_main(int argc,char *argv[]);
|
|
extern int nseq_main(int argc,char *argv[]);
|
|
extern int pkcs12_main(int argc,char *argv[]);
|
|
extern int pkcs8_main(int argc,char *argv[]);
|
|
extern int spkac_main(int argc,char *argv[]);
|
|
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_init(void);
|
|
|
|
/*
|
|
*===========================================================================
|
|
* test
|
|
*===========================================================================
|
|
*/
|
|
extern int bftest(int argc, char **argv);
|
|
extern int bntest(int argc, char **argv);
|
|
extern int divtest(int argc, char **argv);
|
|
extern int exptest(int argc, char **argv);
|
|
extern int casttest(int argc, char **argv);
|
|
extern int destest(int argc, char **argv);
|
|
extern int dhtest(int argc, char **argv);
|
|
extern int dsatest(int argc, char **argv);
|
|
extern int ectest(int argc, char **argv);
|
|
extern int ecdhtest(int argc, char **argv);
|
|
extern int ecdsatest(int argc, char **argv);
|
|
extern int enginetest(int argc, char **argv);
|
|
extern int hmactest(int argc, char **argv);
|
|
extern int evp_test(int argc, char **argv);
|
|
extern int hmactest(int argc, char **argv);
|
|
extern int md2test(int argc, char **argv);
|
|
extern int md4test(int argc, char **argv);
|
|
extern int md5test(int argc, char **argv);
|
|
extern int mdc2test(int argc, char **argv);
|
|
extern int randtest(int argc, char **argv);
|
|
extern int rc2test(int argc, char **argv);
|
|
extern int rc4test(int argc, char **argv);
|
|
extern int rc5test(int argc, char **argv);
|
|
extern int rmdtest(int argc, char **argv);
|
|
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 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);
|
|
|
|
/*
|
|
****************************************************************************
|
|
* 7 LOCAL PROTOTYPES
|
|
****************************************************************************
|
|
*/
|
|
|
|
#ifdef INCLUDE_VERIFY_CMD
|
|
static int ipcrypto_verify_main(int argc, char ** argv);
|
|
#endif
|
|
|
|
#ifdef INCLUDE_ASN1PARSE_CMD
|
|
static int ipcrypto_asn1parse_main(int argc, char ** argv);
|
|
#endif
|
|
|
|
#ifdef INCLUDE_REQ_CMD
|
|
static int ipcrypto_req_main(int argc,char *argv[]);
|
|
#endif
|
|
|
|
#ifdef INCLUDE_DGST_CMD
|
|
static int ipcrypto_dgst_main(int argc,char *argv[]);
|
|
#endif
|
|
|
|
#ifdef INCLUDE_DH_CMD
|
|
static int ipcrypto_dh_main(int argc,char *argv[]);
|
|
#endif
|
|
|
|
#ifdef INCLUDE_DHPARAM_CMD
|
|
static int ipcrypto_dhparam_main(int argc,char *argv[]);
|
|
#endif
|
|
|
|
#ifdef INCLUDE_ENC_CMD
|
|
static int ipcrypto_enc_main(int argc,char *argv[]);
|
|
#endif
|
|
|
|
#ifdef INCLUDE_PASSWD_CMD
|
|
static int ipcrypto_passwd_main(int argc,char *argv[]);
|
|
#endif
|
|
|
|
#ifdef INCLUDE_GENDH_CMD
|
|
static int ipcrypto_gendh_main(int argc,char *argv[]);
|
|
#endif
|
|
|
|
#ifdef INCLUDE_CA_CMD
|
|
static int ipcrypto_ca_main(int argc,char *argv[]);
|
|
#endif
|
|
|
|
#ifdef INCLUDE_CRL_CMD
|
|
static int ipcrypto_crl_main(int argc,char *argv[]);
|
|
#endif
|
|
|
|
#ifdef INCLUDE_RSA_CMD
|
|
static int ipcrypto_rsa_main(int argc,char *argv[]);
|
|
#endif
|
|
|
|
#ifdef INCLUDE_RSAUTL_CMD
|
|
static int ipcrypto_rsautl_main(int argc,char *argv[]);
|
|
#endif
|
|
|
|
#ifdef INCLUDE_DSA_CMD
|
|
static int ipcrypto_dsa_main(int argc,char *argv[]);
|
|
#endif
|
|
|
|
#ifdef INCLUDE_DSAPARAM_CMD
|
|
static int ipcrypto_dsaparam_main(int argc,char *argv[]);
|
|
#endif
|
|
|
|
#ifdef INCLUDE_X509_CMD
|
|
static int ipcrypto_x509_main(int argc,char *argv[]);
|
|
#endif
|
|
|
|
#ifdef INCLUDE_GENRSA_CMD
|
|
static int ipcrypto_genrsa_main(int argc,char *argv[]);
|
|
#endif
|
|
|
|
#ifdef INCLUDE_GENDSA_CMD
|
|
static int ipcrypto_gendsa_main(int argc,char *argv[]);
|
|
#endif
|
|
|
|
#ifdef INCLUDE_SPEED_CMD
|
|
static int ipcrypto_speed_main(int argc,char *argv[]);
|
|
#endif
|
|
|
|
#ifdef INCLUDE_VERSION_CMD
|
|
static int ipcrypto_version_main(int argc,char *argv[]);
|
|
#endif
|
|
|
|
#ifdef INCLUDE_PKCS7_CMD
|
|
static int ipcrypto_pkcs7_main(int argc,char *argv[]);
|
|
#endif
|
|
|
|
#ifdef INCLUDE_CRL2PKCS7_CMD
|
|
static int ipcrypto_crl2pkcs7_main(int argc,char *argv[]);
|
|
#endif
|
|
|
|
#ifdef INCLUDE_NSEQ_CMD
|
|
static int ipcrypto_nseq_main(int argc,char *argv[]);
|
|
#endif
|
|
|
|
#ifdef INCLUDE_PKCS12_CMD
|
|
static int ipcrypto_pkcs12_main(int argc,char *argv[]);
|
|
#endif
|
|
|
|
#ifdef INCLUDE_PKCS8_CMD
|
|
static int ipcrypto_pkcs8_main(int argc,char *argv[]);
|
|
#endif
|
|
|
|
#ifdef INCLUDE_SPKAC_CMD
|
|
static int ipcrypto_spkac_main(int argc,char *argv[]);
|
|
#endif
|
|
|
|
#ifdef INCLUDE_SMIME_CMD
|
|
static int ipcrypto_smime_main(int argc,char *argv[]);
|
|
#endif
|
|
|
|
#ifdef INCLUDE_RAND_CMD
|
|
static int ipcrypto_rand_main(int argc,char *argv[]);
|
|
#endif
|
|
|
|
#ifdef INCLUDE_ENGINE_CMD
|
|
static int ipcrypto_engine_main(int argc,char *argv[]);
|
|
#endif
|
|
|
|
#ifdef INCLUDE_OCSP_CMD
|
|
static int ipcrypto_ocsp_main(int argc,char *argv[]);
|
|
#endif
|
|
|
|
#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
|
|
|
|
#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);
|
|
|
|
/*
|
|
****************************************************************************
|
|
* 7 DATA
|
|
****************************************************************************
|
|
*/
|
|
static const char* WR_REL_VER = "M241/EAR Release -06-24-26";
|
|
|
|
/*
|
|
*===========================================================================
|
|
* SYSVAR CONFIGURATION
|
|
*===========================================================================
|
|
*/
|
|
|
|
|
|
/*
|
|
****************************************************************************
|
|
* 9 STATIC FUNCTIONS
|
|
****************************************************************************
|
|
*/
|
|
|
|
|
|
/*
|
|
*===========================================================================
|
|
* SHELL COMMANDS
|
|
*===========================================================================
|
|
*/
|
|
|
|
#ifdef INCLUDE_VERIFY_CMD
|
|
static int
|
|
ipcrypto_verify_main(int argc, char ** argv)
|
|
{
|
|
ipcrypto_cmds_startup();
|
|
return verify_main(argc, argv);
|
|
}
|
|
#endif
|
|
|
|
#ifdef INCLUDE_ASN1PARSE_CMD
|
|
static int
|
|
ipcrypto_asn1parse_main(int argc, char ** argv)
|
|
{
|
|
ipcrypto_cmds_startup();
|
|
return asn1parse_main(argc, argv);
|
|
}
|
|
#endif
|
|
|
|
#ifdef INCLUDE_REQ_CMD
|
|
static int
|
|
ipcrypto_req_main(int argc,char *argv[])
|
|
{
|
|
ipcrypto_cmds_startup();
|
|
return req_main(argc, argv);
|
|
}
|
|
#endif
|
|
|
|
#ifdef INCLUDE_DGST_CMD
|
|
static int
|
|
ipcrypto_dgst_main(int argc,char *argv[])
|
|
{
|
|
ipcrypto_cmds_startup();
|
|
return dgst_main(argc, argv);
|
|
}
|
|
#endif
|
|
|
|
#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 INCLUDE_DHPARAM_CMD
|
|
static int
|
|
ipcrypto_dhparam_main(int argc,char *argv[])
|
|
{
|
|
ipcrypto_cmds_startup();
|
|
return dhparam_main(argc, argv);
|
|
}
|
|
#endif
|
|
|
|
#ifdef INCLUDE_ENC_CMD
|
|
static int
|
|
ipcrypto_enc_main(int argc,char *argv[])
|
|
{
|
|
ipcrypto_cmds_startup();
|
|
return enc_main(argc, argv);
|
|
}
|
|
#endif
|
|
|
|
#ifdef INCLUDE_PASSWD_CMD
|
|
static int
|
|
ipcrypto_passwd_main(int argc,char *argv[])
|
|
{
|
|
ipcrypto_cmds_startup();
|
|
return passwd_main(argc, argv);
|
|
}
|
|
#endif
|
|
|
|
#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 INCLUDE_CA_CMD
|
|
static int
|
|
ipcrypto_ca_main(int argc,char *argv[])
|
|
{
|
|
ipcrypto_cmds_startup();
|
|
return ca_main(argc, argv);
|
|
}
|
|
#endif
|
|
|
|
#ifdef INCLUDE_CRL_CMD
|
|
static int
|
|
ipcrypto_crl_main(int argc,char *argv[])
|
|
{
|
|
ipcrypto_cmds_startup();
|
|
return crl_main(argc, argv);
|
|
}
|
|
#endif
|
|
|
|
#ifdef INCLUDE_RSA_CMD
|
|
static int
|
|
ipcrypto_rsa_main(int argc,char *argv[])
|
|
{
|
|
ipcrypto_cmds_startup();
|
|
return rsa_main(argc, argv);
|
|
}
|
|
#endif
|
|
|
|
#ifdef INCLUDE_RSAUTL_CMD
|
|
static int
|
|
ipcrypto_rsautl_main(int argc,char *argv[])
|
|
{
|
|
ipcrypto_cmds_startup();
|
|
return rsautl_main(argc, argv);
|
|
}
|
|
#endif
|
|
|
|
#ifndef OPENSSL_NO_DSA
|
|
#ifdef INCLUDE_DSA_CMD
|
|
static int
|
|
ipcrypto_dsa_main(int argc,char *argv[])
|
|
{
|
|
ipcrypto_cmds_startup();
|
|
return dsa_main(argc, argv);
|
|
}
|
|
#endif
|
|
|
|
#ifdef INCLUDE_GENDSA_CMD
|
|
static int
|
|
ipcrypto_gendsa_main(int argc,char *argv[])
|
|
{
|
|
ipcrypto_cmds_startup();
|
|
return gendsa_main(argc, argv);
|
|
}
|
|
#endif
|
|
|
|
#ifdef INCLUDE_DSAPARAM_CMD
|
|
static int
|
|
ipcrypto_dsaparam_main(int argc,char *argv[])
|
|
{
|
|
ipcrypto_cmds_startup();
|
|
return dsaparam_main(argc, argv);
|
|
}
|
|
#endif
|
|
#endif /* OPENSSL_NO_DSA */
|
|
|
|
#ifdef INCLUDE_X509_CMD
|
|
static int
|
|
ipcrypto_x509_main(int argc,char *argv[])
|
|
{
|
|
ipcrypto_cmds_startup();
|
|
return x509_main(argc, argv);
|
|
}
|
|
#endif
|
|
|
|
#ifdef INCLUDE_GENRSA_CMD
|
|
static int
|
|
ipcrypto_genrsa_main(int argc,char *argv[])
|
|
{
|
|
ipcrypto_cmds_startup();
|
|
return genrsa_main(argc, argv);
|
|
}
|
|
#endif
|
|
|
|
#ifdef INCLUDE_SPEED_CMD
|
|
static int
|
|
ipcrypto_speed_main(int argc,char *argv[])
|
|
{
|
|
ipcrypto_cmds_startup();
|
|
return speed_main(argc, argv);
|
|
}
|
|
#endif
|
|
|
|
#ifdef INCLUDE_VERSION_CMD
|
|
static int
|
|
ipcrypto_version_main(int argc,char *argv[])
|
|
{
|
|
ipcrypto_cmds_startup();
|
|
return version_main(argc, argv);
|
|
}
|
|
#endif
|
|
|
|
#ifdef INCLUDE_PKCS7_CMD
|
|
static int
|
|
ipcrypto_pkcs7_main(int argc,char *argv[])
|
|
{
|
|
ipcrypto_cmds_startup();
|
|
return pkcs7_main(argc, argv);
|
|
}
|
|
#endif
|
|
|
|
#ifdef INCLUDE_CRL2PKCS7_CMD
|
|
static int
|
|
ipcrypto_crl2pkcs7_main(int argc,char *argv[])
|
|
{
|
|
ipcrypto_cmds_startup();
|
|
return crl2pkcs7_main(argc, argv);
|
|
}
|
|
#endif
|
|
|
|
#ifdef INCLUDE_NSEQ_CMD
|
|
static int
|
|
ipcrypto_nseq_main(int argc,char *argv[])
|
|
{
|
|
ipcrypto_cmds_startup();
|
|
return nseq_main(argc, argv);
|
|
}
|
|
#endif
|
|
|
|
#ifdef INCLUDE_PKCS12_CMD
|
|
static int
|
|
ipcrypto_pkcs12_main(int argc,char *argv[])
|
|
{
|
|
ipcrypto_cmds_startup();
|
|
return pkcs12_main(argc, argv);
|
|
}
|
|
#endif
|
|
|
|
#ifdef INCLUDE_PKCS8_CMD
|
|
static int
|
|
ipcrypto_pkcs8_main(int argc,char *argv[])
|
|
{
|
|
ipcrypto_cmds_startup();
|
|
return pkcs8_main(argc, argv);
|
|
}
|
|
#endif
|
|
|
|
#ifdef INCLUDE_SPKAC_CMD
|
|
static int
|
|
ipcrypto_spkac_main(int argc,char *argv[])
|
|
{
|
|
ipcrypto_cmds_startup();
|
|
return spkac_main(argc, argv);
|
|
}
|
|
#endif
|
|
|
|
#ifdef INCLUDE_SMIME_CMD
|
|
static int
|
|
ipcrypto_smime_main(int argc,char *argv[])
|
|
{
|
|
ipcrypto_cmds_startup();
|
|
return smime_main(argc, argv);
|
|
}
|
|
#endif
|
|
|
|
#ifdef INCLUDE_RAND_CMD
|
|
static int
|
|
ipcrypto_rand_main(int argc,char *argv[])
|
|
{
|
|
ipcrypto_cmds_startup();
|
|
return rand_main(argc, argv);
|
|
}
|
|
#endif
|
|
|
|
#ifdef INCLUDE_ENGINE_CMD
|
|
static int
|
|
ipcrypto_engine_main(int argc,char *argv[])
|
|
{
|
|
ipcrypto_cmds_startup();
|
|
return engine_main(argc, argv);
|
|
}
|
|
#endif
|
|
|
|
#ifdef INCLUDE_OCSP_CMD
|
|
static int
|
|
ipcrypto_ocsp_main(int argc,char *argv[])
|
|
{
|
|
ipcrypto_cmds_startup();
|
|
return ocsp_main(argc, argv);
|
|
}
|
|
#endif
|
|
|
|
#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
|
|
|
|
|
|
/*
|
|
****************************************************************************
|
|
* 10 GLOBAL FUNCTIONS
|
|
****************************************************************************
|
|
*/
|
|
|
|
void get_ossl350_WR_release_version()
|
|
{
|
|
fprintf(stderr, "%s\n", WR_REL_VER);
|
|
}
|
|
|
|
/*
|
|
****************************************************************************
|
|
* 11 PUBLIC FUNCTIONS
|
|
****************************************************************************
|
|
*/
|
|
|
|
/*
|
|
*===========================================================================
|
|
* ipcrypto_configure
|
|
*===========================================================================
|
|
*/
|
|
int
|
|
ipcrypto_configure(void)
|
|
{
|
|
#ifdef INCLUDE_IPCOM_KEY_DB_CMD
|
|
(void)ipcrypto_shell_add_cmd("keydb", "keydb <command> [options]", "Key DB admin command",
|
|
ipcom_cmd_keydb);
|
|
#endif
|
|
|
|
#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
|
|
#if defined(INCLUDE_ASN1PARSE_CMD)
|
|
(void)ipcrypto_shell_add_cmd("asn1parse", "asn1parse [options]",
|
|
"Parse an ASN.1 sequence", ipcrypto_asn1parse_main);
|
|
#endif
|
|
#if defined(INCLUDE_REQ_CMD)
|
|
(void)ipcrypto_shell_add_cmd("req", "req [options]",
|
|
"X.509 Certificate Signing Request (CSR) Management", ipcrypto_req_main);
|
|
#endif
|
|
#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
|
|
#if defined(INCLUDE_DH_CMD)
|
|
(void)ipcrypto_shell_add_cmd("dh", "dh [options]",
|
|
"Diffie-Hellman Parameter Management. Obsoleted by dhparam", ipcrypto_dh_main);
|
|
#endif
|
|
#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
|
|
#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 */
|
|
|
|
#if defined(INCLUDE_ENC_CMD)
|
|
(void)ipcrypto_shell_add_cmd("enc", "enc [options]", "Encoding with Ciphers", ipcrypto_enc_main);
|
|
#endif
|
|
#if defined(INCLUDE_PASSWD_CMD)
|
|
(void)ipcrypto_shell_add_cmd("passwd", "passwd [options] [passwords]", "Generation of hashed passwords", ipcrypto_passwd_main);
|
|
#endif
|
|
#if defined(INCLUDE_CA_CMD)
|
|
(void)ipcrypto_shell_add_cmd("ca", "ca args", "Certificate Authority (CA) Management", ipcrypto_ca_main);
|
|
#endif
|
|
#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
|
|
#if defined(INCLUDE_RSA_CMD)
|
|
(void)ipcrypto_shell_add_cmd("rsa", "rsa [options]", "RSA Data Management", ipcrypto_rsa_main);
|
|
#endif
|
|
#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
|
|
#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
|
|
#if defined(INCLUDE_DSA_CMD)
|
|
(void)ipcrypto_shell_add_cmd("dsa", "dsa [options]", "DSA key processing", ipcrypto_dsa_main);
|
|
#endif
|
|
#if defined(INCLUDE_DSAPARAM_CMD)
|
|
(void)ipcrypto_shell_add_cmd("dsaparam", "dsaparam [options]", "DSA parameter manipulation and generation", ipcrypto_dsaparam_main);
|
|
#endif
|
|
#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 */
|
|
|
|
#if defined(INCLUDE_X509_CMD)
|
|
(void)ipcrypto_shell_add_cmd("x509", "x509 [options]", "Certificate display and signing utility", ipcrypto_x509_main);
|
|
#endif
|
|
#if defined(INCLUDE_SPEED_CMD)
|
|
(void)ipcrypto_shell_add_cmd("speed", "speed [options]", "Test encryption performance", ipcrypto_speed_main);
|
|
#endif
|
|
|
|
#if defined(INCLUDE_PKCS7_CMD)
|
|
(void)ipcrypto_shell_add_cmd("pkcs7", "pkcs7 [options]", "PKCS#7 Data Management", ipcrypto_pkcs7_main);
|
|
#endif
|
|
#if defined(INCLUDE_CRL2PKCS7_CMD)
|
|
(void)ipcrypto_shell_add_cmd("crl2p7", "crl2p7 [options]", "CRL to PKCS#7 Conversion", ipcrypto_crl2pkcs7_main);
|
|
#endif
|
|
#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(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
|
|
#if defined(INCLUDE_PKCS8_CMD)
|
|
(void)ipcrypto_shell_add_cmd("pkcs8", "pkcs8 [options]", "PKCS#8 format private key conversion tool", ipcrypto_pkcs8_main);
|
|
#endif
|
|
#if defined(INCLUDE_SPKAC_CMD)
|
|
(void)ipcrypto_shell_add_cmd("spkac", "spkac [options]", "SPKAC printing and generating utility", ipcrypto_spkac_main);
|
|
#endif
|
|
#if defined(INCLUDE_SMIME_CMD)
|
|
(void)ipcrypto_shell_add_cmd("smime", "smime [options]", "S/MIME mail processing", ipcrypto_smime_main);
|
|
#endif
|
|
#if defined(INCLUDE_RAND_CMD)
|
|
(void)ipcrypto_shell_add_cmd("rand", "rand [options]", "Generate pseudo-random bytes", ipcrypto_rand_main);
|
|
#endif
|
|
|
|
#if defined(INCLUDE_VERSION_CMD)
|
|
(void)ipcrypto_shell_add_cmd("ipcrypto_ver", "ipcrypto_ver", "Show IPCRYPTO version", ipcrypto_version_main);
|
|
#endif
|
|
|
|
#if defined(INCLUDE_ENGINE_CMD)
|
|
(void)ipcrypto_shell_add_cmd("engine", "engine", "Hardware Crypto Support", ipcrypto_engine_main);
|
|
#endif
|
|
|
|
#if defined(INCLUDE_OCSP_CMD)
|
|
(void)ipcrypto_shell_add_cmd("ocsp", "ocsp", "ocsp - Online Certificate Status Protocol utility", ipcrypto_ocsp_main);
|
|
#endif
|
|
|
|
#if defined(INCLUDE_ECPARAM_CMD)
|
|
(void)ipcrypto_shell_add_cmd("ecparam", "ecparam", "ecparam - Elliptic-curve parameter manipulation and generation", ipcrypto_ecparam_main);
|
|
#endif
|
|
|
|
#if defined(INCLUDE_EC_CMD)
|
|
(void)ipcrypto_shell_add_cmd("ec", "ec", "ec - Elliptic-curve key processing", ipcrypto_ec_main);
|
|
#endif
|
|
|
|
#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 0;
|
|
}
|
|
|
|
/*
|
|
*===========================================================================
|
|
* ipcrypto_get_root_stack_size
|
|
*===========================================================================
|
|
*/
|
|
size_t ipcrypto_get_root_stack_size(void)
|
|
{
|
|
return ROOT_STACK_SIZE;
|
|
}
|
|
|
|
/*
|
|
****************************************************************************
|
|
* END OF FILE
|
|
****************************************************************************
|
|
*/
|