DSO_bind() is effectively a method-specific wrapper for dlopen() or
authorGeoff Thorpe <geoff@openssl.org>
Wed, 14 Jun 2000 14:28:16 +0000 (14:28 +0000)
committerGeoff Thorpe <geoff@openssl.org>
Wed, 14 Jun 2000 14:28:16 +0000 (14:28 +0000)
whatever the underlying API is. It must return (void *) because shared
libraries can expose functions, structures, or whatever. However, some
compilers give loads of warnings about casted function pointers through
this code, so I am explicitly casting them to the right prototypes.

crypto/engine/hw_cswift.c
crypto/engine/hw_ncipher.c

index c36642c18192246299427700aa3da204c90125f2..e85dee1511a9b7167d8b9d9bf985d9cc9604d48b 100644 (file)
@@ -263,10 +263,14 @@ static int cswift_init()
                ENGINEerr(ENGINE_F_CSWIFT_INIT,ENGINE_R_DSO_FAILURE);
                goto err;
                }
-       if(!(p1 = DSO_bind(cswift_dso, CSWIFT_F1)) ||
-                       !(p2 = DSO_bind(cswift_dso, CSWIFT_F2)) ||
-                       !(p3 = DSO_bind(cswift_dso, CSWIFT_F3)) ||
-                       !(p4 = DSO_bind(cswift_dso, CSWIFT_F4)))
+       if(!(p1 = (t_swAcquireAccContext *)
+                               DSO_bind(cswift_dso, CSWIFT_F1)) ||
+                       !(p2 = (t_swAttachKeyParam *)
+                               DSO_bind(cswift_dso, CSWIFT_F2)) ||
+                       !(p3 = (t_swSimpleRequest *)
+                               DSO_bind(cswift_dso, CSWIFT_F3)) ||
+                       !(p4 = (t_swReleaseAccContext *)
+                               DSO_bind(cswift_dso, CSWIFT_F4)))
                {
                ENGINEerr(ENGINE_F_CSWIFT_INIT,ENGINE_R_DSO_FAILURE);
                goto err;
index e285c05cf0191154ad0e584e3f0259bafebd7417..46871c08bd526d1513c3ed482aa39cb1901f9faf 100644 (file)
@@ -366,13 +366,20 @@ static int hwcrhk_init()
                ENGINEerr(ENGINE_F_HWCRHK_INIT,ENGINE_R_DSO_FAILURE);
                goto err;
                }
-       if(!(p1 = DSO_bind(hwcrhk_dso, n_hwcrhk_Init)) ||
-               !(p2 = DSO_bind(hwcrhk_dso, n_hwcrhk_Finish)) ||
-               !(p3 = DSO_bind(hwcrhk_dso, n_hwcrhk_ModExp)) ||
-               !(p4 = DSO_bind(hwcrhk_dso, n_hwcrhk_RSA)) ||
-               !(p5 = DSO_bind(hwcrhk_dso, n_hwcrhk_RSAUnloadKey)) ||
-               !(p6 = DSO_bind(hwcrhk_dso, n_hwcrhk_RandomBytes)) ||
-               !(p7 = DSO_bind(hwcrhk_dso, n_hwcrhk_ModExpCRT)))
+       if(!(p1 = (HWCryptoHook_Init_t *)
+                       DSO_bind(hwcrhk_dso, n_hwcrhk_Init)) ||
+               !(p2 = (HWCryptoHook_Finish_t *)
+                       DSO_bind(hwcrhk_dso, n_hwcrhk_Finish)) ||
+               !(p3 = (HWCryptoHook_ModExp_t *)
+                       DSO_bind(hwcrhk_dso, n_hwcrhk_ModExp)) ||
+               !(p4 = (HWCryptoHook_RSA_t *)
+                       DSO_bind(hwcrhk_dso, n_hwcrhk_RSA)) ||
+               !(p5 = (HWCryptoHook_RSAUnloadKey_t *)
+                       DSO_bind(hwcrhk_dso, n_hwcrhk_RSAUnloadKey)) ||
+               !(p6 = (HWCryptoHook_RandomBytes_t *)
+                       DSO_bind(hwcrhk_dso, n_hwcrhk_RandomBytes)) ||
+               !(p7 = (HWCryptoHook_ModExpCRT_t *)
+                       DSO_bind(hwcrhk_dso, n_hwcrhk_ModExpCRT)))
                {
                ENGINEerr(ENGINE_F_HWCRHK_INIT,ENGINE_R_DSO_FAILURE);
                goto err;