Commit 4c4ea428 authored by Geoff Thorpe's avatar Geoff Thorpe
Browse files

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.
parent 28e94dc7
Loading
Loading
Loading
Loading
+8 −4
Original line number Diff line number Diff line
@@ -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;
+14 −7
Original line number Diff line number Diff line
@@ -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;