handle truncated data

This commit is contained in:
Steffen Hansen 2002-06-27 13:15:02 +00:00
parent 095eef1792
commit bb19f16ec4
3 changed files with 14 additions and 4 deletions

View File

@ -1,3 +1,7 @@
2002-06-27 Steffen Hansen <steffen@hrhansen.dk>
* Handle truncated data from dirmngr.
2002-06-25 Steffen Hansen <steffen@hrhansen.dk> 2002-06-25 Steffen Hansen <steffen@hrhansen.dk>
* cryptplug.h, gpgmeplug.c: New function importCertificate() for importing a * cryptplug.h, gpgmeplug.c: New function importCertificate() for importing a

View File

@ -1832,7 +1832,7 @@ struct CertificateInfo {
dont free() it, the struct will be reused dont free() it, the struct will be reused
by the next call to nextCertificate() by the next call to nextCertificate()
} }
endListCertificates( it ); int truncated = endListCertificates( it );
\endverbatim \endverbatim
*/ */
struct CertIterator* struct CertIterator*
@ -1841,7 +1841,7 @@ startListCertificates( const char* pattern, int remote );
int int
nextCertificate( struct CertIterator*, struct CertificateInfo** result ); nextCertificate( struct CertIterator*, struct CertificateInfo** result );
void int
endListCertificates( struct CertIterator* ); endListCertificates( struct CertIterator* );
/*! /*!

View File

@ -2402,19 +2402,25 @@ nextCertificate( struct CertIterator* it, struct CertificateInfo** result )
gpgme_key_release (key); gpgme_key_release (key);
/*return &(it->info);*/ /*return &(it->info);*/
*result = &(it->info); *result = &(it->info);
} else *result = NULL; } else {
*result = NULL;
}
return retval; return retval;
} }
void int
endListCertificates( struct CertIterator* it ) endListCertificates( struct CertIterator* it )
{ {
/*fprintf( stderr, "endListCertificates()\n" );*/ /*fprintf( stderr, "endListCertificates()\n" );*/
char *s = gpgme_get_op_info (it->ctx, 0);
int truncated = s && strstr (s, "<truncated/>");
if( s ) free( s );
assert(it); assert(it);
freeInfo( &(it->info) ); freeInfo( &(it->info) );
gpgme_op_keylist_end(it->ctx); gpgme_op_keylist_end(it->ctx);
gpgme_release (it->ctx); gpgme_release (it->ctx);
free( it ); free( it );
return truncated;
} }
int int