X-Git-Url: https://git.openssl.org/?p=openssl.git;a=blobdiff_plain;f=engines%2Fe_aep.c;h=abcdb1538ff2a671f99381f775d92645d0cdca84;hp=93a4be73aec9dd96996d1a0c6e953ac0a19d52c3;hb=a8e4ac6a2fe67c19672ecf0c6aeafa15801ce3a5;hpb=0f113f3ee4d629ef9a4a30911b22b224772085e5 diff --git a/engines/e_aep.c b/engines/e_aep.c index 93a4be73ae..abcdb1538f 100644 --- a/engines/e_aep.c +++ b/engines/e_aep.c @@ -403,8 +403,7 @@ static const char *get_AEP_LIBNAME(void) static void free_AEP_LIBNAME(void) { - if (AEP_LIBNAME) - OPENSSL_free((void *)AEP_LIBNAME); + OPENSSL_free(AEP_LIBNAME); AEP_LIBNAME = NULL; } @@ -463,22 +462,22 @@ static int aep_init(ENGINE *e) /* Attempt to load libaep.so. */ aep_dso = DSO_load(NULL, get_AEP_LIBNAME(), NULL, 0); - if (aep_dso == NULL) { AEPHKerr(AEPHK_F_AEP_INIT, AEPHK_R_NOT_LOADED); goto err; } - if (!(p1 = (t_AEP_ModExp *) DSO_bind_func(aep_dso, AEP_F1)) || - !(p2 = (t_AEP_ModExpCrt *) DSO_bind_func(aep_dso, AEP_F2)) || +#define BINDIT(t, name) (t *)DSO_bind_func(aep_dso, name) + if ((p1 = BINDIT(t_AEP_ModExp, AEP_F1)) == NULL + || (p2 = BINDIT(t_AEP_ModExpCrt, AEP_F2)) == NULL # ifdef AEPRAND - !(p3 = (t_AEP_GenRandom *) DSO_bind_func(aep_dso, AEP_F3)) || + || (p3 = BINDIT(t_AEP_GenRandom, AEP_F3)) == NULL # endif - !(p4 = (t_AEP_Finalize *) DSO_bind_func(aep_dso, AEP_F4)) || - !(p5 = (t_AEP_Initialize *) DSO_bind_func(aep_dso, AEP_F5)) || - !(p6 = (t_AEP_OpenConnection *) DSO_bind_func(aep_dso, AEP_F6)) || - !(p7 = (t_AEP_SetBNCallBacks *) DSO_bind_func(aep_dso, AEP_F7)) || - !(p8 = (t_AEP_CloseConnection *) DSO_bind_func(aep_dso, AEP_F8))) { + || (p4 = BINDIT(t_AEP_Finalize, AEP_F4)) == NULL + || (p5 = BINDIT(t_AEP_Initialize, AEP_F5)) == NULL + || (p6 = BINDIT(t_AEP_OpenConnection, AEP_F6)) == NULL + || (p7 = BINDIT(t_AEP_SetBNCallBacks, AEP_F7)) == NULL + || (p8 = BINDIT(t_AEP_CloseConnection, AEP_F8)) == NULL) { AEPHKerr(AEPHK_F_AEP_INIT, AEPHK_R_NOT_LOADED); goto err; } @@ -502,8 +501,7 @@ static int aep_init(ENGINE *e) err: - if (aep_dso) - DSO_free(aep_dso); + DSO_free(aep_dso); aep_dso = NULL; p_AEP_OpenConnection = NULL;