common, g10: Fix enumeration types.
authorNIIBE Yutaka <gniibe@fsij.org>
Thu, 13 Apr 2017 03:54:52 +0000 (12:54 +0900)
committerNIIBE Yutaka <gniibe@fsij.org>
Thu, 13 Apr 2017 03:54:52 +0000 (12:54 +0900)
commit74258278efacd7069e8c1df8ff6fc3f4675d713e
tree9d524e133a7715f4836e5e6351455a42b897e20c
parent5af104b541ed430a54eb0163a1d29e1d043f9377
common, g10: Fix enumeration types.

* common/openpgpdefs.h (CIPHER_ALGO_PRIVATE10, PUBKEY_ALGO_PRIVATE10)
(DIGEST_ALGO_PRIVATE10, COMPRESS_ALGO_PRIVATE10): New.
* g10/misc.c (map_pk_gcry_to_openpgp): Add type conversion.
(map_cipher_openpgp_to_gcry, openpgp_cipher_algo_name)
(openpgp_pk_test_algo2, map_md_openpgp_to_gcry)
(pubkey_get_npkey): Add default handling.

--

Compilers may emit code assuming the maximum value of enum type.
According to OpenPGP specification, there are cases for private uses.

Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
common/openpgpdefs.h
g10/misc.c