mirror of
git://git.gnupg.org/gnupg.git
synced 2025-07-02 22:46:30 +02:00
Finished the bulk of changes for gnupg 1.9. This included switching
to libgcrypt functions, using shared error codes from libgpg-error, replacing the old functions we used to have in ../util by those in ../jnlib and ../common, renaming the malloc functions and a couple of types. Note, that not all changes are listed below becuause they are too similar and done at far too many places. As of today the code builds using the current libgcrypt from CVS but it is very unlikely that it actually works.
This commit is contained in:
parent
b7b07d36e8
commit
c0c2c58054
90 changed files with 5078 additions and 2925 deletions
21
g10/export.c
21
g10/export.c
|
@ -35,7 +35,7 @@
|
|||
#include "i18n.h"
|
||||
|
||||
static int do_export( STRLIST users, int secret, unsigned int options );
|
||||
static int do_export_stream( IOBUF out, STRLIST users, int secret,
|
||||
static int do_export_stream( iobuf_t out, STRLIST users, int secret,
|
||||
KBNODE *keyblock_out, unsigned int options,
|
||||
int *any );
|
||||
|
||||
|
@ -71,7 +71,7 @@ export_pubkeys( STRLIST users, unsigned int options )
|
|||
* been exported
|
||||
*/
|
||||
int
|
||||
export_pubkeys_stream( IOBUF out, STRLIST users,
|
||||
export_pubkeys_stream( iobuf_t out, STRLIST users,
|
||||
KBNODE *keyblock_out, unsigned int options )
|
||||
{
|
||||
int any, rc;
|
||||
|
@ -97,7 +97,7 @@ export_secsubkeys( STRLIST users )
|
|||
static int
|
||||
do_export( STRLIST users, int secret, unsigned int options )
|
||||
{
|
||||
IOBUF out = NULL;
|
||||
iobuf_t out = NULL;
|
||||
int any, rc;
|
||||
armor_filter_context_t afx;
|
||||
compress_filter_context_t zfx;
|
||||
|
@ -129,7 +129,7 @@ do_export( STRLIST users, int secret, unsigned int options )
|
|||
contains a pointer to the first keyblock found and exported. No
|
||||
other keyblocks are exported. The caller must free it. */
|
||||
static int
|
||||
do_export_stream( IOBUF out, STRLIST users, int secret,
|
||||
do_export_stream( iobuf_t out, STRLIST users, int secret,
|
||||
KBNODE *keyblock_out, unsigned int options, int *any )
|
||||
{
|
||||
int rc = 0;
|
||||
|
@ -147,20 +147,20 @@ do_export_stream( IOBUF out, STRLIST users, int secret,
|
|||
|
||||
if (!users) {
|
||||
ndesc = 1;
|
||||
desc = m_alloc_clear ( ndesc * sizeof *desc);
|
||||
desc = xcalloc (1, ndesc * sizeof *desc);
|
||||
desc[0].mode = KEYDB_SEARCH_MODE_FIRST;
|
||||
}
|
||||
else {
|
||||
for (ndesc=0, sl=users; sl; sl = sl->next, ndesc++)
|
||||
;
|
||||
desc = m_alloc ( ndesc * sizeof *desc);
|
||||
desc = xmalloc ( ndesc * sizeof *desc);
|
||||
|
||||
for (ndesc=0, sl=users; sl; sl = sl->next) {
|
||||
if (classify_user_id (sl->d, desc+ndesc))
|
||||
ndesc++;
|
||||
else
|
||||
log_error (_("key `%s' not found: %s\n"),
|
||||
sl->d, g10_errstr (G10ERR_INV_USER_ID));
|
||||
sl->d, gpg_strerror (GPG_ERR_INV_USER_ID));
|
||||
}
|
||||
|
||||
/* it would be nice to see which of the given users did
|
||||
|
@ -181,7 +181,7 @@ do_export_stream( IOBUF out, STRLIST users, int secret,
|
|||
/* read the keyblock */
|
||||
rc = keydb_get_keyblock (kdbhd, &keyblock );
|
||||
if( rc ) {
|
||||
log_error (_("error reading keyblock: %s\n"), g10_errstr(rc) );
|
||||
log_error (_("error reading keyblock: %s\n"), gpg_strerror (rc) );
|
||||
goto leave;
|
||||
}
|
||||
|
||||
|
@ -370,8 +370,7 @@ do_export_stream( IOBUF out, STRLIST users, int secret,
|
|||
|
||||
if( rc ) {
|
||||
log_error("build_packet(%d) failed: %s\n",
|
||||
node->pkt->pkttype, g10_errstr(rc) );
|
||||
rc = G10ERR_WRITE_FILE;
|
||||
node->pkt->pkttype, gpg_strerror (rc) );
|
||||
goto leave;
|
||||
}
|
||||
}
|
||||
|
@ -386,7 +385,7 @@ do_export_stream( IOBUF out, STRLIST users, int secret,
|
|||
rc = 0;
|
||||
|
||||
leave:
|
||||
m_free(desc);
|
||||
xfree (desc);
|
||||
keydb_release (kdbhd);
|
||||
if(rc || keyblock_out==NULL)
|
||||
release_kbnode( keyblock );
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue