diff options
author | Werner Koch <wk@gnupg.org> | 2013-12-12 15:13:09 +0100 |
---|---|---|
committer | Werner Koch <wk@gnupg.org> | 2013-12-12 15:28:06 +0100 |
commit | 3b30e9840d4b351c4de73b126e561154cb7df4cc (patch) | |
tree | ef3d2d1127165ef5866840d33ccde9d35a2dee33 /src | |
parent | cd548ba2dc777b8b27d8d33182ba733c20222120 (diff) | |
download | libgcrypt-3b30e9840d4b351c4de73b126e561154cb7df4cc.tar.gz |
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 <wk@gnupg.org>
Diffstat (limited to 'src')
-rw-r--r-- | src/context.c | 4 | ||||
-rw-r--r-- | src/fips.c | 2 | ||||
-rw-r--r-- | src/g10lib.h | 30 | ||||
-rw-r--r-- | src/gcrypt-int.h | 7 | ||||
-rw-r--r-- | src/global.c | 58 | ||||
-rw-r--r-- | src/misc.c | 6 | ||||
-rw-r--r-- | src/sexp.c | 60 | ||||
-rw-r--r-- | src/visibility.h | 91 |
8 files changed, 132 insertions, 126 deletions
diff --git a/src/context.c b/src/context.c index 8cd1a879..94e5be9e 100644 --- a/src/context.c +++ b/src/context.c @@ -67,7 +67,7 @@ _gcry_ctx_alloc (int type, size_t length, void (*deinit)(void*)) if (length < sizeof (PROPERLY_ALIGNED_TYPE)) length = sizeof (PROPERLY_ALIGNED_TYPE); - ctx = gcry_calloc (1, sizeof *ctx - sizeof (PROPERLY_ALIGNED_TYPE) + length); + ctx = xtrycalloc (1, sizeof *ctx - sizeof (PROPERLY_ALIGNED_TYPE) + length); if (!ctx) return NULL; memcpy (ctx->magic, CTX_MAGIC, CTX_MAGIC_LEN); @@ -133,5 +133,5 @@ _gcry_ctx_release (gcry_ctx_t ctx) } if (ctx->deinit) ctx->deinit (&ctx->u); - gcry_free (ctx); + xfree (ctx); } @@ -660,7 +660,7 @@ check_binary_integrity (void) "integrity check using `%s' failed: %s", fname? fname:"[?]", gpg_strerror (err)); #endif /*HAVE_SYSLOG*/ - gcry_free (fname); + xfree (fname); return !!err; #else return 0; diff --git a/src/g10lib.h b/src/g10lib.h index a326ad5f..4e083b8d 100644 --- a/src/g10lib.h +++ b/src/g10lib.h @@ -96,6 +96,36 @@ gcry_error_t _gcry_vcontrol (enum gcry_ctl_cmds cmd, va_list arg_ptr); void _gcry_check_heap (const void *a); int _gcry_get_debug_flag (unsigned int mask); +/* Malloc functions and common wrapper macros. */ +void *_gcry_malloc (size_t n) _GCRY_GCC_ATTR_MALLOC; +void *_gcry_calloc (size_t n, size_t m) _GCRY_GCC_ATTR_MALLOC; +void *_gcry_malloc_secure (size_t n) _GCRY_GCC_ATTR_MALLOC; +void *_gcry_calloc_secure (size_t n, size_t m) _GCRY_GCC_ATTR_MALLOC; +void *_gcry_realloc (void *a, size_t n); +char *_gcry_strdup (const char *string) _GCRY_GCC_ATTR_MALLOC; +void *_gcry_xmalloc (size_t n) _GCRY_GCC_ATTR_MALLOC; +void *_gcry_xcalloc (size_t n, size_t m) _GCRY_GCC_ATTR_MALLOC; +void *_gcry_xmalloc_secure (size_t n) _GCRY_GCC_ATTR_MALLOC; +void *_gcry_xcalloc_secure (size_t n, size_t m) _GCRY_GCC_ATTR_MALLOC; +void *_gcry_xrealloc (void *a, size_t n); +char *_gcry_xstrdup (const char * a) _GCRY_GCC_ATTR_MALLOC; +void _gcry_free (void *a); +int _gcry_is_secure (const void *a) _GCRY_GCC_ATTR_PURE; + +#define xtrymalloc(a) _gcry_malloc ((a)) +#define xtrycalloc(a,b) _gcry_calloc ((a),(b)) +#define xtrymalloc_secure(a) _gcry_malloc_secure ((a)) +#define xtrycalloc_secure(a,b) _gcry_calloc_secure ((a),(b)) +#define xtryrealloc(a,b) _gcry_realloc ((a),(b)) +#define xtrystrdup(a) _gcry_strdup ((a)) +#define xmalloc(a) _gcry_xmalloc ((a)) +#define xcalloc(a,b) _gcry_xcalloc ((a),(b)) +#define xmalloc_secure(a) _gcry_xmalloc_secure ((a)) +#define xcalloc_secure(a,b) _gcry_xcalloc_secure ((a),(b)) +#define xrealloc(a,b) _gcry_xrealloc ((a),(b)) +#define xstrdup(a) _gcry_xstrdup ((a)) +#define xfree(a) _gcry_free ((a)) + /*-- src/misc.c --*/ diff --git a/src/gcrypt-int.h b/src/gcrypt-int.h index e22baf69..65dcb4d0 100644 --- a/src/gcrypt-int.h +++ b/src/gcrypt-int.h @@ -51,7 +51,12 @@ typedef struct mpi_ec_ctx_s *mpi_ec_t; /* Underscore prefixed internal versions of the public functions. They return gpg_err_code and not gpg_error_t. Some macros also - need an underscore prefixed internal version. */ + need an underscore prefixed internal version. + + Note that the memory allocation functions and macros (xmalloc etc.) + are not defined here but in g10lib.h because this file here is + included by some test programs which define theie own xmalloc + macros. */ gpg_err_code_t _gcry_cipher_open (gcry_cipher_hd_t *handle, int algo, int mode, unsigned int flags); diff --git a/src/global.c b/src/global.c index 8a5d3100..cb66d371 100644 --- a/src/global.c +++ b/src/global.c @@ -827,7 +827,7 @@ do_malloc (size_t n, unsigned int flags, void **mem) } void * -gcry_malloc (size_t n) +_gcry_malloc (size_t n) { void *mem = NULL; @@ -837,7 +837,7 @@ gcry_malloc (size_t n) } void * -gcry_malloc_secure (size_t n) +_gcry_malloc_secure (size_t n) { void *mem = NULL; @@ -847,7 +847,7 @@ gcry_malloc_secure (size_t n) } int -gcry_is_secure (const void *a) +_gcry_is_secure (const void *a) { if (get_no_secure_memory ()) return 0; @@ -871,17 +871,17 @@ _gcry_check_heap( const void *a ) } void * -gcry_realloc (void *a, size_t n) +_gcry_realloc (void *a, size_t n) { void *p; /* To avoid problems with non-standard realloc implementations and our own secmem_realloc, we divert to malloc and free here. */ if (!a) - return gcry_malloc (n); + return _gcry_malloc (n); if (!n) { - gcry_free (a); + xfree (a); return NULL; } @@ -895,7 +895,7 @@ gcry_realloc (void *a, size_t n) } void -gcry_free (void *p) +_gcry_free (void *p) { int save_errno; @@ -916,7 +916,7 @@ gcry_free (void *p) } void * -gcry_calloc (size_t n, size_t m) +_gcry_calloc (size_t n, size_t m) { size_t bytes; void *p; @@ -929,14 +929,14 @@ gcry_calloc (size_t n, size_t m) return NULL; } - p = gcry_malloc (bytes); + p = _gcry_malloc (bytes); if (p) memset (p, 0, bytes); return p; } void * -gcry_calloc_secure (size_t n, size_t m) +_gcry_calloc_secure (size_t n, size_t m) { size_t bytes; void *p; @@ -949,7 +949,7 @@ gcry_calloc_secure (size_t n, size_t m) return NULL; } - p = gcry_malloc_secure (bytes); + p = _gcry_malloc_secure (bytes); if (p) memset (p, 0, bytes); return p; @@ -961,17 +961,17 @@ gcry_calloc_secure (size_t n, size_t m) secure memory as well. In an out-of-memory condition, NULL is returned. */ char * -gcry_strdup (const char *string) +_gcry_strdup (const char *string) { char *string_cp = NULL; size_t string_n = 0; string_n = strlen (string); - if (gcry_is_secure (string)) - string_cp = gcry_malloc_secure (string_n + 1); + if (_gcry_is_secure (string)) + string_cp = _gcry_malloc_secure (string_n + 1); else - string_cp = gcry_malloc (string_n + 1); + string_cp = _gcry_malloc (string_n + 1); if (string_cp) strcpy (string_cp, string); @@ -981,11 +981,11 @@ gcry_strdup (const char *string) void * -gcry_xmalloc( size_t n ) +_gcry_xmalloc( size_t n ) { void *p; - while ( !(p = gcry_malloc( n )) ) + while ( !(p = _gcry_malloc( n )) ) { if ( fips_mode () || !outofcore_handler @@ -998,16 +998,16 @@ gcry_xmalloc( size_t n ) } void * -gcry_xrealloc( void *a, size_t n ) +_gcry_xrealloc( void *a, size_t n ) { void *p; - while ( !(p = gcry_realloc( a, n )) ) + while ( !(p = _gcry_realloc( a, n )) ) { if ( fips_mode () || !outofcore_handler || !outofcore_handler (outofcore_handler_value, n, - gcry_is_secure(a)? 3:2 ) ) + _gcry_is_secure(a)? 3:2)) { _gcry_fatal_error (gpg_err_code_from_errno (errno), NULL ); } @@ -1016,11 +1016,11 @@ gcry_xrealloc( void *a, size_t n ) } void * -gcry_xmalloc_secure( size_t n ) +_gcry_xmalloc_secure( size_t n ) { void *p; - while ( !(p = gcry_malloc_secure( n )) ) + while ( !(p = _gcry_malloc_secure( n )) ) { if ( fips_mode () || !outofcore_handler @@ -1035,7 +1035,7 @@ gcry_xmalloc_secure( size_t n ) void * -gcry_xcalloc( size_t n, size_t m ) +_gcry_xcalloc( size_t n, size_t m ) { size_t nbytes; void *p; @@ -1047,13 +1047,13 @@ gcry_xcalloc( size_t n, size_t m ) _gcry_fatal_error(gpg_err_code_from_errno (errno), NULL ); } - p = gcry_xmalloc ( nbytes ); + p = _gcry_xmalloc ( nbytes ); memset ( p, 0, nbytes ); return p; } void * -gcry_xcalloc_secure( size_t n, size_t m ) +_gcry_xcalloc_secure( size_t n, size_t m ) { size_t nbytes; void *p; @@ -1065,20 +1065,20 @@ gcry_xcalloc_secure( size_t n, size_t m ) _gcry_fatal_error(gpg_err_code_from_errno (errno), NULL ); } - p = gcry_xmalloc_secure ( nbytes ); + p = _gcry_xmalloc_secure ( nbytes ); memset ( p, 0, nbytes ); return p; } char * -gcry_xstrdup (const char *string) +_gcry_xstrdup (const char *string) { char *p; - while ( !(p = gcry_strdup (string)) ) + while ( !(p = _gcry_strdup (string)) ) { size_t n = strlen (string); - int is_sec = !!gcry_is_secure (string); + int is_sec = !!_gcry_is_secure (string); if (fips_mode () || !outofcore_handler @@ -355,7 +355,7 @@ _gcry_log_printmpi (const char *text, gcry_mpi_t mpi) do_printhex (text, sign? "-":"+", "", 1); else do_printhex (text, sign? "-":"+", rawmpi, rawmpilen); - gcry_free (rawmpi); + xfree (rawmpi); } } } @@ -400,7 +400,7 @@ _gcry_log_printsxp (const char *text, gcry_sexp_t sexp) size_t size; size = sexp_sprint (sexp, GCRYSEXP_FMT_ADVANCED, NULL, 0); - p = buf = gcry_xmalloc (size); + p = buf = xmalloc (size); sexp_sprint (sexp, GCRYSEXP_FMT_ADVANCED, buf, size); do @@ -429,7 +429,7 @@ _gcry_log_printsxp (const char *text, gcry_sexp_t sexp) log_printf ("\n"); } while (*p); - gcry_free (buf); + xfree (buf); } else if (text) log_printf ("\n"); @@ -269,7 +269,7 @@ _gcry_sexp_release( gcry_sexp_t sexp ) { if (sexp) { - if (gcry_is_secure (sexp)) + if (_gcry_is_secure (sexp)) { /* Extra paranoid wiping. */ const byte *p = sexp->d; @@ -298,7 +298,7 @@ _gcry_sexp_release( gcry_sexp_t sexp ) } wipememory (sexp->d, p - sexp->d); } - gcry_free ( sexp ); + xfree ( sexp ); } } @@ -434,7 +434,7 @@ _gcry_sexp_find_token( const gcry_sexp_t list, const char *tok, size_t toklen ) } n = p - head; - newlist = gcry_malloc ( sizeof *newlist + n ); + newlist = xtrymalloc ( sizeof *newlist + n ); if (!newlist) { /* No way to return an error code, so we can only @@ -589,7 +589,7 @@ _gcry_sexp_nth (const gcry_sexp_t list, int number) { memcpy (&n, p, sizeof n); p += sizeof n; - newlist = gcry_malloc (sizeof *newlist + n + 1); + newlist = xtrymalloc (sizeof *newlist + n + 1); if (!newlist) return NULL; d = newlist->d; @@ -625,7 +625,7 @@ _gcry_sexp_nth (const gcry_sexp_t list, int number) } while (level); n = p + 1 - head; - newlist = gcry_malloc (sizeof *newlist + n); + newlist = xtrymalloc (sizeof *newlist + n); if (!newlist) return NULL; d = newlist->d; @@ -729,7 +729,7 @@ _gcry_sexp_nth_buffer (const gcry_sexp_t list, int number, size_t *rlength) s = do_sexp_nth_data (list, number, &n); if (!s || !n) return NULL; - buf = gcry_malloc (n); + buf = xtrymalloc (n); if (!buf) return NULL; memcpy (buf, s, n); @@ -750,7 +750,7 @@ _gcry_sexp_nth_string (const gcry_sexp_t list, int number) s = do_sexp_nth_data (list, number, &n); if (!s || n < 1 || (n+1) < 1) return NULL; - buf = gcry_malloc (n+1); + buf = xtrymalloc (n+1); if (!buf) return NULL; memcpy (buf, s, n); @@ -776,11 +776,11 @@ _gcry_sexp_nth_mpi (gcry_sexp_t list, int number, int mpifmt) if (!p) return NULL; - a = gcry_is_secure (list)? _gcry_mpi_snew (0) : _gcry_mpi_new (0); + a = _gcry_is_secure (list)? _gcry_mpi_snew (0) : _gcry_mpi_new (0); if (a) mpi_set_opaque (a, p, n*8); else - gcry_free (p); + xfree (p); } else { @@ -872,7 +872,7 @@ _gcry_sexp_cdr(const gcry_sexp_t list) } while (level); n = p - head; - newlist = gcry_malloc (sizeof *newlist + n + 2); + newlist = xtrymalloc (sizeof *newlist + n + 2); if (!newlist) return NULL; d = newlist->d; @@ -934,7 +934,7 @@ make_space ( struct make_space_ctx *c, size_t n ) newsize = c->allocated + 2*(n+sizeof(DATALEN)+1); if (newsize <= c->allocated) return GPG_ERR_TOO_LARGE; - newsexp = gcry_realloc ( c->sexp, sizeof *newsexp + newsize - 1); + newsexp = xtryrealloc ( c->sexp, sizeof *newsexp + newsize - 1); if (!newsexp) return gpg_err_code_from_errno (errno); c->allocated = newsize; @@ -1109,10 +1109,10 @@ do_vsexp_sscan (gcry_sexp_t *retsexp, size_t *erroff, the provided one. However, we add space for one extra datalen so that the code which does the ST_CLOSE can use MAKE_SPACE */ c.allocated = length + sizeof(DATALEN); - if (buffer && length && gcry_is_secure (buffer)) - c.sexp = gcry_malloc_secure (sizeof *c.sexp + c.allocated - 1); + if (buffer && length && _gcry_is_secure (buffer)) + c.sexp = xtrymalloc_secure (sizeof *c.sexp + c.allocated - 1); else - c.sexp = gcry_malloc (sizeof *c.sexp + c.allocated - 1); + c.sexp = xtrymalloc (sizeof *c.sexp + c.allocated - 1); if (!c.sexp) { err = gpg_err_code_from_errno (errno); @@ -1342,15 +1342,15 @@ do_vsexp_sscan (gcry_sexp_t *retsexp, size_t *erroff, if (mp && nm) { MAKE_SPACE (nm); - if (!gcry_is_secure (c.sexp->d) + if (!_gcry_is_secure (c.sexp->d) && mpi_get_flag (m, GCRYMPI_FLAG_SECURE)) { /* We have to switch to secure allocation. */ gcry_sexp_t newsexp; byte *newhead; - newsexp = gcry_malloc_secure (sizeof *newsexp - + c.allocated - 1); + newsexp = xtrymalloc_secure (sizeof *newsexp + + c.allocated - 1); if (!newsexp) { err = gpg_err_code_from_errno (errno); @@ -1359,7 +1359,7 @@ do_vsexp_sscan (gcry_sexp_t *retsexp, size_t *erroff, newhead = newsexp->d; memcpy (newhead, c.sexp->d, (c.pos - c.sexp->d)); c.pos = newhead + (c.pos - c.sexp->d); - gcry_free (c.sexp); + xfree (c.sexp); c.sexp = newsexp; } @@ -1375,15 +1375,15 @@ do_vsexp_sscan (gcry_sexp_t *retsexp, size_t *erroff, BUG (); MAKE_SPACE (nm); - if (!gcry_is_secure (c.sexp->d) + if (!_gcry_is_secure (c.sexp->d) && mpi_get_flag ( m, GCRYMPI_FLAG_SECURE)) { /* We have to switch to secure allocation. */ gcry_sexp_t newsexp; byte *newhead; - newsexp = gcry_malloc_secure (sizeof *newsexp - + c.allocated - 1); + newsexp = xtrymalloc_secure (sizeof *newsexp + + c.allocated - 1); if (!newsexp) { err = gpg_err_code_from_errno (errno); @@ -1392,7 +1392,7 @@ do_vsexp_sscan (gcry_sexp_t *retsexp, size_t *erroff, newhead = newsexp->d; memcpy (newhead, c.sexp->d, (c.pos - c.sexp->d)); c.pos = newhead + (c.pos - c.sexp->d); - gcry_free (c.sexp); + xfree (c.sexp); c.sexp = newsexp; } @@ -1429,15 +1429,15 @@ do_vsexp_sscan (gcry_sexp_t *retsexp, size_t *erroff, MAKE_SPACE (alen); if (alen - && !gcry_is_secure (c.sexp->d) - && gcry_is_secure (astr)) + && !_gcry_is_secure (c.sexp->d) + && _gcry_is_secure (astr)) { /* We have to switch to secure allocation. */ gcry_sexp_t newsexp; byte *newhead; - newsexp = gcry_malloc_secure (sizeof *newsexp - + c.allocated - 1); + newsexp = xtrymalloc_secure (sizeof *newsexp + + c.allocated - 1); if (!newsexp) { err = gpg_err_code_from_errno (errno); @@ -1446,7 +1446,7 @@ do_vsexp_sscan (gcry_sexp_t *retsexp, size_t *erroff, newhead = newsexp->d; memcpy (newhead, c.sexp->d, (c.pos - c.sexp->d)); c.pos = newhead + (c.pos - c.sexp->d); - gcry_free (c.sexp); + xfree (c.sexp); c.sexp = newsexp; } @@ -1627,9 +1627,9 @@ do_vsexp_sscan (gcry_sexp_t *retsexp, size_t *erroff, if (c.sexp) { /* Extra paranoid wipe on error. */ - if (gcry_is_secure (c.sexp)) + if (_gcry_is_secure (c.sexp)) wipememory (c.sexp, sizeof (struct gcry_sexp) + c.allocated - 1); - gcry_free (c.sexp); + xfree (c.sexp); } /* This might be expected by existing code... */ *retsexp = NULL; @@ -2359,7 +2359,7 @@ _gcry_sexp_vextract_param (gcry_sexp_t sexp, const char *path, { /* We might have allocated a buffer. */ gcry_buffer_t *spec = (gcry_buffer_t*)array[idx]; - gcry_free (spec->data); + xfree (spec->data); spec->data = NULL; spec->size = spec->off = spec->len = 0; } diff --git a/src/visibility.h b/src/visibility.h index c791ffb5..4127a432 100644 --- a/src/visibility.h +++ b/src/visibility.h @@ -24,23 +24,6 @@ use the underscore prefixed version internally. */ -#define gcry_free _gcry_free -#define gcry_malloc _gcry_malloc -#define gcry_malloc_secure _gcry_malloc_secure -#define gcry_calloc _gcry_calloc -#define gcry_calloc_secure _gcry_calloc_secure -#define gcry_realloc _gcry_realloc -#define gcry_strdup _gcry_strdup -#define gcry_is_secure _gcry_is_secure -#define gcry_xcalloc _gcry_xcalloc -#define gcry_xcalloc_secure _gcry_xcalloc_secure -#define gcry_xmalloc _gcry_xmalloc -#define gcry_xmalloc_secure _gcry_xmalloc_secure -#define gcry_xrealloc _gcry_xrealloc -#define gcry_xstrdup _gcry_xstrdup - - - /* Include the main header here so that public symbols are mapped to the internal underscored ones. */ #ifdef _GCRY_INCLUDED_BY_VISIBILITY_C @@ -67,38 +50,15 @@ gcry_err_code_t gcry_md_get (gcry_md_hd_t hd, int algo, #ifdef _GCRY_INCLUDED_BY_VISIBILITY_C -/* A macro to flag a function as visible. Note that we take the - definition from the mapped name. */ +/* A macro to flag a function as visible. */ #ifdef GCRY_USE_VISIBILITY -# define MARK_VISIBLE(name) \ - extern __typeof__ (_##name) name __attribute__ ((visibility("default"))); # define MARK_VISIBLEX(name) \ extern __typeof__ (name) name __attribute__ ((visibility("default"))); #else -# define MARK_VISIBLE(name) /* */ # define MARK_VISIBLEX(name) /* */ #endif -/* First undef all redefined symbols so that we set the attribute on - the correct version name. */ - -#undef gcry_free -#undef gcry_malloc -#undef gcry_malloc_secure -#undef gcry_calloc -#undef gcry_calloc_secure -#undef gcry_realloc -#undef gcry_strdup -#undef gcry_is_secure -#undef gcry_xcalloc -#undef gcry_xcalloc_secure -#undef gcry_xmalloc -#undef gcry_xmalloc_secure -#undef gcry_xrealloc -#undef gcry_xstrdup - - /* Now mark all symbols. */ MARK_VISIBLEX (gcry_check_version) @@ -118,20 +78,20 @@ MARK_VISIBLEX (gcry_error_from_errno) MARK_VISIBLEX (gcry_strerror) MARK_VISIBLEX (gcry_strsource) -MARK_VISIBLE (gcry_free) -MARK_VISIBLE (gcry_malloc) -MARK_VISIBLE (gcry_malloc_secure) -MARK_VISIBLE (gcry_calloc) -MARK_VISIBLE (gcry_calloc_secure) -MARK_VISIBLE (gcry_realloc) -MARK_VISIBLE (gcry_strdup) -MARK_VISIBLE (gcry_is_secure) -MARK_VISIBLE (gcry_xcalloc) -MARK_VISIBLE (gcry_xcalloc_secure) -MARK_VISIBLE (gcry_xmalloc) -MARK_VISIBLE (gcry_xmalloc_secure) -MARK_VISIBLE (gcry_xrealloc) -MARK_VISIBLE (gcry_xstrdup) +MARK_VISIBLEX (gcry_malloc) +MARK_VISIBLEX (gcry_malloc_secure) +MARK_VISIBLEX (gcry_calloc) +MARK_VISIBLEX (gcry_calloc_secure) +MARK_VISIBLEX (gcry_realloc) +MARK_VISIBLEX (gcry_strdup) +MARK_VISIBLEX (gcry_is_secure) +MARK_VISIBLEX (gcry_xcalloc) +MARK_VISIBLEX (gcry_xcalloc_secure) +MARK_VISIBLEX (gcry_xmalloc) +MARK_VISIBLEX (gcry_xmalloc_secure) +MARK_VISIBLEX (gcry_xrealloc) +MARK_VISIBLEX (gcry_xstrdup) +MARK_VISIBLEX (gcry_free) MARK_VISIBLEX (gcry_md_algo_info) MARK_VISIBLEX (gcry_md_algo_name) @@ -319,8 +279,7 @@ MARK_VISIBLEX (gcry_log_debugsxp) MARK_VISIBLEX (_gcry_mpi_get_const) - -#undef MARK_VISIBLE +#undef MARK_VISIBLEX #else /*!_GCRY_INCLUDED_BY_VISIBILITY_C*/ @@ -329,8 +288,6 @@ MARK_VISIBLEX (_gcry_mpi_get_const) between a public and an internal version is that the internal version use gpg_err_code_t and the public version gpg_error_t. */ -#define gcry_mpi_set_opaque_copy _gcry_USE_THE_UNDERSCORED_FUNCTION - #define gcry_check_version _gcry_USE_THE_UNDERSCORED_FUNCTION #define gcry_control _gcry_USE_THE_UNDERSCORED_FUNCTION @@ -348,6 +305,21 @@ MARK_VISIBLEX (_gcry_mpi_get_const) #define gcry_strerror _gcry_USE_THE_UNDERSCORED_FUNCTION #define gcry_strsource _gcry_USE_THE_UNDERSCORED_FUNCTION +#define gcry_malloc _gcry_USE_THE_UNDERSCORED_FUNCTION +#define gcry_malloc_secure _gcry_USE_THE_UNDERSCORED_FUNCTION +#define gcry_calloc _gcry_USE_THE_UNDERSCORED_FUNCTION +#define gcry_calloc_secure _gcry_USE_THE_UNDERSCORED_FUNCTION +#define gcry_realloc _gcry_USE_THE_UNDERSCORED_FUNCTION +#define gcry_strdup _gcry_USE_THE_UNDERSCORED_FUNCTION +#define gcry_xcalloc _gcry_USE_THE_UNDERSCORED_FUNCTION +#define gcry_xcalloc_secure _gcry_USE_THE_UNDERSCORED_FUNCTION +#define gcry_xmalloc _gcry_USE_THE_UNDERSCORED_FUNCTION +#define gcry_xmalloc_secure _gcry_USE_THE_UNDERSCORED_FUNCTION +#define gcry_xrealloc _gcry_USE_THE_UNDERSCORED_FUNCTION +#define gcry_xstrdup _gcry_USE_THE_UNDERSCORED_FUNCTION +#define gcry_free _gcry_USE_THE_UNDERSCORED_FUNCTION +#define gcry_is_secure _gcry_USE_THE_UNDERSCORED_FUNCTION + #define gcry_cipher_open _gcry_USE_THE_UNDERSCORED_FUNCTION #define gcry_cipher_close _gcry_USE_THE_UNDERSCORED_FUNCTION #define gcry_cipher_setkey _gcry_USE_THE_UNDERSCORED_FUNCTION @@ -510,7 +482,6 @@ MARK_VISIBLEX (_gcry_mpi_get_const) #define gcry_mpi_swap _gcry_USE_THE_UNDERSCORED_FUNCTION #define gcry_mpi_test_bit _gcry_USE_THE_UNDERSCORED_FUNCTION - #define gcry_mpi_abs _gcry_USE_THE_UNDERSCORED_FUNCTION #define gcry_mpi_ec_add _gcry_USE_THE_UNDERSCORED_FUNCTION #define gcry_mpi_ec_curve_point _gcry_USE_THE_UNDERSCORED_FUNCTION |