diff --git a/CHANGES b/CHANGES index 480161f69d..aa98f30cb9 100644 --- a/CHANGES +++ b/CHANGES @@ -4,7 +4,9 @@ Changes between 0.9.6b and 0.9.6c [XX xxx XXXX] - *) + *) Add support for crypto accelerator cards from Accelerated + Encryption Processing, www.aep.ie. (Use engine 'aep') + [AEP Inc. and Mark Cox] Changes between 0.9.6a and 0.9.6b [9 Jul 2001] diff --git a/crypto/engine/Makefile.ssl b/crypto/engine/Makefile.ssl index 7a0ffe755d..31d7fc80bd 100644 --- a/crypto/engine/Makefile.ssl +++ b/crypto/engine/Makefile.ssl @@ -23,9 +23,9 @@ APPS= LIB=$(TOP)/libcrypto.a LIBSRC= engine_err.c engine_lib.c engine_list.c engine_openssl.c \ - hw_atalla.c hw_cswift.c hw_ncipher.c + hw_atalla.c hw_cswift.c hw_ncipher.c hw_aep.c LIBOBJ= engine_err.o engine_lib.o engine_list.o engine_openssl.o \ - hw_atalla.o hw_cswift.o hw_ncipher.o + hw_atalla.o hw_cswift.o hw_ncipher.o hw_aep.o SRC= $(LIBSRC) @@ -156,6 +156,25 @@ engine_openssl.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h engine_openssl.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h engine_openssl.o: ../../include/openssl/sha.h ../../include/openssl/stack.h engine_openssl.o: ../../include/openssl/symhacks.h ../cryptlib.h engine_int.h +hw_aep.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h +hw_aep.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h +hw_aep.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h +hw_aep.o: ../../include/openssl/crypto.h ../../include/openssl/des.h +hw_aep.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h +hw_aep.o: ../../include/openssl/dso.h ../../include/openssl/e_os.h +hw_aep.o: ../../include/openssl/e_os2.h ../../include/openssl/engine.h +hw_aep.o: ../../include/openssl/err.h ../../include/openssl/evp.h +hw_aep.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h +hw_aep.o: ../../include/openssl/md2.h ../../include/openssl/md4.h +hw_aep.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h +hw_aep.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h +hw_aep.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h +hw_aep.o: ../../include/openssl/rand.h ../../include/openssl/rc2.h +hw_aep.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h +hw_aep.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h +hw_aep.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h +hw_aep.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h +hw_aep.o: ../cryptlib.h engine_int.h vendor_defns/aep.h hw_atalla.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h hw_atalla.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h hw_atalla.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h diff --git a/crypto/engine/engine.h b/crypto/engine/engine.h index 2983f47034..af0740303b 100644 --- a/crypto/engine/engine.h +++ b/crypto/engine/engine.h @@ -297,6 +297,13 @@ void ERR_load_ENGINE_strings(void); /* Error codes for the ENGINE functions. */ /* Function codes. */ + +#define ENGINE_F_AEP_FINISH 156 +#define ENGINE_F_AEP_INIT 157 +#define ENGINE_F_AEP_MOD_EXP 158 +#define ENGINE_F_AEP_MOD_EXP_CRT 160 +#define ENGINE_F_AEP_RAND 161 +#define ENGINE_F_AEP_RSA_MOD_EXP 159 #define ENGINE_F_ATALLA_FINISH 135 #define ENGINE_F_ATALLA_INIT 136 #define ENGINE_F_ATALLA_MOD_EXP 137 @@ -359,6 +366,8 @@ void ERR_load_ENGINE_strings(void); #define ENGINE_F_LOG_MESSAGE 141 /* Reason codes. */ + +#define ENGINE_R_AEP_INIT_FAILURE 132 #define ENGINE_R_ALREADY_LOADED 100 #define ENGINE_R_BIO_WAS_FREED 121 #define ENGINE_R_BN_CTX_FULL 101 @@ -372,10 +381,13 @@ void ERR_load_ENGINE_strings(void); #define ENGINE_R_FAILED_LOADING_PUBLIC_KEY 129 #define ENGINE_R_FINISH_FAILED 106 #define ENGINE_R_GET_HANDLE_FAILED 107 +#define ENGINE_R_GET_RANDOM_FAILED 133 #define ENGINE_R_ID_OR_NAME_MISSING 108 #define ENGINE_R_INIT_FAILED 109 #define ENGINE_R_INTERNAL_LIST_ERROR 110 #define ENGINE_R_MISSING_KEY_COMPONENTS 111 +#define ENGINE_R_MOD_EXP_CRT_FAILED 134 +#define ENGINE_R_MOD_EXP_FAILED 131 #define ENGINE_R_NOT_INITIALISED 117 #define ENGINE_R_NOT_LOADED 112 #define ENGINE_R_NO_CALLBACK 127 @@ -386,6 +398,8 @@ void ERR_load_ENGINE_strings(void); #define ENGINE_R_NO_SUCH_ENGINE 116 #define ENGINE_R_NO_UNLOAD_FUNCTION 126 #define ENGINE_R_PROVIDE_PARAMETERS 113 +#define ENGINE_R_RETURN_CONNECTION_FAILED 135 +#define ENGINE_R_SETBNCALLBACK_FAILURE 136 #define ENGINE_R_REQUEST_FAILED 114 #define ENGINE_R_REQUEST_FALLBACK 118 #define ENGINE_R_SIZE_TOO_LARGE_OR_TOO_SMALL 122 diff --git a/crypto/engine/engine_err.c b/crypto/engine/engine_err.c index 0d7a31f6d5..aff8642302 100644 --- a/crypto/engine/engine_err.c +++ b/crypto/engine/engine_err.c @@ -66,6 +66,12 @@ #ifndef NO_ERR static ERR_STRING_DATA ENGINE_str_functs[]= { +{ERR_PACK(0,ENGINE_F_AEP_FINISH,0), "AEP_FINISH"}, +{ERR_PACK(0,ENGINE_F_AEP_INIT,0), "AEP_INIT"}, +{ERR_PACK(0,ENGINE_F_AEP_MOD_EXP,0), "AEP_MOD_EXP"}, +{ERR_PACK(0,ENGINE_F_AEP_MOD_EXP_CRT,0), "AEP_MOD_EXP_CRT"}, +{ERR_PACK(0,ENGINE_F_AEP_RAND,0), "AEP_RAND"}, +{ERR_PACK(0,ENGINE_F_AEP_RSA_MOD_EXP,0), "AEP_RSA_MOD_EXP"}, {ERR_PACK(0,ENGINE_F_ATALLA_FINISH,0), "ATALLA_FINISH"}, {ERR_PACK(0,ENGINE_F_ATALLA_INIT,0), "ATALLA_INIT"}, {ERR_PACK(0,ENGINE_F_ATALLA_MOD_EXP,0), "ATALLA_MOD_EXP"}, @@ -131,6 +137,7 @@ static ERR_STRING_DATA ENGINE_str_functs[]= static ERR_STRING_DATA ENGINE_str_reasons[]= { +{ENGINE_R_AEP_INIT_FAILURE ,"aep init failure"}, {ENGINE_R_ALREADY_LOADED ,"already loaded"}, {ENGINE_R_BIO_WAS_FREED ,"bio was freed"}, {ENGINE_R_BN_CTX_FULL ,"BN_CTX full"}, @@ -144,10 +151,13 @@ static ERR_STRING_DATA ENGINE_str_reasons[]= {ENGINE_R_FAILED_LOADING_PUBLIC_KEY ,"failed loading public key"}, {ENGINE_R_FINISH_FAILED ,"finish failed"}, {ENGINE_R_GET_HANDLE_FAILED ,"could not obtain hardware handle"}, +{ENGINE_R_GET_RANDOM_FAILED ,"get random failed"}, {ENGINE_R_ID_OR_NAME_MISSING ,"'id' or 'name' missing"}, {ENGINE_R_INIT_FAILED ,"init failed"}, {ENGINE_R_INTERNAL_LIST_ERROR ,"internal list error"}, {ENGINE_R_MISSING_KEY_COMPONENTS ,"missing key components"}, +{ENGINE_R_MOD_EXP_CRT_FAILED ,"mod exp crt failed"}, +{ENGINE_R_MOD_EXP_FAILED ,"mod exp failed"}, {ENGINE_R_NOT_INITIALISED ,"not initialised"}, {ENGINE_R_NOT_LOADED ,"not loaded"}, {ENGINE_R_NO_CALLBACK ,"no callback"}, @@ -160,6 +170,8 @@ static ERR_STRING_DATA ENGINE_str_reasons[]= {ENGINE_R_PROVIDE_PARAMETERS ,"provide parameters"}, {ENGINE_R_REQUEST_FAILED ,"request failed"}, {ENGINE_R_REQUEST_FALLBACK ,"request fallback"}, +{ENGINE_R_RETURN_CONNECTION_FAILED ,"return connection failed"}, +{ENGINE_R_SETBNCALLBACK_FAILURE ,"setbncallback failure"}, {ENGINE_R_SIZE_TOO_LARGE_OR_TOO_SMALL ,"size too large or too small"}, {ENGINE_R_UNIT_FAILURE ,"unit failure"}, {0,NULL} diff --git a/crypto/engine/engine_int.h b/crypto/engine/engine_int.h index 447fa2a320..28d9b4a961 100644 --- a/crypto/engine/engine_int.h +++ b/crypto/engine/engine_int.h @@ -151,6 +151,11 @@ ENGINE *ENGINE_ncipher(); ENGINE *ENGINE_atalla(); #endif /* !NO_HW_ATALLA */ +#ifndef NO_HW_AEP +/* Returns a structure of AEP methods. */ +ENGINE *ENGINE_aep(); +#endif /* !NO_HW_AEP */ + #endif /* !NO_HW */ #ifdef __cplusplus diff --git a/crypto/engine/engine_list.c b/crypto/engine/engine_list.c index d764c60661..582df5a795 100644 --- a/crypto/engine/engine_list.c +++ b/crypto/engine/engine_list.c @@ -198,6 +198,10 @@ static int engine_internal_check(void) if(!engine_list_add(ENGINE_atalla())) return 0; #endif /* !NO_HW_ATALLA */ +#ifndef NO_HW_AEP + if(!engine_list_add(ENGINE_aep())) + return 0; +#endif /* !NO_HW_AEP */ #endif /* !NO_HW */ engine_list_flag = 1; return 1;