提交 ba2cad19 编写于 作者: R Richard Levitte

Add aep and sureware implementations and clean up some error reasons

that were never part of the engine framework.

The aep and sureware implementations are taken directly from 0.9.6c
[engine] and have been modified to fit the newer engine framework and
to be possible to build shared libraries of.

The aep implementation has gone through quite a bunch of tests and is
cleaned up (there were some misunderstandings in it about how to use
locks).

The sureware hasn't been tested at all in this incarnation and is
basically a quick hack to get it to compile properly.
上级 db0a1efc
......@@ -28,13 +28,13 @@ LIBSRC= eng_err.c eng_lib.c eng_list.c eng_init.c eng_ctrl.c \
tb_rsa.c tb_dsa.c tb_dh.c tb_rand.c tb_cipher.c tb_digest.c \
eng_openssl.c eng_dyn.c eng_cnf.c \
hw_atalla.c hw_cswift.c hw_ncipher.c hw_nuron.c hw_ubsec.c \
hw_openbsd_dev_crypto.c #hw_aep.c hw_sureware.c
hw_openbsd_dev_crypto.c hw_aep.c hw_sureware.c
LIBOBJ= eng_err.o eng_lib.o eng_list.o eng_init.o eng_ctrl.o \
eng_table.o eng_pkey.o eng_fat.o eng_all.o \
tb_rsa.o tb_dsa.o tb_dh.o tb_rand.o tb_cipher.o tb_digest.o \
eng_openssl.o eng_dyn.o eng_cnf.o \
hw_atalla.o hw_cswift.o hw_ncipher.o hw_nuron.o hw_ubsec.o \
hw_openbsd_dev_crypto.o #hw_aep.o hw_sureware.o
hw_openbsd_dev_crypto.o hw_aep.o hw_sureware.o
SRC= $(LIBSRC)
......@@ -236,6 +236,17 @@ eng_table.o: ../../include/openssl/rand.h ../../include/openssl/rsa.h
eng_table.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h
eng_table.o: ../../include/openssl/symhacks.h ../../include/openssl/ui.h
eng_table.o: eng_int.h eng_table.c
hw_aep.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
hw_aep.o: ../../include/openssl/bn.h ../../include/openssl/crypto.h
hw_aep.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
hw_aep.o: ../../include/openssl/dso.h ../../include/openssl/e_os2.h
hw_aep.o: ../../include/openssl/engine.h ../../include/openssl/err.h
hw_aep.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h
hw_aep.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
hw_aep.o: ../../include/openssl/rand.h ../../include/openssl/rsa.h
hw_aep.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h
hw_aep.o: ../../include/openssl/symhacks.h ../../include/openssl/ui.h hw_aep.c
hw_aep.o: hw_aep_err.c hw_aep_err.h vendor_defns/aep.h
hw_atalla.o: ../../e_os.h ../../include/openssl/asn1.h
hw_atalla.o: ../../include/openssl/bio.h ../../include/openssl/bn.h
hw_atalla.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
......@@ -314,6 +325,25 @@ hw_openbsd_dev_crypto.o: ../../include/openssl/stack.h
hw_openbsd_dev_crypto.o: ../../include/openssl/symhacks.h
hw_openbsd_dev_crypto.o: ../../include/openssl/ui.h ../evp/evp_locl.h eng_int.h
hw_openbsd_dev_crypto.o: hw_openbsd_dev_crypto.c
hw_sureware.o: ../../e_os.h ../../include/openssl/asn1.h
hw_sureware.o: ../../include/openssl/bio.h ../../include/openssl/bn.h
hw_sureware.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
hw_sureware.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
hw_sureware.o: ../../include/openssl/dso.h ../../include/openssl/e_os2.h
hw_sureware.o: ../../include/openssl/engine.h ../../include/openssl/err.h
hw_sureware.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h
hw_sureware.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
hw_sureware.o: ../../include/openssl/opensslconf.h
hw_sureware.o: ../../include/openssl/opensslv.h
hw_sureware.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pem.h
hw_sureware.o: ../../include/openssl/pem2.h ../../include/openssl/pkcs7.h
hw_sureware.o: ../../include/openssl/rand.h ../../include/openssl/rsa.h
hw_sureware.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
hw_sureware.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
hw_sureware.o: ../../include/openssl/ui.h ../../include/openssl/x509.h
hw_sureware.o: ../../include/openssl/x509_vfy.h ../cryptlib.h eng_int.h
hw_sureware.o: engine.h hw_sureware.c hw_sureware_err.c hw_sureware_err.h
hw_sureware.o: vendor_defns/sureware.h
hw_ubsec.o: ../../e_os.h ../../include/openssl/asn1.h
hw_ubsec.o: ../../include/openssl/bio.h ../../include/openssl/bn.h
hw_ubsec.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
......
......@@ -86,6 +86,12 @@ void ENGINE_load_builtin_engines(void)
#ifndef OPENSSL_NO_HW_UBSEC
ENGINE_load_ubsec();
#endif
#ifndef OPENSSL_NO_HW_AEP
ENGINE_load_aep();
#endif
#ifndef OPENSSL_NO_HW_SUREWARE
ENGINE_load_sureware();
#endif
#ifdef OPENSSL_OPENBSD_DEV_CRYPTO
ENGINE_load_openbsd_dev_crypto();
#endif
......
......@@ -107,10 +107,6 @@ static ERR_STRING_DATA ENGINE_str_reasons[]=
{
{ENGINE_R_ALREADY_LOADED ,"already loaded"},
{ENGINE_R_ARGUMENT_IS_NOT_A_NUMBER ,"argument is not a number"},
{ENGINE_R_BIO_WAS_FREED ,"bio was freed"},
{ENGINE_R_BN_CTX_FULL ,"BN_CTX full"},
{ENGINE_R_BN_EXPAND_FAIL ,"bn_expand fail"},
{ENGINE_R_CHIL_ERROR ,"chil error"},
{ENGINE_R_CMD_NOT_EXECUTABLE ,"cmd not executable"},
{ENGINE_R_COMMAND_TAKES_INPUT ,"command takes input"},
{ENGINE_R_COMMAND_TAKES_NO_INPUT ,"command takes no input"},
......@@ -119,7 +115,6 @@ static ERR_STRING_DATA ENGINE_str_reasons[]=
{ENGINE_R_DH_NOT_IMPLEMENTED ,"dh not implemented"},
{ENGINE_R_DSA_NOT_IMPLEMENTED ,"dsa not implemented"},
{ENGINE_R_DSO_FAILURE ,"DSO failure"},
{ENGINE_R_DSO_FUNCTION_NOT_FOUND ,"dso function not found"},
{ENGINE_R_DSO_NOT_FOUND ,"dso not found"},
{ENGINE_R_ENGINES_SECTION_ERROR ,"engines section error"},
{ENGINE_R_ENGINE_IS_NOT_IN_LIST ,"engine is not in the list"},
......@@ -135,26 +130,18 @@ static ERR_STRING_DATA ENGINE_str_reasons[]=
{ENGINE_R_INVALID_CMD_NAME ,"invalid cmd name"},
{ENGINE_R_INVALID_CMD_NUMBER ,"invalid cmd number"},
{ENGINE_R_INVALID_STRING ,"invalid string"},
{ENGINE_R_MISSING_KEY_COMPONENTS ,"missing key components"},
{ENGINE_R_NOT_INITIALISED ,"not initialised"},
{ENGINE_R_NOT_LOADED ,"not loaded"},
{ENGINE_R_NO_CALLBACK ,"no callback"},
{ENGINE_R_NO_CONTROL_FUNCTION ,"no control function"},
{ENGINE_R_NO_INDEX ,"no index"},
{ENGINE_R_NO_KEY ,"no key"},
{ENGINE_R_NO_LOAD_FUNCTION ,"no load function"},
{ENGINE_R_NO_REFERENCE ,"no reference"},
{ENGINE_R_NO_SUCH_ENGINE ,"no such engine"},
{ENGINE_R_NO_UNLOAD_FUNCTION ,"no unload function"},
{ENGINE_R_PRIVATE_KEY_ALGORITHMS_DISABLED,"private key algorithms disabled"},
{ENGINE_R_PROVIDE_PARAMETERS ,"provide parameters"},
{ENGINE_R_REQUEST_FAILED ,"request failed"},
{ENGINE_R_REQUEST_FALLBACK ,"request fallback"},
{ENGINE_R_RSA_NOT_IMPLEMENTED ,"rsa not implemented"},
{ENGINE_R_SIZE_TOO_LARGE_OR_TOO_SMALL ,"size too large or too small"},
{ENGINE_R_UNIMPLEMENTED_CIPHER ,"unimplemented cipher"},
{ENGINE_R_UNIMPLEMENTED_DIGEST ,"unimplemented digest"},
{ENGINE_R_UNIT_FAILURE ,"unit failure"},
{ENGINE_R_VERSION_INCOMPATIBILITY ,"version incompatibility"},
{0,NULL}
};
......
......@@ -304,6 +304,8 @@ void ENGINE_load_chil(void);
void ENGINE_load_atalla(void);
void ENGINE_load_nuron(void);
void ENGINE_load_ubsec(void);
void ENGINE_load_aep(void);
void ENGINE_load_sureware(void);
void ENGINE_load_openbsd_dev_crypto(void);
void ENGINE_load_builtin_engines(void);
......@@ -667,10 +669,6 @@ void ERR_load_ENGINE_strings(void);
/* Reason codes. */
#define ENGINE_R_ALREADY_LOADED 100
#define ENGINE_R_ARGUMENT_IS_NOT_A_NUMBER 133
#define ENGINE_R_BIO_WAS_FREED 121
#define ENGINE_R_BN_CTX_FULL 101
#define ENGINE_R_BN_EXPAND_FAIL 102
#define ENGINE_R_CHIL_ERROR 123
#define ENGINE_R_CMD_NOT_EXECUTABLE 134
#define ENGINE_R_COMMAND_TAKES_INPUT 135
#define ENGINE_R_COMMAND_TAKES_NO_INPUT 136
......@@ -679,7 +677,6 @@ void ERR_load_ENGINE_strings(void);
#define ENGINE_R_DH_NOT_IMPLEMENTED 139
#define ENGINE_R_DSA_NOT_IMPLEMENTED 140
#define ENGINE_R_DSO_FAILURE 104
#define ENGINE_R_DSO_FUNCTION_NOT_FOUND 131
#define ENGINE_R_DSO_NOT_FOUND 132
#define ENGINE_R_ENGINES_SECTION_ERROR 148
#define ENGINE_R_ENGINE_IS_NOT_IN_LIST 105
......@@ -695,26 +692,18 @@ void ERR_load_ENGINE_strings(void);
#define ENGINE_R_INVALID_CMD_NAME 137
#define ENGINE_R_INVALID_CMD_NUMBER 138
#define ENGINE_R_INVALID_STRING 150
#define ENGINE_R_MISSING_KEY_COMPONENTS 111
#define ENGINE_R_NOT_INITIALISED 117
#define ENGINE_R_NOT_LOADED 112
#define ENGINE_R_NO_CALLBACK 127
#define ENGINE_R_NO_CONTROL_FUNCTION 120
#define ENGINE_R_NO_INDEX 144
#define ENGINE_R_NO_KEY 124
#define ENGINE_R_NO_LOAD_FUNCTION 125
#define ENGINE_R_NO_REFERENCE 130
#define ENGINE_R_NO_SUCH_ENGINE 116
#define ENGINE_R_NO_UNLOAD_FUNCTION 126
#define ENGINE_R_PRIVATE_KEY_ALGORITHMS_DISABLED 142
#define ENGINE_R_PROVIDE_PARAMETERS 113
#define ENGINE_R_REQUEST_FAILED 114
#define ENGINE_R_REQUEST_FALLBACK 118
#define ENGINE_R_RSA_NOT_IMPLEMENTED 141
#define ENGINE_R_SIZE_TOO_LARGE_OR_TOO_SMALL 122
#define ENGINE_R_UNIMPLEMENTED_CIPHER 146
#define ENGINE_R_UNIMPLEMENTED_DIGEST 147
#define ENGINE_R_UNIT_FAILURE 115
#define ENGINE_R_VERSION_INCOMPATIBILITY 145
#ifdef __cplusplus
......
L AEP hw_aep_err.h hw_aep_err.c
L ATALLA hw_atalla_err.h hw_atalla_err.c
L CSWIFT hw_cswift_err.h hw_cswift_err.c
L HWCRHK hw_ncipher_err.h hw_ncipher_err.c
L NURON hw_nuron_err.h hw_nuron_err.c
L SUREWARE hw_sureware_err.h hw_sureware_err.c
L UBSEC hw_ubsec_err.h hw_ubsec_err.c
此差异已折叠。
/* hw_aep_err.c */
/* ====================================================================
* Copyright (c) 1999 The OpenSSL Project. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* 3. All advertising materials mentioning features or use of this
* software must display the following acknowledgment:
* "This product includes software developed by the OpenSSL Project
* for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)"
*
* 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
* endorse or promote products derived from this software without
* prior written permission. For written permission, please contact
* openssl-core@OpenSSL.org.
*
* 5. Products derived from this software may not be called "OpenSSL"
* nor may "OpenSSL" appear in their names without prior written
* permission of the OpenSSL Project.
*
* 6. Redistributions of any form whatsoever must retain the following
* acknowledgment:
* "This product includes software developed by the OpenSSL Project
* for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)"
*
* THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
* EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
* OF THE POSSIBILITY OF SUCH DAMAGE.
* ====================================================================
*
* This product includes cryptographic software written by Eric Young
* (eay@cryptsoft.com). This product includes software written by Tim
* Hudson (tjh@cryptsoft.com).
*
*/
/* NOTE: this file was auto generated by the mkerr.pl script: any changes
* made to it will be overwritten when the script next updates this file,
* only reason strings will be preserved.
*/
#include <stdio.h>
#include <openssl/err.h>
#include "hw_aep_err.h"
/* BEGIN ERROR CODES */
#ifndef OPENSSL_NO_ERR
static ERR_STRING_DATA AEP_str_functs[]=
{
{ERR_PACK(0,AEP_F_AEP_CTRL,0), "AEP_CTRL"},
{ERR_PACK(0,AEP_F_AEP_FINISH,0), "AEP_FINISH"},
{ERR_PACK(0,AEP_F_AEP_INIT,0), "AEP_INIT"},
{ERR_PACK(0,AEP_F_AEP_MOD_EXP,0), "AEP_MOD_EXP"},
{ERR_PACK(0,AEP_F_AEP_MOD_EXP_CRT,0), "AEP_MOD_EXP_CRT"},
{ERR_PACK(0,AEP_F_AEP_RAND,0), "AEP_RAND"},
{ERR_PACK(0,AEP_F_AEP_RSA_MOD_EXP,0), "AEP_RSA_MOD_EXP"},
{0,NULL}
};
static ERR_STRING_DATA AEP_str_reasons[]=
{
{AEP_R_ALREADY_LOADED ,"already loaded"},
{AEP_R_CLOSE_HANDLES_FAILED ,"close handles failed"},
{AEP_R_CONNECTIONS_IN_USE ,"connections in use"},
{AEP_R_CTRL_COMMAND_NOT_IMPLEMENTED ,"ctrl command not implemented"},
{AEP_R_FINALIZE_FAILED ,"finalize failed"},
{AEP_R_GENERAL_ERROR ,"general error"},
{AEP_R_GET_HANDLE_FAILED ,"get handle failed"},
{AEP_R_GET_RANDOM_FAILED ,"get random failed"},
{AEP_R_INIT_FAILURE ,"init failure"},
{AEP_R_MISSING_KEY_COMPONENTS ,"missing key components"},
{AEP_R_MOD_EXP_CRT_FAILED ,"mod exp crt failed"},
{AEP_R_MOD_EXP_FAILED ,"mod exp failed"},
{AEP_R_NOT_LOADED ,"not loaded"},
{AEP_R_OK ,"ok"},
{AEP_R_RETURN_CONNECTION_FAILED ,"return connection failed"},
{AEP_R_SETBNCALLBACK_FAILURE ,"setbncallback failure"},
{AEP_R_UNIT_FAILURE ,"unit failure"},
{0,NULL}
};
#endif
#ifdef AEP_LIB_NAME
static ERR_STRING_DATA AEP_lib_name[]=
{
{0 ,AEP_LIB_NAME},
{0,NULL}
};
#endif
static int AEP_lib_error_code=0;
static int AEP_error_init=1;
static void ERR_load_AEP_strings(void)
{
if (AEP_lib_error_code == 0)
AEP_lib_error_code=ERR_get_next_error_library();
if (AEP_error_init)
{
AEP_error_init=0;
#ifndef OPENSSL_NO_ERR
ERR_load_strings(AEP_lib_error_code,AEP_str_functs);
ERR_load_strings(AEP_lib_error_code,AEP_str_reasons);
#endif
#ifdef AEP_LIB_NAME
AEP_lib_name->error = ERR_PACK(AEP_lib_error_code,0,0);
ERR_load_strings(0,AEP_lib_name);
#endif
}
}
static void ERR_unload_AEP_strings(void)
{
if (AEP_error_init == 0)
{
#ifndef OPENSSL_NO_ERR
ERR_unload_strings(AEP_lib_error_code,AEP_str_functs);
ERR_unload_strings(AEP_lib_error_code,AEP_str_reasons);
#endif
#ifdef AEP_LIB_NAME
ERR_unload_strings(0,AEP_lib_name);
#endif
AEP_error_init=1;
}
}
static void ERR_AEP_error(int function, int reason, char *file, int line)
{
if (AEP_lib_error_code == 0)
AEP_lib_error_code=ERR_get_next_error_library();
ERR_PUT_error(AEP_lib_error_code,function,reason,file,line);
}
/* ====================================================================
* Copyright (c) 2001 The OpenSSL Project. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* 3. All advertising materials mentioning features or use of this
* software must display the following acknowledgment:
* "This product includes software developed by the OpenSSL Project
* for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
*
* 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
* endorse or promote products derived from this software without
* prior written permission. For written permission, please contact
* openssl-core@openssl.org.
*
* 5. Products derived from this software may not be called "OpenSSL"
* nor may "OpenSSL" appear in their names without prior written
* permission of the OpenSSL Project.
*
* 6. Redistributions of any form whatsoever must retain the following
* acknowledgment:
* "This product includes software developed by the OpenSSL Project
* for use in the OpenSSL Toolkit (http://www.openssl.org/)"
*
* THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
* EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
* OF THE POSSIBILITY OF SUCH DAMAGE.
* ====================================================================
*
* This product includes cryptographic software written by Eric Young
* (eay@cryptsoft.com). This product includes software written by Tim
* Hudson (tjh@cryptsoft.com).
*
*/
#ifndef HEADER_AEP_ERR_H
#define HEADER_AEP_ERR_H
/* BEGIN ERROR CODES */
/* The following lines are auto generated by the script mkerr.pl. Any changes
* made after this point may be overwritten when the script is next run.
*/
static void ERR_load_AEP_strings(void);
static void ERR_unload_AEP_strings(void);
static void ERR_AEP_error(int function, int reason, char *file, int line);
#define AEPerr(f,r) ERR_AEP_error((f),(r),__FILE__,__LINE__)
/* Error codes for the AEP functions. */
/* Function codes. */
#define AEP_F_AEP_CTRL 100
#define AEP_F_AEP_FINISH 101
#define AEP_F_AEP_INIT 102
#define AEP_F_AEP_MOD_EXP 103
#define AEP_F_AEP_MOD_EXP_CRT 104
#define AEP_F_AEP_RAND 105
#define AEP_F_AEP_RSA_MOD_EXP 106
/* Reason codes. */
#define AEP_R_ALREADY_LOADED 100
#define AEP_R_CLOSE_HANDLES_FAILED 101
#define AEP_R_CONNECTIONS_IN_USE 102
#define AEP_R_CTRL_COMMAND_NOT_IMPLEMENTED 103
#define AEP_R_FINALIZE_FAILED 104
#define AEP_R_GENERAL_ERROR 105
#define AEP_R_GET_HANDLE_FAILED 106
#define AEP_R_GET_RANDOM_FAILED 107
#define AEP_R_INIT_FAILURE 108
#define AEP_R_MISSING_KEY_COMPONENTS 109
#define AEP_R_MOD_EXP_CRT_FAILED 110
#define AEP_R_MOD_EXP_FAILED 111
#define AEP_R_NOT_LOADED 112
#define AEP_R_OK 113
#define AEP_R_RETURN_CONNECTION_FAILED 114
#define AEP_R_SETBNCALLBACK_FAILURE 115
#define AEP_R_UNIT_FAILURE 116
#ifdef __cplusplus
}
#endif
#endif
此差异已折叠。
/* hw_sureware_err.c */
/* ====================================================================
* Copyright (c) 1999 The OpenSSL Project. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* 3. All advertising materials mentioning features or use of this
* software must display the following acknowledgment:
* "This product includes software developed by the OpenSSL Project
* for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)"
*
* 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
* endorse or promote products derived from this software without
* prior written permission. For written permission, please contact
* openssl-core@OpenSSL.org.
*
* 5. Products derived from this software may not be called "OpenSSL"
* nor may "OpenSSL" appear in their names without prior written
* permission of the OpenSSL Project.
*
* 6. Redistributions of any form whatsoever must retain the following
* acknowledgment:
* "This product includes software developed by the OpenSSL Project
* for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)"
*
* THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
* EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
* OF THE POSSIBILITY OF SUCH DAMAGE.
* ====================================================================
*
* This product includes cryptographic software written by Eric Young
* (eay@cryptsoft.com). This product includes software written by Tim
* Hudson (tjh@cryptsoft.com).
*
*/
/* NOTE: this file was auto generated by the mkerr.pl script: any changes
* made to it will be overwritten when the script next updates this file,
* only reason strings will be preserved.
*/
#include <stdio.h>
#include <openssl/err.h>
#include "hw_sureware_err.h"
/* BEGIN ERROR CODES */
#ifndef OPENSSL_NO_ERR
static ERR_STRING_DATA SUREWARE_str_functs[]=
{
{ERR_PACK(0,SUREWARE_F_SUREWAREHK_CTRL,0), "SUREWAREHK_CTRL"},
{ERR_PACK(0,SUREWARE_F_SUREWAREHK_DSA_DO_SIGN,0), "SUREWAREHK_DSA_DO_SIGN"},
{ERR_PACK(0,SUREWARE_F_SUREWAREHK_EX_FREE,0), "SUREWAREHK_EX_FREE"},
{ERR_PACK(0,SUREWARE_F_SUREWAREHK_FINISH,0), "SUREWAREHK_FINISH"},
{ERR_PACK(0,SUREWARE_F_SUREWAREHK_INIT,0), "SUREWAREHK_INIT"},
{ERR_PACK(0,SUREWARE_F_SUREWAREHK_LOAD_PRIVATE_KEY,0), "SUREWAREHK_LOAD_PRIVATE_KEY"},
{ERR_PACK(0,SUREWARE_F_SUREWAREHK_LOAD_PUBLIC_KEY,0), "SUREWAREHK_LOAD_PUBLIC_KEY"},
{ERR_PACK(0,SUREWARE_F_SUREWAREHK_MOD_EXP,0), "SUREWAREHK_MOD_EXP"},
{ERR_PACK(0,SUREWARE_F_SUREWAREHK_RAND_BYTES,0), "SUREWAREHK_RAND_BYTES"},
{ERR_PACK(0,SUREWARE_F_SUREWAREHK_RAND_SEED,0), "SUREWAREHK_RAND_SEED"},
{ERR_PACK(0,SUREWARE_F_SUREWAREHK_RSA_PRIV_DEC,0), "SUREWAREHK_RSA_PRIV_DEC"},
{ERR_PACK(0,SUREWARE_F_SUREWAREHK_RSA_PRIV_ENC,0), "SUREWAREHK_RSA_PRIV_ENC"},
{0,NULL}
};
static ERR_STRING_DATA SUREWARE_str_reasons[]=
{
{SUREWARE_R_BIO_WAS_FREED ,"bio was freed"},
{SUREWARE_R_MISSING_KEY_COMPONENTS ,"missing key components"},
{SUREWARE_R_REQUEST_FAILED ,"request failed"},
{SUREWARE_R_REQUEST_FALLBACK ,"request fallback"},
{SUREWARE_R_SIZE_TOO_LARGE_OR_TOO_SMALL ,"size too large or too small"},
{SUREWARE_R_UNIT_FAILURE ,"unit failure"},
{0,NULL}
};
#endif
#ifdef SUREWARE_LIB_NAME
static ERR_STRING_DATA SUREWARE_lib_name[]=
{
{0 ,SUREWARE_LIB_NAME},
{0,NULL}
};
#endif
static int SUREWARE_lib_error_code=0;
static int SUREWARE_error_init=1;
static void ERR_load_SUREWARE_strings(void)
{
if (SUREWARE_lib_error_code == 0)
SUREWARE_lib_error_code=ERR_get_next_error_library();
if (SUREWARE_error_init)
{
SUREWARE_error_init=0;
#ifndef OPENSSL_NO_ERR
ERR_load_strings(SUREWARE_lib_error_code,SUREWARE_str_functs);
ERR_load_strings(SUREWARE_lib_error_code,SUREWARE_str_reasons);
#endif
#ifdef SUREWARE_LIB_NAME
SUREWARE_lib_name->error = ERR_PACK(SUREWARE_lib_error_code,0,0);
ERR_load_strings(0,SUREWARE_lib_name);
#endif
}
}
static void ERR_unload_SUREWARE_strings(void)
{
if (SUREWARE_error_init == 0)
{
#ifndef OPENSSL_NO_ERR
ERR_unload_strings(SUREWARE_lib_error_code,SUREWARE_str_functs);
ERR_unload_strings(SUREWARE_lib_error_code,SUREWARE_str_reasons);
#endif
#ifdef SUREWARE_LIB_NAME
ERR_unload_strings(0,SUREWARE_lib_name);
#endif
SUREWARE_error_init=1;
}
}
static void ERR_SUREWARE_error(int function, int reason, char *file, int line)
{
if (SUREWARE_lib_error_code == 0)
SUREWARE_lib_error_code=ERR_get_next_error_library();
ERR_PUT_error(SUREWARE_lib_error_code,function,reason,file,line);
}
/* ====================================================================
* Copyright (c) 2001 The OpenSSL Project. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* 3. All advertising materials mentioning features or use of this
* software must display the following acknowledgment:
* "This product includes software developed by the OpenSSL Project
* for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
*
* 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
* endorse or promote products derived from this software without
* prior written permission. For written permission, please contact
* openssl-core@openssl.org.
*
* 5. Products derived from this software may not be called "OpenSSL"
* nor may "OpenSSL" appear in their names without prior written
* permission of the OpenSSL Project.
*
* 6. Redistributions of any form whatsoever must retain the following
* acknowledgment:
* "This product includes software developed by the OpenSSL Project
* for use in the OpenSSL Toolkit (http://www.openssl.org/)"
*
* THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
* EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
* OF THE POSSIBILITY OF SUCH DAMAGE.
* ====================================================================
*
* This product includes cryptographic software written by Eric Young
* (eay@cryptsoft.com). This product includes software written by Tim
* Hudson (tjh@cryptsoft.com).
*
*/
#ifndef HEADER_SUREWARE_ERR_H
#define HEADER_SUREWARE_ERR_H
/* BEGIN ERROR CODES */
/* The following lines are auto generated by the script mkerr.pl. Any changes
* made after this point may be overwritten when the script is next run.
*/
static void ERR_load_SUREWARE_strings(void);
static void ERR_unload_SUREWARE_strings(void);
static void ERR_SUREWARE_error(int function, int reason, char *file, int line);
#define SUREWAREerr(f,r) ERR_SUREWARE_error((f),(r),__FILE__,__LINE__)
/* Error codes for the SUREWARE functions. */
/* Function codes. */
#define SUREWARE_F_SUREWAREHK_CTRL 100
#define SUREWARE_F_SUREWAREHK_DSA_DO_SIGN 101
#define SUREWARE_F_SUREWAREHK_EX_FREE 102
#define SUREWARE_F_SUREWAREHK_FINISH 103
#define SUREWARE_F_SUREWAREHK_INIT 104
#define SUREWARE_F_SUREWAREHK_LOAD_PRIVATE_KEY 105
#define SUREWARE_F_SUREWAREHK_LOAD_PUBLIC_KEY 106
#define SUREWARE_F_SUREWAREHK_MOD_EXP 107
#define SUREWARE_F_SUREWAREHK_RAND_BYTES 108
#define SUREWARE_F_SUREWAREHK_RAND_SEED 109
#define SUREWARE_F_SUREWAREHK_RSA_PRIV_DEC 110
#define SUREWARE_F_SUREWAREHK_RSA_PRIV_ENC 111
/* Reason codes. */
#define SUREWARE_R_BIO_WAS_FREED 100
#define SUREWARE_R_MISSING_KEY_COMPONENTS 105
#define SUREWARE_R_REQUEST_FAILED 101
#define SUREWARE_R_REQUEST_FALLBACK 102
#define SUREWARE_R_SIZE_TOO_LARGE_OR_TOO_SMALL 103
#define SUREWARE_R_UNIT_FAILURE 104
#ifdef __cplusplus
}
#endif
#endif
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册