Commit ba2cad19 authored by Richard Levitte's avatar Richard Levitte
Browse files

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.
parent db0a1efc
Loading
Loading
Loading
Loading
+32 −2
Original line number Diff line number Diff line
@@ -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
+6 −0
Original line number Diff line number Diff line
@@ -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
+0 −13
Original line number Diff line number Diff line
@@ -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}
	};
+2 −13
Original line number Diff line number Diff line
@@ -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
+2 −0
Original line number Diff line number Diff line
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
Loading