gpg: Stop early when trying to create a primary Elgamal key.
* g10/misc.c (openpgp_pk_test_algo2): Add extra check.
The problem is that --key-gen --batch with a parameter file didn't
detect that Elgamal is not capable of signing and so an error was only
triggered at the time the self-signature was created. See the code
comment for details.
(cherry picked from commit f97dc55ff1b041071bc3cbe98aa761bf77bb7ac8)
- GnuPG-bug-id: T4329
- Signed-off-by: Werner Koch <wk@gnupg.org>