From: Nick Mathewson Date: Wed, 25 Nov 2015 17:28:20 +0000 (-0500) Subject: Fix documentation for crypto_rand* X-Git-Tag: tor-0.2.8.1-alpha~209^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1cfa2bc859c0a7f27b49b80dc1be4be2acc91ee8;p=thirdparty%2Ftor.git Fix documentation for crypto_rand* --- diff --git a/src/common/crypto.c b/src/common/crypto.c index 9e27ad30c4..9669493a83 100644 --- a/src/common/crypto.c +++ b/src/common/crypto.c @@ -2364,8 +2364,11 @@ crypto_seed_rng(void) return -1; } -/** Write n bytes of strong random data to to. Return 0 on - * success, -1 on failure, with support for mocking for unit tests. +/** Write n bytes of strong random data to to. Supports mocking + * for unit tests. + * + * This function is not allowed to fail; if it would fail to generate strong + * entropy, it must terminate the process instead. */ MOCK_IMPL(void, crypto_rand, (char *to, size_t n)) @@ -2373,8 +2376,11 @@ crypto_rand, (char *to, size_t n)) crypto_rand_unmocked(to, n); } -/** Write n bytes of strong random data to to. Return 0 on - * success, -1 on failure. Most callers will want crypto_rand instead. +/** Write n bytes of strong random data to to. Most callers + * will want crypto_rand instead. + * + * This function is not allowed to fail; if it would fail to generate strong + * entropy, it must terminate the process instead. */ void crypto_rand_unmocked(char *to, size_t n)