cipher: Fix possible NULL deref in call to prime generator.

* cipher/primegen.c (_gcry_generate_elg_prime): Change to return an
error code.
* cipher/dsa.c (generate): Take care of new return code.
* cipher/elgamal.c (generate): Change to return an error code.  Take
care of _gcry_generate_elg_prime return code.
(generate_using_x): Take care of _gcry_generate_elg_prime return code.
(elg_generate): Propagate return code from generate.
--

GnuPG-bug-id: 1699, 1700
Reported-by: S.K. Gupta

Note that the NULL deref may have only happened on malloc failure.
cipher: Fix a segv in case of calling with wrong parameters.

* cipher/md.c (_gcry_md_info): Fix arg testing.
--

GnuPG-bug-id: 1697
sexp: Check args of gcry_sexp_build.

* src/sexp.c (do_vsexp_sscan): Return error for invalid args.
--

This helps to avoid usage errors by passing NULL for the return
variable and the format string.
mpi: Re-indent longlong.h.

--
Indenting the cpp statements should make longlong.h better readable.
Add DCO entries for Andrei Scherer and Stefan Mueller.

--
asm: Allow building x86 and amd64 using old compilers.

* src/hwf-x86.c (get_xgetbv): Build only if AVX support is enabled.
--

Old as(1) versions do not support the xgetvb instruction.  Thus build
this function only if asm support has been requested.

GnuPG-bug-id: 1708
Add new Poly1305 MAC test vectors

* tests/basic.c (check_mac): Add new test vectors for Poly1305 MAC.
--

Patch adds new test vectors for Poly1305 MAC from Internet Draft
draft-irtf-cfrg-chacha20-poly1305-01.

Signed-off-by: Jussi Kivilinna <jussi.kivilinna@iki.fi>
Add a constant for a forthcoming new RNG.

* src/gcrypt.h.in (GCRYCTL_DRBG_REINIT): New constant.
mac: Fix gcry_mac_close to allow for a NULL handle.

* cipher/mac.c (_gcry_mac_close): Check for NULL.
--

We always allow this for easier cleanup.  actually the docs already
tell that this is allowed.
build: Support SYSROOT based config script finding.

* src/libgcrypt.m4: Add support for SYSROOT and set
gpg_config_script_warn.  Use AC_PATH_PROG instead of AC_PATH_TOOL
because the config script is not expected to be installed with a
prefix for its name
* configure.ac: Print a library mismatch warning.
* m4/gpg-error.m4: Update from git master.
--

Also fixed the false copyright notice in libgcrypt.m4.
build: Document SYSROOT.

* configure.ac: Mark SYSROOT as arg var.