summaryrefslogtreecommitdiffstats
path: root/common/sexputil.c
diff options
context:
space:
mode:
authorWerner Koch <wk@gnupg.org>2010-06-21 12:01:24 +0200
committerWerner Koch <wk@gnupg.org>2010-06-21 12:01:24 +0200
commit91056b1976bfb7b755e53b1302f4ede2b5cbc05d (patch)
tree32f1a4dd821d64e9aceede18c549ade7f336dde9 /common/sexputil.c
parentAvoid using the protect-tool to import pkcs#12. (diff)
downloadgnupg2-91056b1976bfb7b755e53b1302f4ede2b5cbc05d.tar.xz
gnupg2-91056b1976bfb7b755e53b1302f4ede2b5cbc05d.zip
Implement export of pkcs#12 objects using a direct agent connection.
Diffstat (limited to 'common/sexputil.c')
-rw-r--r--common/sexputil.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/common/sexputil.c b/common/sexputil.c
index b336145c4..1e9c766e9 100644
--- a/common/sexputil.c
+++ b/common/sexputil.c
@@ -72,9 +72,9 @@ make_canon_sexp (gcry_sexp_t sexp, unsigned char **r_buffer, size_t *r_buflen)
/* Same as make_canon_sexp but pad the buffer to multiple of 64
- bits. */
+ bits. If SECURE is set, secure memory will be allocated. */
gpg_error_t
-make_canon_sexp_pad (gcry_sexp_t sexp,
+make_canon_sexp_pad (gcry_sexp_t sexp, int secure,
unsigned char **r_buffer, size_t *r_buflen)
{
size_t len;
@@ -88,7 +88,7 @@ make_canon_sexp_pad (gcry_sexp_t sexp,
if (!len)
return gpg_error (GPG_ERR_BUG);
len += (8 - len % 8) % 8;
- buf = xtrycalloc (1, len);
+ buf = secure? xtrycalloc_secure (1, len) : xtrycalloc (1, len);
if (!buf)
return gpg_error_from_syserror ();
if (!gcry_sexp_sprint (sexp, GCRYSEXP_FMT_CANON, buf, len))