/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

merge

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;
168
167
  gpgme_error_t rc;
169
168
  gpgme_engine_info_t engine_info;
170
169
  
173
172
   * Helper function to insert pub and seckey to the engine keyring.
174
173
   */
175
174
  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;
535
534
  size_t written;
536
535
  int retval = 0;
537
536
  gnutls_session_t session;
712
711
    goto mandos_end;
713
712
  }
714
713
  
715
 
  do{
 
714
  do {
716
715
    ret = gnutls_handshake(session);
717
716
    if(quit_now){
718
717
      goto mandos_end;
764
763
      case GNUTLS_E_AGAIN:
765
764
        break;
766
765
      case GNUTLS_E_REHANDSHAKE:
767
 
        do{
 
766
        do {
768
767
          ret = gnutls_handshake(session);
769
768
          
770
769
          if(quit_now){
805
804
  }
806
805
  
807
806
  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
      
812
813
      written = 0;
813
814
      while(written < (size_t) decrypted_buffer_size){
814
815
        if(quit_now){