30 |
|
|
31 |
int mcrypt_algorithm_module_ok(const char *file, const char *directory); |
int mcrypt_algorithm_module_ok(const char *file, const char *directory); |
32 |
int mcrypt_mode_module_ok(const char *file, const char *directory); |
int mcrypt_mode_module_ok(const char *file, const char *directory); |
33 |
#ifndef USE_LTDL |
|
34 |
void *mcrypt_dlopen_ext(const char *filename); |
void *mcrypt_dlopen(mcrypt_dlhandle *handle, const char *a_directory, const char *m_directory, |
|
#endif |
|
|
void *mcrypt_dlopen(const char *a_directory, const char *m_directory, |
|
35 |
const char *filename); |
const char *filename); |
36 |
|
|
37 |
#ifdef HAVE_READDIR_R |
#ifdef HAVE_READDIR_R |
73 |
|
|
74 |
} |
} |
75 |
|
|
76 |
|
static char* inc_algos[] = { |
77 |
|
"arcfour", |
78 |
|
NULL |
79 |
|
}; |
80 |
|
|
81 |
|
static char* inc_modes[] = { |
82 |
|
"stream", |
83 |
|
NULL |
84 |
|
}; |
85 |
|
|
86 |
|
|
87 |
WIN32DLL_DEFINE char **mcrypt_list_algorithms(char *libdir, int *size) |
WIN32DLL_DEFINE char **mcrypt_list_algorithms(char *libdir, int *size) |
88 |
{ |
{ |
89 |
DIR *pdir; |
DIR *pdir; |
92 |
char **filename = NULL, *ptr; |
char **filename = NULL, *ptr; |
93 |
int tmpsize; |
int tmpsize; |
94 |
|
|
95 |
|
|
96 |
*size = 0; |
*size = 0; |
97 |
|
|
98 |
if (libdir == NULL) { |
if (libdir == NULL) { |
228 |
int mcrypt_algorithm_module_ok(const char *file, const char *directory) |
int mcrypt_algorithm_module_ok(const char *file, const char *directory) |
229 |
{ |
{ |
230 |
word32 ret; |
word32 ret; |
231 |
lt_dlhandle _handle; |
mcrypt_dlhandle _handle; |
232 |
|
void* rr; |
233 |
int (*_version) (void); |
int (*_version) (void); |
234 |
|
|
235 |
if (file == NULL && directory == NULL) { |
if (file == NULL && directory == NULL) { |
243 |
|
|
244 |
/* LTDL_SET_PRELOADED_SYMBOLS(); */ |
/* LTDL_SET_PRELOADED_SYMBOLS(); */ |
245 |
|
|
246 |
_handle = mcrypt_dlopen(directory, NULL, file); |
rr = mcrypt_dlopen(&_handle, directory, NULL, file); |
247 |
|
|
248 |
if (!_handle) { |
if (!rr) { |
249 |
lt_dlexit(); |
lt_dlexit(); |
250 |
return MCRYPT_UNKNOWN_ERROR; |
return MCRYPT_UNKNOWN_ERROR; |
251 |
} |
} |
252 |
|
|
253 |
|
|
254 |
_version = lt_dlsym(_handle, "_mcrypt_algorithm_version"); |
_version = mcrypt_dlsym(_handle, "_mcrypt_algorithm_version"); |
255 |
|
|
256 |
if (_version == NULL) { |
if (_version == NULL) { |
257 |
lt_dlclose(_handle); |
mcrypt_dlclose(_handle); |
258 |
lt_dlexit(); |
lt_dlexit(); |
259 |
return MCRYPT_UNKNOWN_ERROR; |
return MCRYPT_UNKNOWN_ERROR; |
260 |
} |
} |
261 |
|
|
262 |
ret = _version(); |
ret = _version(); |
263 |
|
|
264 |
lt_dlclose(_handle); |
mcrypt_dlclose(_handle); |
265 |
lt_dlexit(); |
lt_dlexit(); |
266 |
|
|
267 |
return ret; |
return ret; |
272 |
int mcrypt_mode_module_ok(const char *file, const char *directory) |
int mcrypt_mode_module_ok(const char *file, const char *directory) |
273 |
{ |
{ |
274 |
word32 ret; |
word32 ret; |
275 |
lt_dlhandle _handle; |
mcrypt_dlhandle _handle; |
276 |
|
void* rr; |
277 |
int (*_version) (void); |
int (*_version) (void); |
278 |
|
|
279 |
if (file == NULL && directory == NULL) { |
if (file == NULL && directory == NULL) { |
285 |
} |
} |
286 |
/* LTDL_SET_PRELOADED_SYMBOLS(); */ |
/* LTDL_SET_PRELOADED_SYMBOLS(); */ |
287 |
|
|
288 |
_handle = mcrypt_dlopen(directory, NULL, file); |
rr = mcrypt_dlopen(&_handle, directory, NULL, file); |
289 |
|
|
290 |
if (!_handle) { |
if (!rr) { |
291 |
lt_dlexit(); |
lt_dlexit(); |
292 |
return MCRYPT_UNKNOWN_ERROR; |
return MCRYPT_UNKNOWN_ERROR; |
293 |
} |
} |
294 |
|
|
295 |
|
|
296 |
_version = lt_dlsym(_handle, "_mcrypt_mode_version"); |
_version = mcrypt_dlsym(_handle, "_mcrypt_mode_version"); |
297 |
|
|
298 |
if (_version == NULL) { |
if (_version == NULL) { |
299 |
lt_dlclose(_handle); |
mcrypt_dlclose(_handle); |
300 |
lt_dlexit(); |
lt_dlexit(); |
301 |
return MCRYPT_UNKNOWN_ERROR; |
return MCRYPT_UNKNOWN_ERROR; |
302 |
} |
} |
303 |
|
|
304 |
ret = _version(); |
ret = _version(); |
305 |
|
|
306 |
lt_dlclose(_handle); |
mcrypt_dlclose(_handle); |
307 |
lt_dlexit(); |
lt_dlexit(); |
308 |
|
|
309 |
return ret; |
return ret; |