From: Geoff Thorpe Date: Wed, 14 Jun 2000 14:28:16 +0000 (+0000) Subject: DSO_bind() is effectively a method-specific wrapper for dlopen() or X-Git-Tag: OpenSSL-engine-0_9_6-beta1~59 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=4c4ea428ccda9f19bd052ef403af3520e964f919;p=oweals%2Fopenssl.git DSO_bind() is effectively a method-specific wrapper for dlopen() or 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. --- diff --git a/crypto/engine/hw_cswift.c b/crypto/engine/hw_cswift.c index c36642c181..e85dee1511 100644 --- a/crypto/engine/hw_cswift.c +++ b/crypto/engine/hw_cswift.c @@ -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; diff --git a/crypto/engine/hw_ncipher.c b/crypto/engine/hw_ncipher.c index e285c05cf0..46871c08bd 100644 --- a/crypto/engine/hw_ncipher.c +++ b/crypto/engine/hw_ncipher.c @@ -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;