Changeset 26612 for branches/backfire


Ignore:
Timestamp:
2011-04-12T19:33:01+02:00 (6 years ago)
Author:
nbd
Message:

hostapd: properly mark random data as ready if initialization succeeds without reassociation (#9222), backport of r26611

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/backfire/package/hostapd/patches/700-random_pool_add_kernel.patch

    r26416 r26612  
    2828        struct os_time t; 
    2929        static unsigned int count = 0; 
    30 @@ -191,9 +195,13 @@ int random_get_bytes(void *buf, size_t l 
     30@@ -191,16 +195,22 @@ int random_get_bytes(void *buf, size_t l 
    3131 int random_pool_ready(void) 
    3232 { 
     
    4242         * Make sure that there is reasonable entropy available before allowing 
    4343         * some key derivation operations to proceed. 
    44 @@ -258,9 +266,15 @@ int random_pool_ready(void) 
     44         */ 
     45  
     46-       if (dummy_key_avail == sizeof(dummy_key)) 
     47+       if (dummy_key_avail == sizeof(dummy_key)) { 
     48+               random_mark_pool_ready(); 
     49                return 1; /* Already initialized - good to continue */ 
     50+       } 
     51  
     52        /* 
     53         * Try to fetch some more data from the kernel high quality 
     54@@ -232,8 +242,10 @@ int random_pool_ready(void) 
     55        dummy_key_avail += res; 
     56        close(fd); 
     57  
     58-       if (dummy_key_avail == sizeof(dummy_key)) 
     59+       if (dummy_key_avail == sizeof(dummy_key)) { 
     60+               random_mark_pool_ready(); 
     61                return 1; 
     62+       } 
     63  
     64        wpa_printf(MSG_INFO, "random: Only %u/%u bytes of strong " 
     65                   "random data available from /dev/random", 
     66@@ -243,6 +255,7 @@ int random_pool_ready(void) 
     67            total_collected + 10 * own_pool_ready > MIN_COLLECT_ENTROPY) { 
     68                wpa_printf(MSG_INFO, "random: Allow operation to proceed " 
     69                           "based on internal entropy"); 
     70+               random_mark_pool_ready(); 
     71                return 1; 
     72        } 
     73  
     74@@ -258,9 +271,15 @@ int random_pool_ready(void) 
    4575  
    4676 void random_mark_pool_ready(void) 
     
    5888  
    5989  
    60 @@ -335,3 +349,22 @@ void random_deinit(void) 
     90@@ -335,3 +354,22 @@ void random_deinit(void) 
    6191        random_close_fd(); 
    6292 #endif /* __linux__ */ 
Note: See TracChangeset for help on using the changeset viewer.