(file) Return to credcache.c CVS log (file) (dir) Up to [OMI] / omi / base

Diff for /omi/base/credcache.c between version 1.2 and 1.3

version 1.2, 2015/04/20 18:10:09 version 1.3, 2015/04/20 18:19:49
Line 24 
Line 24 
  
 #include "credcache.h" #include "credcache.h"
 #include "log.h" #include "log.h"
 #include <base/time.h>  #include <pal/sleep.h>
  
 #if defined (CONFIG_POSIX) #if defined (CONFIG_POSIX)
 # include <openssl/evp.h> # include <openssl/evp.h>
Line 74 
Line 74 
     /* Initialize salt */     /* Initialize salt */
     if (0 == RAND_load_file("/dev/urandom", 1024))     if (0 == RAND_load_file("/dev/urandom", 1024))
     {     {
         LOGW_CHAR(("failed to load /dev/urandom"));          trace_FailedLoadDevUrandom();
         return -1;         return -1;
     }     }
  
     if (0 == RAND_bytes(s_salt, sizeof(s_salt)))     if (0 == RAND_bytes(s_salt, sizeof(s_salt)))
     {     {
         LOGW_CHAR(("failed to init salt"));          trace_FailedInitSalt();
         return -1;         return -1;
     }     }
  
Line 94 
Line 94 
         !(s_md = EVP_get_digestbyname("sha224")) &&         !(s_md = EVP_get_digestbyname("sha224")) &&
         !(s_md = EVP_get_digestbyname("sha1")))         !(s_md = EVP_get_digestbyname("sha1")))
     {     {
         LOGW_CHAR(("no digest available"));          trace_NoDigestAvailable();
         return -1;         return -1;
     }     }
  
Line 205 
Line 205 
     pos = _FindUserEmptyOldest(user);     pos = _FindUserEmptyOldest(user);
  
     /* timestamp */     /* timestamp */
     if (MI_RESULT_OK != Time_Now(&s_cache[pos].timestamp))      if (PAL_TRUE != PAL_Time(&s_cache[pos].timestamp))
         return;         return;
  
     /* user name */     /* user name */
Line 237 
Line 237 
         return -1;         return -1;
  
     /* Is it expired? */     /* Is it expired? */
     if (MI_RESULT_OK != Time_Now(&now))      if (PAL_TRUE != PAL_Time(&now))
         return -1;         return -1;
  
     if (s_cache[pos].timestamp + s_expirationTime_us < now)     if (s_cache[pos].timestamp + s_expirationTime_us < now)
Line 294 
Line 294 
  
     if (0 == RAND_bytes((unsigned char*)buf, size))     if (0 == RAND_bytes((unsigned char*)buf, size))
     {     {
         LOGW_CHAR(("failed to produce random data"));          trace_FailedToProduceRandomData();
         return -1;         return -1;
     }     }
  


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

ViewCVS 0.9.2