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

Changes to make use of code taken from libassuan. This replaces the

old ad-hoc connection code to gpg-agent.  We do need this for the
forthcoming diversion of card code to an already running gpg-agent
with card-support.
This commit is contained in:
Werner Koch 2005-04-05 17:09:13 +00:00
parent 727cda9758
commit 80f4424658
23 changed files with 2432 additions and 619 deletions

View file

@ -1,5 +1,5 @@
/* memory.c - memory allocation
* Copyright (C) 1998, 1999, 2001 Free Software Foundation, Inc.
* Copyright (C) 1998, 1999, 2001, 2005 Free Software Foundation, Inc.
*
* This file is part of GnuPG.
*
@ -603,29 +603,6 @@ m_size( const void *a )
}
#if 0 /* not used */
/****************
* Make a copy of the memory block at a
*/
void *
FNAME(copy)( const void *a FNAMEPRT )
{
void *b;
size_t n;
if( !a )
return NULL;
n = m_size(a); Aiiiih woher nehmen
if( m_is_secure(a) )
b = FNAME(alloc_secure)(n FNAMEARG);
else
b = FNAME(alloc)(n FNAMEARG);
memcpy(b, a, n );
return b;
}
#endif
char *
FNAME(strdup)( const char *a FNAMEPRT )
{
@ -634,3 +611,31 @@ FNAME(strdup)( const char *a FNAMEPRT )
strcpy(p, a);
return p;
}
/* Wrapper around m_alloc_clear to take the usual 2 arguments of a
calloc style function. */
void *
xcalloc (size_t n, size_t m)
{
size_t nbytes;
nbytes = n * m;
if (m && nbytes / m != n)
out_of_core (nbytes, 0);
return m_alloc_clear (nbytes);
}
/* Wrapper around m_alloc_csecure_lear to take the usual 2 arguments
of a calloc style function. */
void *
xcalloc_secure (size_t n, size_t m)
{
size_t nbytes;
nbytes = n * m;
if (m && nbytes / m != n)
out_of_core (nbytes, 1);
return m_alloc_secure_clear (nbytes);
}