| 5461 | } |
| 5462 | |
| 5463 | AP_DECLARE(void) ap_random_insecure_bytes(void *buf, apr_size_t size) |
| 5464 | { |
| 5465 | #if APR_HAS_THREADS |
| 5466 | if (rng_mutex) |
| 5467 | apr_thread_mutex_lock(rng_mutex); |
| 5468 | #endif |
| 5469 | /* apr_random_insecure_bytes can only fail with APR_ENOTENOUGHENTROPY, |
| 5470 | * and we have ruled that out during initialization. Therefore we don't |
| 5471 | * need to check the return code. |
| 5472 | */ |
| 5473 | apr_random_insecure_bytes(rng, buf, size); |
| 5474 | #if APR_HAS_THREADS |
| 5475 | if (rng_mutex) |
| 5476 | apr_thread_mutex_unlock(rng_mutex); |
| 5477 | #endif |
| 5478 | } |
| 5479 | |
| 5480 | /* |
| 5481 | * Finding a random number in a range. |
no outgoing calls
no test coverage detected