Use one of the following to provide random bytes:
- Windows CryptGenRandom
- Linux getrandom (syscall interface to urandom, without nasty corner
cases such as file descriptor exhaustion or re-linked /dev/urandom)
- std::device_random (C++ random device, which usually will be urandom)
This also equalizes util::getRandom and SimpleRandomizer (the former
will now use the latter) instead of having essentially two different
PRNG interfaces with potentially different quality.
Closes GH-320
The algorithms the `CryptProv` on Windows supports does not currently
include SHA-224, so there is a "dark spot" in this implementation. Also
on Win XP < SP3, most of the SHA-2 family is not actually supported.
All other implementation provide support for MD5, SHA-1 and all of the
SHA-2 family, hence drop the incomplete WinMessageDigest implementation
in favor of any other supported implementation (at least the internal
implementation is always available at compile-time).
Add and use usedCompilerAndPlatform(). This adds compiler information to
INFO logs and the --version output, and may be helpful when trying to
diagnose/reproduce user-reported problems.
Also make INFO logs include usedLibs() output.
Closes#235
Now mingw-w64 C++ compiler defines __USE_MINGW_ANSI_STDIO to 1, we
have to follow it as well. We hope that mingw version of stdio
function behaves like Linux ones. We have not tested them thoroughly
yet. pthread for windows defines its own HAVE_STRUCT_TIMESPEC macro.
To avoid warning, we rename our version of it as
HAVE_A2_STRUCT_TIMESPEC.
Since we use libtool, -static-libgcc and -static-libstdc++ are
stripped by libtool and not used. We just use -all-static libtool flag
for this purpose.
To create windows dll, it turns out that we need -no-undefined flag.
Now you can build bittorrent support without without external
libraries, meaning you can skip libnettle, libgmp, libgcrypt, GnuTLS and
OpenSSL on OSX (for now).
Reusing a bignum (well, unsigned very-long) implementation I had lying
around for years and just cleaned up a bit and brought to C++11 land.
It might not be the most performant implementation, but it shoud be fast
enough for our purposes and will go a long way of removing gcrypt,
nettle, gmp, openssl dependencies when using AppleTLS and WinTLS
(upcoming).
Since Android ndk r9, __set_errno is deprecated. It is now defined as
inline function in errno.h. The syscall assembly calls __set_errno,
but since libc.so does not export it, the link fails. To workaround
this, replace all occurrences of __set_errno with a2_set_errno and
define it as normal C function.
Supported since automake-1.11. There is no point in having the very
verbose compile stuff running about, which cannot even silenced properly
with `make -s` by default. Otherwise, `make V=1` or
`--disable-silent-rules` are your friends
AC_USE_SYSTEM_EXTENSIONS will cause AC_PROG_CC, which is overridden by
automake-1.14, which will then init (part) of automake, in particular
am_aux_dir expansion, which in turn relies on ac_aux-dir, which is not
initialized at this point, and thus: certain doom (or fun, depending on
your POV and mood :p)
Hence call AC_USE_SYSTEM_EXTENSIONS only after AM_INIT_AUTOMAKE. This,
of course, caused a lot of related macro shuffling.
Tested against automake-1.10 (OSX Lion/XCode version) and automake-1.14
(homebrew version)