/[mcrypt]/libmcrypt/lib/mcrypt_modules.c
ViewVC logotype

Diff of /libmcrypt/lib/mcrypt_modules.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.2 by nmav, Sat Sep 16 02:01:38 2000 UTC revision 1.3 by nmav, Sun Sep 17 22:10:39 2000 UTC
# Line 47  int mcrypt_module_close(MCRYPT td) Line 47  int mcrypt_module_close(MCRYPT td)
47          return 0;          return 0;
48  }  }
49    
 #if 0  
 int mcrypt_modules_preopen()  
 {  
   
         if (preloaded_symbols==0) {  
                 preloaded_symbols = 1;  
                 LTDL_SET_PRELOADED_SYMBOLS();  
         }  
   
         return 0;  
 }  
 #endif  
   
50  #ifndef USE_LTDL  #ifndef USE_LTDL
51  void *mcrypt_dlopen_ext ( const char *filename) {  void *mcrypt_dlopen_ext ( const char *filename) {
52          void *ret;          void *ret;
53          char* full_path[1024];          char full_path[1054];
54    
55          ret = dlopen(full_path, RTLD_LAZY);          ret = dlopen(full_path, RTLD_LAZY);
56          if (ret==NULL) {          if (ret==NULL) {
# Line 75  void *mcrypt_dlopen_ext ( const char *fi Line 62  void *mcrypt_dlopen_ext ( const char *fi
62  }  }
63  #endif  #endif
64    
65  void *mcrypt_dlopen (const char* a_directory, const char *m_directory, const char *filename) {  void *mcrypt_dlopen ( const char* a_directory, const char *m_directory, const char *filename) {
66          void* ret=NULL;          void* ret=NULL;
67    
68  #ifdef USE_LTDL  #ifdef USE_LTDL
69            char paths[1526];
70                    
71          if (a_directory != NULL)          memset( paths, 0, 1024);
72                  lt_dladdsearchdir(a_directory);          if (a_directory != NULL) {
73          if (m_directory != NULL)                  strncat( paths, a_directory, 512);
74                  lt_dladdsearchdir(m_directory);                  strcat( paths, ":");
75            }
76            if (m_directory != NULL) {
77                    strncat( paths, m_directory, 512);
78                    strcat( paths, ":");
79            }
80            strncat( paths, LIBDIR, 512);
81    
82            lt_dlsetsearchpath(paths);
83    
         if (a_directory==NULL && m_directory==NULL) lt_dladdsearchdir(LIBDIR);  
84          ret = lt_dlopenext(filename);          ret = lt_dlopenext(filename);
           
85          if (ret==NULL) ret = lt_dlopen(filename);          if (ret==NULL) ret = lt_dlopen(filename);
86            
87          return ret;          return ret;
88    
89  #else  #else
90          char* full_path[1050];          char full_path[1050];
91                    
92          if (a_directory!=NULL) {          if (a_directory!=NULL) {
93                  strncpy(full_path, a_directory, 512);                  strncpy(full_path, a_directory, 512);
# Line 116  MCRYPT mcrypt_module_open(char *algorith Line 112  MCRYPT mcrypt_module_open(char *algorith
112                            char *a_directory, char *mode, char *m_directory)                            char *a_directory, char *mode, char *m_directory)
113  {  {
114          MCRYPT td;          MCRYPT td;
         char* tmpchar;  
115                    
116          td = calloc(1, sizeof(CRYPT_STREAM));          td = calloc(1, sizeof(CRYPT_STREAM));
117    
# Line 468  int mcrypt_module_self_test(char *algori Line 463  int mcrypt_module_self_test(char *algori
463  {  {
464          int i;          int i;
465          lt_dlhandle *_handle;          lt_dlhandle *_handle;
         char* tmpchar;  
466          int (*_self_test) (void);          int (*_self_test) (void);
467    
468    
# Line 499  int mcrypt_module_algorithm_version(char Line 493  int mcrypt_module_algorithm_version(char
493  {  {
494          int i;          int i;
495          lt_dlhandle _handle;          lt_dlhandle _handle;
         char* tmpchar;  
496          int (*_version) (void);          int (*_version) (void);
497    
498          if (lt_dlinit() != 0) {          if (lt_dlinit() != 0) {
# Line 528  int mcrypt_module_mode_version(char *mod Line 521  int mcrypt_module_mode_version(char *mod
521  {  {
522          int i;          int i;
523          lt_dlhandle *_handle;          lt_dlhandle *_handle;
         char* tmpchar;  
524          int (*_version) (void);          int (*_version) (void);
525    
526          if (lt_dlinit() != 0) {          if (lt_dlinit() != 0) {
# Line 558  int mcrypt_module_is_block_algorithm(cha Line 550  int mcrypt_module_is_block_algorithm(cha
550  {  {
551          int i;          int i;
552          lt_dlhandle _handle;          lt_dlhandle _handle;
         char* tmpchar;  
553          int (*_is_block_algorithm) (void);          int (*_is_block_algorithm) (void);
554    
555          if (lt_dlinit() != 0) {          if (lt_dlinit() != 0) {
# Line 589  int mcrypt_module_is_block_algorithm_mod Line 580  int mcrypt_module_is_block_algorithm_mod
580  {  {
581          int i;          int i;
582          lt_dlhandle *_handle;          lt_dlhandle *_handle;
         char* tmpchar;  
583          int (*_is_a_block_mode) (void);          int (*_is_a_block_mode) (void);
584    
585          if (lt_dlinit() != 0) {          if (lt_dlinit() != 0) {
# Line 619  int mcrypt_module_is_block_mode(char *mo Line 609  int mcrypt_module_is_block_mode(char *mo
609  {  {
610          int i;          int i;
611          lt_dlhandle *_handle;          lt_dlhandle *_handle;
         char* tmpchar;  
612          int (*_is_block_mode) (void);          int (*_is_block_mode) (void);
613    
614    
# Line 649  int mcrypt_module_get_algo_block_size(ch Line 638  int mcrypt_module_get_algo_block_size(ch
638  {  {
639          int i;          int i;
640          lt_dlhandle _handle;          lt_dlhandle _handle;
         char* tmpchar;  
641          int (*_get_block_size) (void);          int (*_get_block_size) (void);
642    
643          if (lt_dlinit() != 0) {          if (lt_dlinit() != 0) {
# Line 678  int mcrypt_module_get_algo_key_size(char Line 666  int mcrypt_module_get_algo_key_size(char
666  {  {
667          int i;          int i;
668          lt_dlhandle _handle;          lt_dlhandle _handle;
         char* tmpchar;  
669          int (*_get_key_size) (void);          int (*_get_key_size) (void);
670    
671          if (lt_dlinit() != 0) {          if (lt_dlinit() != 0) {
# Line 711  int *mcrypt_module_get_algo_supported_ke Line 698  int *mcrypt_module_get_algo_supported_ke
698          lt_dlhandle _handle;          lt_dlhandle _handle;
699          int *(*_mcrypt_get_key_sizes) (int *);          int *(*_mcrypt_get_key_sizes) (int *);
700          int *size;          int *size;
         char* tmpchar;  
701    
702          if (lt_dlinit() != 0) {          if (lt_dlinit() != 0) {
703                  *len = 0;                  *len = 0;

Legend:
Removed from v.1.2  
changed lines
  Added in v.1.3

webmaster@linux.gr
ViewVC Help
Powered by ViewVC 1.1.26