diff options
| author | Steffen Hansen <[email protected]> | 2002-06-27 13:15:02 +0000 | 
|---|---|---|
| committer | Steffen Hansen <[email protected]> | 2002-06-27 13:15:02 +0000 | 
| commit | bb19f16ec4861af434be89a8c2fdb42ad53ac758 (patch) | |
| tree | fb97a9c93d856686faebe156e1f92ba25e4b1b02 | |
| parent | Missing implementation bug fixed: Return both error id and error plain text f... (diff) | |
| download | gpgme-bb19f16ec4861af434be89a8c2fdb42ad53ac758.tar.gz gpgme-bb19f16ec4861af434be89a8c2fdb42ad53ac758.zip | |
handle truncated data
| -rw-r--r-- | gpgmeplug/ChangeLog | 4 | ||||
| -rw-r--r-- | gpgmeplug/cryptplug.h | 4 | ||||
| -rw-r--r-- | gpgmeplug/gpgmeplug.c | 10 | 
3 files changed, 14 insertions, 4 deletions
| diff --git a/gpgmeplug/ChangeLog b/gpgmeplug/ChangeLog index d7a83816..ddc7f335 100644 --- a/gpgmeplug/ChangeLog +++ b/gpgmeplug/ChangeLog @@ -1,3 +1,7 @@ +2002-06-27  Steffen Hansen  <[email protected]> + +	* Handle truncated data from dirmngr. +  2002-06-25  Steffen Hansen  <[email protected]>  	* cryptplug.h, gpgmeplug.c: New function importCertificate() for importing a  diff --git a/gpgmeplug/cryptplug.h b/gpgmeplug/cryptplug.h index b978fb70..6d901d94 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 25f7e2ae..48ce8106 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, "<truncated/>"); +  if( s ) free( s );    assert(it);    freeInfo( &(it->info) );    gpgme_op_keylist_end(it->ctx);    gpgme_release (it->ctx);    free( it ); +  return truncated;  }  int | 
