aboutsummaryrefslogtreecommitdiff
path: root/lib/libc/gen/arc4random.3
Commit message (Collapse)AuthorAgeFilesLines
* arc4random(3): fix .Xr issuesEnji Cooper2020-12-111-2/+2
| | | | | | | | | | | | | - pthreads(3) should actually be pthread(3). - getentropy(2) should actually be getentropy(3). This makes the manpage `make manlint` clean. MFC after: 1 week Sponsored by: DellEMC Isilon Notes: svn path=/head/; revision=368532
* Sync with OpenBSD:Xin LI2020-04-131-3/+5
| | | | | | | | | | | | | | | | | | arc4random.c: In the incredibly unbelievable circumstance where _rs_init() fails to allocate pages, don't call abort() because of corefile data leakage concerns, but simply _exit(). The reasoning is _rs_init() will only fail if someone finds a way to apply specific pressure against this failure point, for the purpose of leaking information into a core which they can read. We don't need a corefile in this instance to debug that. So take this "lever" away from whoever in the future wants to do that. arc4random.3: reference random(4) arc4random_uniform.c: include stdint.h over sys/types.h Notes: svn path=/head/; revision=359849
* arc4random(3): Expand the SEE ALSO sectionSergio Carlavilla Delgado2020-04-101-1/+8
| | | | | | | | | | Submitted by: Gordon Bergling Approved by: brueffer@ Obtained from: NetBSD Differential Revision: https://reviews.freebsd.org/D23716 Notes: svn path=/head/; revision=359771
* arc4random: Adjust example code to use uniform() APIConrad Meyer2019-03-211-2/+2
| | | | | | | | PR: 236678 Reported by: Andras Farkas <deepbluemistake AT gmail.com> Notes: svn path=/head/; revision=345380
* Update userland arc4random() with OpenBSD's Chacha20 based arc4random().Xin LI2018-08-191-47/+63
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ObsoleteFiles.inc: Remove manual pages for arc4random_addrandom(3) and arc4random_stir(3). contrib/ntp/lib/isc/random.c: contrib/ntp/sntp/libevent/evutil_rand.c: Eliminate in-tree usage of arc4random_addrandom(). crypto/heimdal/lib/roken/rand.c: crypto/openssh/config.h: Eliminate in-tree usage of arc4random_stir(). include/stdlib.h: Remove arc4random_stir() and arc4random_addrandom() prototypes, provide temporary shims for transistion period. lib/libc/gen/Makefile.inc: Hook arc4random-compat.c to build, add hint for Chacha20 source for kernel, and remove arc4random_addrandom(3) and arc4random_stir(3) links. lib/libc/gen/arc4random.c: Adopt OpenBSD arc4random.c,v 1.54 with bare minimum changes, use the sys/crypto/chacha20 implementation of keystream. lib/libc/gen/Symbol.map: Remove arc4random_stir and arc4random_addrandom interfaces. lib/libc/gen/arc4random.h: Adopt OpenBSD arc4random.h,v 1.4 but provide _ARC4_LOCK of our own. lib/libc/gen/arc4random.3: Adopt OpenBSD arc4random.3,v 1.35 but keep FreeBSD r114444 and r118247. lib/libc/gen/arc4random-compat.c: Compatibility shims for arc4random_stir and arc4random_addrandom functions to preserve ABI. Log once when called but do nothing otherwise. lib/libc/gen/getentropy.c: lib/libc/include/libc_private.h: Fold __arc4_sysctl into getentropy.c (renamed to arnd_sysctl). Remove from libc_private.h as a result. sys/crypto/chacha20/chacha.c: sys/crypto/chacha20/chacha.h: Make it possible to use the kernel implementation in libc. PR: 182610 Reviewed by: cem, markm Obtained from: OpenBSD Relnotes: yes Differential Revision: https://reviews.freebsd.org/D16760 Notes: svn path=/head/; revision=338059
* Globally replace u_int*_t from (non-contributed) man pages.Ed Schouten2012-02-121-3/+3
| | | | | | | | | | | | | | The reasoning behind this, is that if we are consistent in our documentation about the uint*_t stuff, people will be less tempted to write new code that uses the non-standard types. I am not going to bump the man page dates, as these changes can be considered style nits. The meaning of the man pages is unaffected. MFC after: 1 month Notes: svn path=/head/; revision=231564
* Add arc4random_uniform() function (to avoid "modulo bias")Andrey A. Chernov2008-07-221-0/+11
| | | | | | | Obtained from: OpenBSD Notes: svn path=/head/; revision=180688
* Implement arc4random_buf() functionAndrey A. Chernov2008-07-211-3/+12
| | | | | | | Obtained from: OpenBSD Notes: svn path=/head/; revision=180657
* The upper end of the range of arc4random(3) is 2**32-1, not 2**31-1.David Schultz2003-07-311-2/+4
| | | | Notes: svn path=/head/; revision=118247
* Assorted mdoc(7) fixes.Ruslan Ermilov2003-05-221-2/+3
| | | | | | | Approved by: re (blanket) Notes: svn path=/head/; revision=115225
* Use the .Dl macro.Tom Rhodes2003-05-011-1/+1
| | | | | | | Discussed with: mdoc(7) officer ru Notes: svn path=/head/; revision=114454
* State the fact that the range is twice the traditional RAND_MAX.Tom Rhodes2003-05-011-1/+16
| | | | | | | | | | Add an EXAMPLES section. PR: 48493 Submitted by: Paul Herman <pherman@frenchfries.net> (original version) Notes: svn path=/head/; revision=114444
* mdoc(7) police: Use the new .In macro for #include statements.Ruslan Ermilov2001-10-011-1/+1
| | | | Notes: svn path=/head/; revision=84306
* mdoc(7) police: normalize .Nd.Ruslan Ermilov2001-04-181-1/+1
| | | | Notes: svn path=/head/; revision=75670
* Whitespace only change: trim trailing whitespace.Jeroen Ruigrok van der Werven2000-10-301-7/+7
| | | | Notes: svn path=/head/; revision=67967
* Introduce ".Lb" macro to libc manpages.Alexey Zelkin2000-04-211-0/+2
| | | | | | | More libraries manpages updates following. Notes: svn path=/head/; revision=59460
* Remove single-space hard sentence breaks. These degrade the qualitySheldon Hearn2000-03-021-3/+6
| | | | | | | | of the typeset output, tend to make diffs harder to read and provide bad examples for new-comers to mdoc. Notes: svn path=/head/; revision=57686
* mdoc(7)'fyAlexey Zelkin1999-10-301-2/+2
| | | | Notes: svn path=/head/; revision=52671
* $Id$ -> $FreeBSD$Peter Wemm1999-08-281-1/+1
| | | | Notes: svn path=/head/; revision=50476
* Add $Id$, to make it simpler for members of the translation teams toNik Clayton1999-07-121-0/+1
| | | | | | | | | | | | | | | | | | | | track. The $Id$ line is normally at the bottom of the main comment block in the man page, separated from the rest of the manpage by an empty comment, like so; .\" $Id$ .\" If the immediately preceding comment is a @(#) format ID marker than the the $Id$ will line up underneath it with no intervening blank lines. Otherwise, an additional blank line is inserted. Approved by: bde Notes: svn path=/head/; revision=48794
* More typos.Kris Kennaway1999-05-091-2/+2
| | | | Notes: svn path=/head/; revision=46800
* Typo.Kris Kennaway1999-05-091-1/+1
| | | | | | | Obtained from: OpenBSD Notes: svn path=/head/; revision=46798
* Change u_char which require special include to unsigned charAndrey A. Chernov1997-06-141-1/+1
| | | | Notes: svn path=/head/; revision=26629
* Add arc4random() functions from OpenBSD. They are almost same as ourAndrey A. Chernov1997-06-141-0/+83
srandomdev(), but can be used inside libraries. random() can't be used inside libraries because it breaks its possible predictable sequence. arc4random() is true random as designed, so its usage is library-safe. Obtained from: OpenBSD Notes: svn path=/head/; revision=26628