Merge branch 'maint-0.3.2' into release-0.3.2
This commit is contained in:
commit
92d45086f5
|
@ -0,0 +1,3 @@
|
||||||
|
o Minor features (logging):
|
||||||
|
- Provide better warnings when the getrandom() syscall fails.
|
||||||
|
Closes ticket 24500.
|
|
@ -2875,8 +2875,17 @@ crypto_strongest_rand_syscall(uint8_t *out, size_t out_len)
|
||||||
tor_assert(errno != EAGAIN);
|
tor_assert(errno != EAGAIN);
|
||||||
tor_assert(errno != EINTR);
|
tor_assert(errno != EINTR);
|
||||||
|
|
||||||
/* Probably ENOSYS. */
|
/* Useful log message for errno. */
|
||||||
log_warn(LD_CRYPTO, "Can't get entropy from getrandom().");
|
if (errno == ENOSYS) {
|
||||||
|
log_warn(LD_CRYPTO, "Can't get entropy from getrandom(). "
|
||||||
|
" You are running a version of Tor built to support"
|
||||||
|
" getrandom(), but the kernel doesn't implement this"
|
||||||
|
" implement this function--probably because it is too old?");
|
||||||
|
} else {
|
||||||
|
log_warn(LD_CRYPTO, "Can't get entropy from getrandom(): %s.",
|
||||||
|
strerror(errno));
|
||||||
|
}
|
||||||
|
|
||||||
getrandom_works = 0; /* Don't bother trying again. */
|
getrandom_works = 0; /* Don't bother trying again. */
|
||||||
return -1;
|
return -1;
|
||||||
/* LCOV_EXCL_STOP */
|
/* LCOV_EXCL_STOP */
|
||||||
|
|
Loading…
Reference in New Issue