aboutsummaryrefslogtreecommitdiffstats
path: root/src/librandom
Commit message (Collapse)AuthorAgeFilesLines
* Save/restore errno in all safe wrappersLaurent Bercot2026-01-011-0/+3
|
* Actually add autosurf_name; fix cspawn leak in error pathLaurent Bercot2023-12-181-0/+9
| | | | Signed-off-by: Laurent Bercot <ska@appnovation.com>
* Add autosurf_nameLaurent Bercot2023-12-151-1/+0
| | | | Signed-off-by: Laurent Bercot <ska@appnovation.com>
* Prepare for 2.13.0.0, revamp strerrLaurent Bercot2022-11-291-1/+1
| | | | Signed-off-by: Laurent Bercot <ska@appnovation.com>
* Don't use arc4random() for early random on LinuxLaurent Bercot2022-07-231-1/+1
| | | | Signed-off-by: Laurent Bercot <ska@appnovation.com>
* Fix allread errno managementLaurent Bercot2022-07-181-0/+4
| | | | Signed-off-by: Laurent Bercot <ska@appnovation.com>
* Add runtime fallback for GRND_INSECURELaurent Bercot2022-06-231-3/+13
| | | | | | | | | | | | | | | | | | | The grndinsecure sysdep is only build-time tested and returns yes if the kernel headers declare GRND_INSECURE. That is a problem because the kernel headers are most likely provided by the toolchain and do not reflect the exact capabilities of the run-time kernel. If the run-time kernel doesn't support that option, getrandom() fails. That made random_buf_early() busyloop. To avoid that, we now fallback to random_devurandom() as an implementation of random_buf_early() if getrandom() fails when used with GRND_INSECURE. This adds a slight amount of overhead to random_buf_early(), so it's probably better to just disable the sysdep at build time if you're making binaries that will run on older kernels. Signed-off-by: Laurent Bercot <ska@appnovation.com>
* Export random_devurandom, fix APIsLaurent Bercot2022-06-083-12/+2
| | | | Signed-off-by: Laurent Bercot <ska@appnovation.com>
* Prepare for 2.12.0.0. librandom revamp.Laurent Bercot2022-04-0918-306/+216
| | | | Signed-off-by: Laurent Bercot <ska@appnovation.com>
* Don't write to /dev/urandom. (It's useless or even harmful.)Laurent Bercot2022-03-272-7/+1
|
* Don't return voidLaurent Bercot2021-10-301-1/+1
| | | | | | | Error by: Studio 12.6 Sun C 5.15 SunOS_i386 2017/05/30 Reported by schmonz Signed-off-by: Laurent Bercot <ska@appnovation.com>
* Huge incompatible changes.Laurent Bercot2021-07-283-7/+9
| | | | | | | | | | | | - Obsolete skalibs/environ.h and skalibs/getpeereid.h removed. - rc4 and md5 removed. - All *_t types renamed to avoid treading on POSIX namespace. - subgetopt() renamed to lgetopt(). - signal functions reworked; skasigaction removed; sig_stack removed - Various functions removed: skaoffsetof(), selfpipe_untrap() - New posixplz function: munmap_void. Signed-off-by: Laurent Bercot <ska@appnovation.com>
* Don't touch /dev/urandom when getrandom() existsLaurent Bercot2021-01-151-9/+8
|
* Fix iobufferk_init on recent Linux; remove last superfluous coeLaurent Bercot2020-12-041-13/+5
|
* sysdeps redesign: first part: minimize clr testsLaurent Bercot2019-09-201-9/+2
| | | | | | | | Remaining clr: emptyregex: can be safely guessed to no nullispointer: can't be safely guessed, but do we need the test? devurandom: can't be safely guessed malloc0: can more or less be safely guessed to no
* Really add mkfootemp and autosurf, I guess ?Laurent Bercot2018-12-083-0/+34
|
* Add mk?temp and autosurfLaurent Bercot2018-12-072-2/+3
|
* Comment fix (writing to /dev/urandom doesn't speed it up)Laurent Bercot2017-09-271-2/+2
|
* Add egidingroups sysdeps, change fd_close() to void and saving errno, ↵Laurent Bercot2017-07-161-2/+0
| | | | propagate changes
* More superflous headers cleanup and tiny fixesLaurent Bercot2017-03-135-9/+1
|
* Types change: big pass on libstddjb and libunixonacidLaurent Bercot2017-02-216-14/+14
| | | | libdatastruct still missing, library still not functional
* add arc4random_addrandom sysdep; next batch of types changes.Laurent Bercot2017-02-151-0/+2
| | | | | The library isn't supposed to be functional yet: there are still a lot of type mismatches.
* Types fix: librandom, libstdcryptoLaurent Bercot2017-01-217-22/+27
|
* Also fix actual random_string compilation with musl and getrandom()...Laurent Bercot2016-12-051-0/+1
|
* random_init: do not fail if we can't write to /dev/urandomLaurent Bercot2016-11-031-4/+3
|
* This one escaped the previous commit: random_init changesLaurent Bercot2016-10-241-10/+14
|
* Better random_uint32 uniformity algorithmLaurent Bercot2016-10-191-30/+9
|
* Fix headers in random_init.c; add a workaround for (pathological) ↵Laurent Bercot2016-10-161-0/+6
| | | | getrandom() without /dev/urandom
* More typo fixingLaurent Bercot2016-10-141-1/+1
|
* Add a cast to arc4random_addrandom invocation to make clang happyLaurent Bercot2016-10-141-1/+1
|
* Include skalibs/nonposix.h so BSDs can find arc4randomLaurent Bercot2016-10-143-0/+4
|
* Clean up and modernize librandom.Laurent Bercot2016-10-1447-759/+283
| | | | | | | | | | | | | | | | | | | | | | Correct random number generation has historically been suprisingly painful to achieve. There was no standard, every system behaved in a subtly different way, and there were a few userland initiatives to get decent randomness, all incompatible of course. The situation is a bit better now, we're heading towards some standardization. The arc4random() series of functions is a good API, and available on a lot of systems - unfortunately not Linux, but on Linux the new getrandom() makes using /dev/random obsolete. So I removed the old crap in librandom, dropped EGD support, dropped dynamic backend selection, made a single API series (random_* instead of goodrandom_* and badrandom_*), added an arc4random backend and a getrandom backend, and defaulted to /dev/urandom backed up by SURF in the worst case. This should be much smaller and logical. However, it's a major API break, so the skarnet.org stack will be changed to adapt.
* - Add siovec_truncLaurent Bercot2015-02-051-1/+2
| | | | | | | | - Add openwritevnclose - replace buffer_read/write with fd_readsv/writesv - add localtmn_from_tain_g - refactor cdb_make - rewrite buffer_getvall and buffer_putvall, with a bugfix
* Lots of cosmetic fixes.Laurent Bercot2014-12-2015-16/+17
| | | | sha256 documented.
* initial commit with rc for skalibs-2.0.0.0Laurent Bercot2014-09-1843-0/+900