/mandos/release

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

« back to all changes in this revision

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

  • Committer: Teddy Hogeborn
  • Date: 2008-10-01 15:29:01 UTC
  • Revision ID: teddy@fukt.bsnet.se-20081001152901-fh30whl3m4vb7m24
* debian/changelog: New Debian revision.

* debian/mandos-client.lintian-overrides: Added comments.
* debian/mandos.lintian-overrides: - '' -

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