From eb4c2774b9174b2d1f4358e9a782b929c6d5bb9c Mon Sep 17 00:00:00 2001 From: Steffen Hansen Date: Thu, 27 Jun 2002 13:15:02 +0000 Subject: [PATCH] handle truncated data --- trunk/gpgmeplug/ChangeLog | 4 ++++ trunk/gpgmeplug/cryptplug.h | 4 ++-- trunk/gpgmeplug/gpgmeplug.c | 10 ++++++++-- 3 files changed, 14 insertions(+), 4 deletions(-) diff --git a/trunk/gpgmeplug/ChangeLog b/trunk/gpgmeplug/ChangeLog index d7a8381..ddc7f33 100644 --- a/trunk/gpgmeplug/ChangeLog +++ b/trunk/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/trunk/gpgmeplug/cryptplug.h b/trunk/gpgmeplug/cryptplug.h index b978fb7..6d901d9 100644 --- a/trunk/gpgmeplug/cryptplug.h +++ b/trunk/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/trunk/gpgmeplug/gpgmeplug.c b/trunk/gpgmeplug/gpgmeplug.c index 25f7e2a..48ce810 100644 --- a/trunk/gpgmeplug/gpgmeplug.c +++ b/trunk/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 -- 2.26.2