1 |
/* |
/* |
2 |
* Copyright (C) 1998,1999,2000 Nikos Mavroyanopoulos |
* Copyright (C) 1998,1999,2000,2001 Nikos Mavroyanopoulos |
3 |
* |
* |
4 |
* This library is free software; you can redistribute it and/or modify it |
* This library is free software; you can redistribute it and/or modify it |
5 |
* under the terms of the GNU Library General Public License as published |
* under the terms of the GNU Library General Public License as published |
48 |
return 0; |
return 0; |
49 |
} |
} |
50 |
|
|
51 |
static lt_ptr search_symlist_lib(const char* name) { |
lt_ptr _mcrypt_search_symlist_lib(const char* name) { |
52 |
int i=0; |
int i=0; |
53 |
|
|
54 |
while( mps[i].name!=0 || mps[i].address!=0) { |
while( mps[i].name!=0 || mps[i].address!=0) { |
62 |
return NULL; |
return NULL; |
63 |
} |
} |
64 |
|
|
65 |
static lt_ptr search_symlist_sym(mcrypt_dlhandle handle, const char* _name) { |
lt_ptr _mcrypt_search_symlist_sym(mcrypt_dlhandle handle, const char* _name) { |
66 |
int i=0; |
int i=0; |
67 |
char name[MAX_MOD_SIZE]; |
char name[MAX_MOD_SIZE]; |
68 |
|
|
98 |
if (mod!=MCRYPT_INTERNAL_HANDLER) |
if (mod!=MCRYPT_INTERNAL_HANDLER) |
99 |
return lt_dlsym(mod, str); |
return lt_dlsym(mod, str); |
100 |
else |
else |
101 |
return search_symlist_sym(handle, str); |
return _mcrypt_search_symlist_sym(handle, str); |
102 |
|
|
103 |
} |
} |
104 |
|
|
132 |
else |
else |
133 |
strcpy( handle->name, filename); |
strcpy( handle->name, filename); |
134 |
|
|
135 |
if (search_symlist_lib(filename)!=NULL) { |
if (_mcrypt_search_symlist_lib(filename)!=NULL) { |
136 |
handle->handle = MCRYPT_INTERNAL_HANDLER; |
handle->handle = MCRYPT_INTERNAL_HANDLER; |
137 |
return handle->handle; |
return handle->handle; |
138 |
} |
} |
349 |
} |
} |
350 |
|
|
351 |
WIN32DLL_DEFINE |
WIN32DLL_DEFINE |
352 |
char *mcrypt_enc_get_algorithms_name(MCRYPT td) |
const char *mcrypt_enc_get_algorithms_name(MCRYPT td) |
353 |
{ |
{ |
354 |
char *(*_mcrypt_get_algorithms_name) (void); |
const char *(*_mcrypt_get_algorithms_name) (void); |
355 |
|
|
356 |
_mcrypt_get_algorithms_name = |
_mcrypt_get_algorithms_name = |
357 |
mcrypt_dlsym(td->algorithm_handle, "_mcrypt_get_algorithms_name"); |
mcrypt_dlsym(td->algorithm_handle, "_mcrypt_get_algorithms_name"); |
397 |
} |
} |
398 |
|
|
399 |
WIN32DLL_DEFINE |
WIN32DLL_DEFINE |
400 |
char *mcrypt_enc_get_modes_name(MCRYPT td) |
const char *mcrypt_enc_get_modes_name(MCRYPT td) |
401 |
{ |
{ |
402 |
char *(*_mcrypt_get_modes_name) (void); |
const char *(*_mcrypt_get_modes_name) (void); |
403 |
|
|
404 |
_mcrypt_get_modes_name = mcrypt_dlsym(td->mode_handle, "_mcrypt_get_modes_name"); |
_mcrypt_get_modes_name = mcrypt_dlsym(td->mode_handle, "_mcrypt_get_modes_name"); |
405 |
return _mcrypt_get_modes_name(); |
return _mcrypt_get_modes_name(); |