1
0
Fork 0
mirror of git://git.gnupg.org/gnupg.git synced 2025-07-02 22:46:30 +02:00

Import/export of pkcs#12 now uses the gpg-agent directly.

Removed duplicated code (percent unescaping).
This commit is contained in:
Werner Koch 2009-04-01 10:51:53 +00:00
parent 98e1a75e20
commit f8b4cd7650
29 changed files with 716 additions and 369 deletions

View file

@ -1,5 +1,5 @@
/* membuf.c - A simple implementation of a dynamic buffer
* Copyright (C) 2001, 2003 Free Software Foundation, Inc.
/* membuf.c - A simple implementation of a dynamic buffer.
* Copyright (C) 2001, 2003, 2009 Free Software Foundation, Inc.
*
* This file is part of GnuPG.
*
@ -75,7 +75,7 @@ put_membuf (membuf_t *mb, const void *buf, size_t len)
in case we are storing sensitive data here. The membuf
API does not provide another way to cleanup after an
error. */
memset (mb->buf, 0, mb->len);
wipememory (mb->buf, mb->len);
return;
}
mb->buf = p;
@ -99,8 +99,12 @@ get_membuf (membuf_t *mb, size_t *len)
if (mb->out_of_core)
{
xfree (mb->buf);
mb->buf = NULL;
if (mb->buf)
{
wipememory (mb->buf, mb->len);
xfree (mb->buf);
mb->buf = NULL;
}
errno = mb->out_of_core;
return NULL;
}