OLD | NEW |
(Empty) | |
| 1 Index: nss/lib/freebl/unix_rand.c |
| 2 =================================================================== |
| 3 --- nss/lib/freebl/unix_rand.c (revision 204056) |
| 4 +++ nss/lib/freebl/unix_rand.c (working copy) |
| 5 @@ -918,6 +918,16 @@ |
| 6 || defined(HPUX) |
| 7 if (bytes) |
| 8 return; |
| 9 + |
| 10 + /* |
| 11 + * Modified to abort the process if it failed to read from /dev/urandom. |
| 12 + * |
| 13 + * See crbug.com/244661 for details. |
| 14 + */ |
| 15 + fprintf(stderr, "[ERROR:%s(%d)] NSS failed to read from /dev/urandom. " |
| 16 + "Abort process.\n", __FILE__, __LINE__); |
| 17 + fflush(stderr); |
| 18 + abort(); |
| 19 #endif |
| 20 |
| 21 #ifdef SOLARIS |
| 22 @@ -1132,7 +1142,15 @@ |
| 23 |
| 24 file = fopen("/dev/urandom", "r"); |
| 25 if (file == NULL) { |
| 26 - return rng_systemFromNoise(dest, maxLen); |
| 27 + /* |
| 28 + * Modified to abort the process if it failed to read from /dev/urandom. |
| 29 + * |
| 30 + * See crbug.com/244661 for details. |
| 31 + */ |
| 32 + fprintf(stderr, "[ERROR:%s(%d)] NSS failed to read from /dev/urandom. " |
| 33 + "Abort process.\n", __FILE__, __LINE__); |
| 34 + fflush(stderr); |
| 35 + abort(); |
| 36 } |
| 37 while (maxLen > fileBytes) { |
| 38 bytes = maxLen - fileBytes; |
OLD | NEW |