cipher: Fix possible NULL deref in call to prime generator.
authorWerner Koch <wk@gnupg.org>
Thu, 21 Aug 2014 09:39:17 +0000 (11:39 +0200)
committerWerner Koch <wk@gnupg.org>
Thu, 21 Aug 2014 10:22:37 +0000 (12:22 +0200)
commit18056ace7f466cb8c1eaf08e5dc0400516d83b4c
treec9da7e759ba962071b2a961082d2c5a32326df58
parent34bb55ee36df3aca3ebca88f8b61c786cd0c0701
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/dsa.c
cipher/elgamal.c
cipher/primegen.c
src/g10lib.h