Ignore:
Timestamp:
2011-04-02T21:45:56+02:00 (6 years ago)
Author:
nbd
Message:

hostapd: update to latest trunk version (merge r26414, r26415)

File:
1 edited

Legend:

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

    r26370 r26416  
    11--- a/src/crypto/random.c 
    22+++ b/src/crypto/random.c 
    3 @@ -47,6 +47,8 @@ 
     3@@ -38,6 +38,8 @@ 
     4 #include "sha1.h" 
     5 #include "random.h" 
     6  
     7+#define RANDOM_STAMPFILE "/var/run/.random_available" 
     8+ 
     9 #define POOL_WORDS 32 
     10 #define POOL_WORDS_MASK (POOL_WORDS - 1) 
     11 #define POOL_TAP1 26 
     12@@ -48,6 +50,8 @@ 
    413 #define EXTRACT_LEN 16 
    514 #define MIN_READY_MARK 2 
     
    1019 static unsigned int input_rotate = 0; 
    1120 static unsigned int pool_pos = 0; 
    12 @@ -120,7 +122,7 @@ static void random_extract(u8 *out) 
     21@@ -122,7 +126,7 @@ static void random_extract(u8 *out) 
    1322 } 
    1423  
     
    1928        struct os_time t; 
    2029        static unsigned int count = 0; 
    21 @@ -260,3 +262,22 @@ void random_mark_pool_ready(void) 
     30@@ -191,9 +195,13 @@ int random_get_bytes(void *buf, size_t l 
     31 int random_pool_ready(void) 
     32 { 
     33 #ifdef __linux__ 
     34+       struct stat st; 
     35        int fd; 
     36        ssize_t res; 
     37  
     38+       if (stat(RANDOM_STAMPFILE, &st) == 0) 
     39+               return 1; 
     40+ 
     41        /* 
     42         * Make sure that there is reasonable entropy available before allowing 
     43         * some key derivation operations to proceed. 
     44@@ -258,9 +266,15 @@ int random_pool_ready(void) 
     45  
     46 void random_mark_pool_ready(void) 
     47 { 
     48+       int fd; 
     49+ 
     50        own_pool_ready++; 
    2251        wpa_printf(MSG_DEBUG, "random: Mark internal entropy pool to be " 
    2352                   "ready (count=%u/%u)", own_pool_ready, MIN_READY_MARK); 
     53+ 
     54+       fd = open(RANDOM_STAMPFILE, O_CREAT | O_WRONLY | O_EXCL | O_NOFOLLOW, 0600); 
     55+       if (fd >= 0) 
     56+               close(fd); 
     57 } 
     58  
     59  
     60@@ -335,3 +349,22 @@ void random_deinit(void) 
     61        random_close_fd(); 
     62 #endif /* __linux__ */ 
    2463 } 
    2564+ 
     
    102141--- a/src/crypto/random.h 
    103142+++ b/src/crypto/random.h 
    104 @@ -16,15 +16,14 @@ 
    105  #define RANDOM_H 
    106   
     143@@ -18,17 +18,16 @@ 
    107144 #ifdef CONFIG_NO_RANDOM_POOL 
     145 #define random_init() do { } while (0) 
     146 #define random_deinit() do { } while (0) 
    108147-#define random_add_randomness(b, l) do { } while (0) 
    109148 #define random_get_bytes(b, l) os_get_random((b), (l)) 
     
    111150 #define random_mark_pool_ready() do { } while (0) 
    112151 #else /* CONFIG_NO_RANDOM_POOL */ 
     152 void random_init(void); 
     153 void random_deinit(void); 
    113154-void random_add_randomness(const void *buf, size_t len); 
    114155 int random_get_bytes(void *buf, size_t len); 
Note: See TracChangeset for help on using the changeset viewer.