From: Steffen Hansen Date: Thu, 27 Jun 2002 13:15:02 +0000 (+0000) Subject: handle truncated data X-Git-Tag: dd9jn_pre_test_20020702~20 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=bb19f16ec4861af434be89a8c2fdb42ad53ac758;p=gpgme.git handle truncated data --- diff --git a/gpgmeplug/ChangeLog b/gpgmeplug/ChangeLog index d7a8381..ddc7f33 100644 --- a/gpgmeplug/ChangeLog +++ b/gpgmeplug/ChangeLog @@ -1,3 +1,7 @@ +2002-06-27 Steffen Hansen + + * Handle truncated data from dirmngr. + 2002-06-25 Steffen Hansen * cryptplug.h, gpgmeplug.c: New function importCertificate() for importing a diff --git a/gpgmeplug/cryptplug.h b/gpgmeplug/cryptplug.h index b978fb7..6d901d9 100644 --- a/gpgmeplug/cryptplug.h +++ b/gpgmeplug/cryptplug.h @@ -1832,7 +1832,7 @@ struct CertificateInfo { dont free() it, the struct will be reused by the next call to nextCertificate() } - endListCertificates( it ); + int truncated = endListCertificates( it ); \endverbatim */ struct CertIterator* @@ -1841,7 +1841,7 @@ startListCertificates( const char* pattern, int remote ); int nextCertificate( struct CertIterator*, struct CertificateInfo** result ); -void +int endListCertificates( struct CertIterator* ); /*! diff --git a/gpgmeplug/gpgmeplug.c b/gpgmeplug/gpgmeplug.c index 25f7e2a..48ce810 100644 --- a/gpgmeplug/gpgmeplug.c +++ b/gpgmeplug/gpgmeplug.c @@ -2402,19 +2402,25 @@ nextCertificate( struct CertIterator* it, struct CertificateInfo** result ) gpgme_key_release (key); /*return &(it->info);*/ *result = &(it->info); - } else *result = NULL; + } else { + *result = NULL; + } return retval; } -void +int endListCertificates( struct CertIterator* it ) { /*fprintf( stderr, "endListCertificates()\n" );*/ + char *s = gpgme_get_op_info (it->ctx, 0); + int truncated = s && strstr (s, ""); + if( s ) free( s ); assert(it); freeInfo( &(it->info) ); gpgme_op_keylist_end(it->ctx); gpgme_release (it->ctx); free( it ); + return truncated; } int