Nim/lib/std
Timothy Alexander dde556665a
Fix #19052; [backport:1.6.0] (#19053)
* Fix #19052; [backport:1.6.0]

Adds a compile flag to avoid a getrandom syscall, fixing #19052.

This is neccesary when the getrandom syscall is missing, as noted in #19052, particularly in kernel versions < 3.17 when getrandom was introduced. Specifically relevant is this is missing from kernel 3.10, which is the supported kernel throughout RHEL 7 and CentOS 7, which is widely used at many organizations. Without this, versions of nim that include sysrand (i.e. versions >= 1.6.0) will not compile without modification, however with this change a compile flag may be used to fall back using /dev/urandom as done with any unknown Posix OS (preferred here as a fallback since it already supplies a cryptographically secure PRNG and existing code deals with entropy pool init, etc).

The change is placed behind a compile flag, as discussed in github ticket #19052 (summed up here):
* First, I can't seem to catch that a importc such as SYS_getrandom is declared without using it (the declared proc returns true, but compiler throws an undeclared identifier flag when referencing it).
* Second, it seemed preferable to be behaviorally explicit vs implicit when considering this is intended to be a cryptographically secure PRNG.
* Third, if I intend to compile on a kernel >= 3.17 while running the binary on at least one system < 3.17, I'll want to be able to target this without relying on a compile time determination if the getrandom syscall is available.

* Documenting compile flag for -d:nimNoGetRandom and adding changelog entry
Related to #19052 and comments in PR #19053. Also created a new changelog file since none currently exists.

Co-authored-by: Timothy Alexander <talexander@midwestlabs.com>
2021-10-26 20:32:52 +02:00
..
private fix a potential bug (#18900) 2021-10-14 09:23:01 +02:00
compilesettings.nim correct licence header (#18935) 2021-10-01 13:57:06 +02:00
decls.nim std/byaddr => std/decls (#13847) 2020-04-03 09:03:13 +02:00
editdistance.nim use single backtick (#17141) 2021-02-21 19:53:28 -08:00
effecttraits.nim fixes #18371 (#18617) 2021-07-30 12:05:14 +02:00
enumerate.nim move tests to testament (#16101) 2020-11-24 19:06:41 +01:00
enumutils.nim Allow nnkAccQuoted in genEnumCaseStmt (#18606) 2021-07-29 07:47:34 +02:00
exitprocs.nim deinitializing locks at program exit (#19043) 2021-10-25 10:13:30 +02:00
genasts.nim new genAst as replacement for quote do (#17426) 2021-04-02 13:11:03 +02:00
importutils.nim make privateAccess work with generic types and generic instantiations; fix a SIGSEGV (#18260) 2021-06-19 11:24:46 -07:00
isolation.nim Rename = to =copy in stdlib (#17781) 2021-04-19 13:16:10 +02:00
jsbigints.nim add number literal jsbigints.big (#17707) 2021-04-13 09:33:28 +02:00
jsfetch.nim Implement RFC-391 (#18585) 2021-08-22 12:32:55 -07:00
jsformdata.nim Use .. warning:: (#17320) 2021-03-10 10:39:23 -08:00
jsheaders.nim Use .. warning:: (#17320) 2021-03-10 10:39:23 -08:00
jsonutils.nim rename nimLegacyJsonutilsHoleyEnum [backport] (#18938) 2021-10-01 20:26:29 +02:00
logic.nim use single backtick (#17141) 2021-02-21 19:53:28 -08:00
monotimes.nim clean unused imports on runnableExamples (#18551) 2021-07-21 13:46:17 +02:00
packedsets.nim various small documentation improvements (#18602) 2021-07-28 14:31:13 +02:00
setutils.nim correct licence header (#18935) 2021-10-01 13:57:06 +02:00
sha1.nim correct licence header (#18935) 2021-10-01 13:57:06 +02:00
socketstreams.nim Implements streams for sockets (#15729) 2021-01-07 16:09:57 +01:00
stackframes.nim init checks and 'out' parameters (#14521) 2020-06-23 10:53:57 +02:00
strbasics.nim correct licence header (#18935) 2021-10-01 13:57:06 +02:00
sums.nim use single backtick (#17141) 2021-02-21 19:53:28 -08:00
sysrand.nim Fix #19052; [backport:1.6.0] (#19053) 2021-10-26 20:32:52 +02:00
tasks.nim [std/tasks] more gcsafe stuffs [backport] (#18926) 2021-09-30 07:46:30 +02:00
tempfiles.nim [std/tempfiles] docs improvement (#18936) 2021-10-01 20:14:10 +02:00
time_t.nim use single backtick (#17141) 2021-02-21 19:53:28 -08:00
varints.nim Make unused code into actual test, replace echo with doassert (#13952) 2020-04-11 22:16:26 +02:00
vmutils.nim enable VM tracing in user code via {.define(nimVmTrace).} (#18244) 2021-06-24 11:55:31 +02:00
with.nim Small doc improvements for std/with (#17556) 2021-03-29 12:44:31 +02:00
wordwrap.nim move rest of tests to testament (#16140) 2020-11-27 20:47:49 +01:00
wrapnils.nim major improvements to std/wrapnils: optimal codegen, case objects, lvalue semantics (#18435) 2021-07-07 06:04:36 +02:00