/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-01-04 21:20:50 UTC
  • Revision ID: teddy@fukt.bsnet.se-20090104212050-cl2px2i2oz7wlxw1
* debian/control (Build-Depends): Bug fix: Added "docbook-xml".

* mandos (main): Keep running even if no clients are defined.

* mandos.xml (OPTIONS): Bug fix: Close unclosed <para> tag.
  (D-BUS INTERFACE): Changed id to "dbus_interface".  All references
                     changed.

Show diffs side-by-side

added added

removed removed

Lines of Context:
9
9
 * "browse_callback", and parts of "main".
10
10
 * 
11
11
 * Everything else is
12
 
 * Copyright © 2007-2008 Teddy Hogeborn & Björn Påhlsson
 
12
 * Copyright © 2008 Teddy Hogeborn
 
13
 * Copyright © 2008 Björn Påhlsson
13
14
 * 
14
15
 * This program is free software: you can redistribute it and/or
15
16
 * modify it under the terms of the GNU General Public License as
101
102
 
102
103
#define BUFFER_SIZE 256
103
104
 
104
 
/*
105
 
  #define PATHDIR "/conf/conf.d/mandos"
106
 
*/
107
 
 
108
105
#define PATHDIR "/conf/conf.d/mandos"
109
106
#define SECKEY "seckey.txt"
110
107
#define PUBKEY "pubkey.txt"
111
108
 
112
109
bool debug = false;
113
110
static const char mandos_protocol_version[] = "1";
114
 
const char *argp_program_version = "password-request 1.0";
 
111
const char *argp_program_version = "mandos-client " VERSION;
115
112
const char *argp_program_bug_address = "<mandos@fukt.bsnet.se>";
116
113
 
117
114
/* Used for passing in values through the Avahi callback functions */
315
312
  
316
313
  /* Seek back to the beginning of the GPGME plaintext data buffer */
317
314
  if (gpgme_data_seek(dh_plain, (off_t) 0, SEEK_SET) == -1){
318
 
    perror("pgpme_data_seek");
 
315
    perror("gpgme_data_seek");
319
316
    plaintext_length = -1;
320
317
    goto decrypt_end;
321
318
  }
451
448
  
452
449
  gnutls_certificate_free_credentials(mc->cred);
453
450
  gnutls_global_deinit();
 
451
  gnutls_dh_params_deinit(mc->dh_params);
454
452
  return -1;
455
453
}
456
454
 
830
828
                          .dh_bits = 1024, .priority = "SECURE256"
831
829
                          ":!CTYPE-X.509:+CTYPE-OPENPGP" };
832
830
    bool gnutls_initalized = false;
833
 
    bool pgpme_initalized = false;
 
831
    bool gpgme_initalized = false;
834
832
    
835
833
    {
836
834
      struct argp_option options[] = {
977
975
    }
978
976
    
979
977
    if(not init_gpgme(&mc, pubkey, seckey, tempdir)){
980
 
      fprintf(stderr, "pgpme_initalized failed\n");
 
978
      fprintf(stderr, "gpgme_initalized failed\n");
981
979
      exitcode = EXIT_FAILURE;
982
980
      goto end;
983
981
    } else {
984
 
      pgpme_initalized = true;
 
982
      gpgme_initalized = true;
985
983
    }
986
984
    
987
985
    if_index = (AvahiIfIndex) if_nametoindex(interface);
1098
1096
    if (gnutls_initalized){
1099
1097
      gnutls_certificate_free_credentials(mc.cred);
1100
1098
      gnutls_global_deinit ();
 
1099
      gnutls_dh_params_deinit(mc.dh_params);
1101
1100
    }
1102
1101
    
1103
 
    if(pgpme_initalized){
 
1102
    if(gpgme_initalized){
1104
1103
      gpgme_release(mc.ctx);
1105
1104
    }
1106
1105
    
1133
1132
            free(fullname);
1134
1133
          }
1135
1134
        }
 
1135
        closedir(d);
1136
1136
      }
1137
1137
      ret = rmdir(tempdir);
1138
1138
      if(ret == -1){