From 3b30e9840d4b351c4de73b126e561154cb7df4cc Mon Sep 17 00:00:00 2001 From: Werner Koch Date: Thu, 12 Dec 2013 15:13:09 +0100 Subject: Remove macro hacks for internal vs. external functions. Part 2 and last. * src/visibility.h: Remove remaining define/undef hacks for symbol visibility. Add macros to detect the use of the public functions. Change all affected functions by replacing them by the x-macros. * src/g10lib.h: Add internal prototypes. (xtrymalloc, xtrycalloc, xtrymalloc_secure, xtrycalloc_secure) (xtryrealloc, xtrystrdup, xmalloc, xcalloc, xmalloc_secure) (xcalloc_secure, xrealloc, xstrdup, xfree): New macros. -- The use of xmalloc/xtrymalloc/xfree is a more common pattern than the gcry_free etc. functions. Those functions behave like those defined by C and thus for better readability we use these macros and not the underscore prefixed functions. Signed-off-by: Werner Koch --- cipher/rsa.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'cipher/rsa.c') diff --git a/cipher/rsa.c b/cipher/rsa.c index a40edaa6..a97dcfd0 100644 --- a/cipher/rsa.c +++ b/cipher/rsa.c @@ -926,7 +926,7 @@ rsa_encrypt (gcry_sexp_t *r_ciph, gcry_sexp_t s_data, gcry_sexp_t keyparms) if (!rc) { rc = sexp_build (r_ciph, NULL, "(enc-val(rsa(a%b)))", (int)emlen, em); - gcry_free (em); + xfree (em); } } else @@ -1076,7 +1076,7 @@ rsa_decrypt (gcry_sexp_t *r_plain, gcry_sexp_t s_data, gcry_sexp_t keyparms) } leave: - gcry_free (unpad); + xfree (unpad); _gcry_mpi_release (plain); _gcry_mpi_release (sk.n); _gcry_mpi_release (sk.e); @@ -1155,7 +1155,7 @@ rsa_sign (gcry_sexp_t *r_sig, gcry_sexp_t s_data, gcry_sexp_t keyparms) if (!rc) { rc = sexp_build (r_sig, NULL, "(sig-val(rsa(s%b)))", (int)emlen, em); - gcry_free (em); + xfree (em); } } else -- cgit v1.2.1