Page MenuHomePhabricator

improvements to random seed in src/tests.c
ClosedPublic

Authored by deadalnix on Jan 17 2020, 03:14.

Details

Summary
  • tests: add warning message when /dev/urandom fails

in case this code should ever be used as an example, a warning is a nice
way of helping ensure insecure keys are not generated

  • fix bug in fread() failure check

the two middle arguments to fread() are easily confused, and cause the
checking of return value to fail incorrectly (and possibly succeed
incorrectly.)

  • Fixup for C90 mixed declarations.

Reported-by: Jonas Nick <jonasd.nick@gmail.com>

This is a backport of secp256k1's PR516

Test Plan
make check

Diff Detail

Repository
rABC Bitcoin ABC
Lint
Lint Not Applicable
Unit
Tests Not Applicable