From 94b652ecb006c29fa2ffb1badc9f02b758581737 Mon Sep 17 00:00:00 2001 From: Werner Koch Date: Wed, 9 Oct 2013 15:05:26 +0200 Subject: pubkey: Move sexp parsing for gcry_pk_verify to the modules. * cipher/rsa.c (rsa_verify): Revamp. * cipher/dsa.c (dsa_verify): Revamp. * cipher/elgamal.c (elg_verify): Revamp. * cipher/ecc.c (ecc_verify): Revamp. * cipher/pubkey.c (sexp_to_sig): Remove. (pss_verify_cmp): Move to pubkey-util.c (sexp_data_to_mpi): Ditto. (init_encoding_ctx): Ditto. (gcry_pk_verify): Simplify. * cipher/pubkey-util.c (_gcry_pk_util_init_encoding_ctx): Add. Take from pubkey.c (get_hash_algo): Ditto. (_gcry_pk_util_data_to_mpi): Ditto. (pss_verify_cmp): Ditto. (_gcry_pk_util_extract_mpis): New. (_gcry_pk_util_preparse_sigval): New. (_gcry_pk_util_free_encoding_ctx): New. * cipher/ecc-curves.c (_gcry_ecc_fill_in_curve): Make curve init optional. * src/g10lib.h (GCC_ATTR_SENTINEL): New. * tests/basic.c (check_pubkey_sign): Print the algo name. (main): Add option --pubkey. Signed-off-by: Werner Koch --- src/g10lib.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/g10lib.h') diff --git a/src/g10lib.h b/src/g10lib.h index 43281ad3..0ada30a4 100644 --- a/src/g10lib.h +++ b/src/g10lib.h @@ -66,7 +66,6 @@ #define GCC_ATTR_FORMAT_ARG(a) #endif - /* I am not sure since when the unused attribute is really supported. In any case it it only needed for gcc versions which print a warning. Thus let us require gcc >= 3.5. */ @@ -76,6 +75,12 @@ #define GCC_ATTR_UNUSED #endif +#if __GNUC__ >= 4 +# define GCC_ATTR_SENTINEL(a) __attribute__ ((sentinel(a))) +#else +# define GCC_ATTR_SENTINEL(a) +#endif + /* Gettext macros. */ -- cgit v1.2.1