/mandos/trunk

To get this branch, use:
bzr branch http://bzr.recompile.se/loggerhead/mandos/trunk

« back to all changes in this revision

Viewing changes to plugins.d/mandos-client.c

  • Committer: Teddy Hogeborn
  • Date: 2009-09-05 17:39:34 UTC
  • Revision ID: teddy@fukt.bsnet.se-20090905173934-gs0r858omhudc71m
* plugin-runner.c (main): Move variables "tmpmax" and "tmp" into
                          the innermost scope possible.

Show diffs side-by-side

added added

removed removed

Lines of Context:
164
164
 */
165
165
static bool init_gpgme(const char *seckey,
166
166
                       const char *pubkey, const char *tempdir){
 
167
  int ret;
167
168
  gpgme_error_t rc;
168
169
  gpgme_engine_info_t engine_info;
169
170
  
172
173
   * Helper function to insert pub and seckey to the engine keyring.
173
174
   */
174
175
  bool import_key(const char *filename){
175
 
    int ret;
176
176
    int fd;
177
177
    gpgme_data_t pgp_data;
178
178
    
531
531
  char *decrypted_buffer;
532
532
  size_t buffer_length = 0;
533
533
  size_t buffer_capacity = 0;
 
534
  ssize_t decrypted_buffer_size;
534
535
  size_t written;
535
536
  int retval = 0;
536
537
  gnutls_session_t session;
711
712
    goto mandos_end;
712
713
  }
713
714
  
714
 
  do {
 
715
  do{
715
716
    ret = gnutls_handshake(session);
716
717
    if(quit_now){
717
718
      goto mandos_end;
763
764
      case GNUTLS_E_AGAIN:
764
765
        break;
765
766
      case GNUTLS_E_REHANDSHAKE:
766
 
        do {
 
767
        do{
767
768
          ret = gnutls_handshake(session);
768
769
          
769
770
          if(quit_now){
804
805
  }
805
806
  
806
807
  if(buffer_length > 0){
807
 
    ssize_t decrypted_buffer_size;
808
808
    decrypted_buffer_size = pgp_packet_decrypt(buffer,
809
809
                                               buffer_length,
810
810
                                               &decrypted_buffer);
811
811
    if(decrypted_buffer_size >= 0){
812
 
      
813
812
      written = 0;
814
813
      while(written < (size_t) decrypted_buffer_size){
815
814
        if(quit_now){