Add support for AEP crypto cards to 0.9.6c. This patch is in Red Hat Linux
authorMark J. Cox <mark@openssl.org>
Mon, 12 Nov 2001 11:17:19 +0000 (11:17 +0000)
committerMark J. Cox <mark@openssl.org>
Mon, 12 Nov 2001 11:17:19 +0000 (11:17 +0000)
7.2 and been given extensive testing; it also compiles okay on our selection
of random machines (including 64-bit)
Submitted by: AEP, Mark Cox
Reviewed by: Mark Cox
PR:

CHANGES
crypto/engine/Makefile.ssl
crypto/engine/engine.h
crypto/engine/engine_err.c
crypto/engine/engine_int.h
crypto/engine/engine_list.c

diff --git a/CHANGES b/CHANGES
index 480161f69d5c7492cc5bd2d83fea5dfc1204ec67..aa98f30cb9c218a6ee11d8849efcb2e71640b790 100644 (file)
--- 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]
 
index 7a0ffe755d9ffc09f500d0450c0d302707c76358..31d7fc80bd2ba900f28acc90fe3e5dda9c443ef9 100644 (file)
@@ -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
index 2983f47034ec9340c18915fff3971491176c1afa..af0740303b9dcf2b1437f951cb56d3535c484b77 100644 (file)
@@ -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
index 0d7a31f6d517388b373c532a9ac29e328404b695..aff8642302bc8d84a623a6227ff7b3e4bd0f2920 100644 (file)
 #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}
index 447fa2a3208f4458075827e12bf612b8fdb91aaf..28d9b4a961d0bb1802769df13787c26defc455d5 100644 (file)
@@ -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
index d764c606611ca899b833365b2baea3ede579f085..582df5a79513acdc4780660ea635a75fb34a76f3 100644 (file)
@@ -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;