/[winpt]/trunk/Src/wptPassCache.cpp
ViewVC logotype

Diff of /trunk/Src/wptPassCache.cpp

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

revision 23 by twoaday, Fri Sep 30 10:10:16 2005 UTC revision 25 by twoaday, Wed Oct 12 10:04:26 2005 UTC
# Line 55  static ITEM thecache; Line 55  static ITEM thecache;
55  static void  static void
56  release_data (struct secret_data_s * data)  release_data (struct secret_data_s * data)
57  {  {
58      free( data );      free (data);
59  }  }
60    
61    
62  static void  static void
63  wipe_data (void * data, size_t dlen)  wipe_data (void * data, size_t dlen)
64  {  {
65      memset( data, 0xff, dlen );      memset (data, 0xff, dlen);
66      memset( data, 0xaa, dlen );      memset (data, 0xaa, dlen);
67      memset( data, 0x55, dlen );      memset (data, 0x55, dlen);
68      memset( data, 0x00, dlen );      memset (data, 0x00, dlen);
69  }  }
70    
71    
72  static struct secret_data_s *  static struct secret_data_s *
73  new_data( const void * data, size_t length )  new_data (const void * data, size_t length)
74  {  {
75      struct secret_data_s * d;      struct secret_data_s * d;
76      int total;      int total;
# Line 148  housekeeping( void ) Line 148  housekeeping( void )
148    
149    
150  void  void
151  agent_flush_cache( void )  agent_flush_cache (void)
152  {  {
153      ITEM r;          ITEM r;    
154    
155      for( r=thecache; r; r = r->next ) {      for (r=thecache; r; r = r->next) {
156          if( !r->lockcount && r->pw ) {          if( !r->lockcount && r->pw ) {
157              wipe_data( r->pw, r->pwlen );              wipe_data (r->pw, r->pwlen);
158              release_data( r->pw );              release_data (r->pw);
159              r->pw = NULL;              r->pw = NULL;
160              r->accessed = 0;              r->accessed = 0;
161          }          }
162          else if( r->lockcount && r->pw ) {          else if (r->lockcount && r->pw) {
163              r->accessed = 0;              r->accessed = 0;
164              r->ttl = 0;              r->ttl = 0;
165          }          }
# Line 245  agent_put_cache( const char * key, const Line 245  agent_put_cache( const char * key, const
245    
246  /* Try to find an item in the cache */  /* Try to find an item in the cache */
247  const char *  const char *
248  agent_get_cache( const char * key, void ** cache_id )  agent_get_cache (const char *key, void **cache_id)
249  {  {
250      ITEM r;      ITEM r;
251            

Legend:
Removed from v.23  
changed lines
  Added in v.25

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26