mpi: Extend the internal mpi_get_buffer.

* mpi/mpicoder.c (do_get_buffer): Add arg EXTRAALLOC.
(_gcry_mpi_get_buffer_extra): New.
--
(cherry picked from commit 0e10902ad7584277ac966367efc712b183784532)
ecc: Support the non-standard 0x40 compression flag for EdDSA.

* cipher/ecc.c (ecc_generate): Check the "comp" flag for EdDSA.
* cipher/ecc-eddsa.c (eddsa_encode_x_y): Add arg WITH_PREFIX.
(_gcry_ecc_eddsa_encodepoint): Ditto.
(_gcry_ecc_eddsa_ensure_compact): Handle the 0x40 compression prefix.
(_gcry_ecc_eddsa_decodepoint): Ditto.
* tests/keygrip.c: Check an compresssed with prefix Ed25519 key.
* tests/t-ed25519.inp: Ditto.
--
(cherry picked from commit 4556f9b19c024f16bdf542da7173395c0741b91d)
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.
build: Fix typo in help string

* configure.ac: Fix.
--
GnuPG-bug-id: 1631
Release 1.6.2

* configure.ac: Set LT version to C20/A0/R2.
Post release updates.

--
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
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.