/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/password-request.c

  • Committer: Teddy Hogeborn
  • Date: 2008-09-06 15:41:27 UTC
  • Revision ID: teddy@fukt.bsnet.se-20080906154127-oxfrwsrbu0inhljv
* plugin-runner.c (main): Bug fix: use built-in default value if
                          "--plugin-dir" was not used.

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