/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:34:21 UTC
  • Revision ID: teddy@fukt.bsnet.se-20080906153421-605ydhwyo404krh9
* initramfs-tools-hook: Use long options where available.  Use only
                        one "test" invocation instead of several.

* mandos-keygen: Use only one "test" invocation instead of several.
                 Use long options where available.  Strip newline from
                 entered password.

* plugin-runner.c (print_out_password): Do not strip trailing newline.
  (fallback): Strip trailing newline from getpass().

* plugin-runner.xml (PLUGINS): Plugins should not print trailing
                               newlines.

* plugins.d/password-prompt.c (main): Strip trailing newline.

* plugins.d/password-request.c (main): Bug fix: Read "pubkey.txt", not
                                       "pupkey.txt".

Show diffs side-by-side

added added

removed removed

Lines of Context:
111
111
 
112
112
bool debug = false;
113
113
static const char mandos_protocol_version[] = "1";
114
 
const char *argp_program_version = "mandos-client 1.0";
 
114
const char *argp_program_version = "password-request 1.0";
115
115
const char *argp_program_bug_address = "<mandos@fukt.bsnet.se>";
116
116
 
117
117
/* Used for passing in values through the Avahi callback functions */
315
315
  
316
316
  /* Seek back to the beginning of the GPGME plaintext data buffer */
317
317
  if (gpgme_data_seek(dh_plain, (off_t) 0, SEEK_SET) == -1){
318
 
    perror("gpgme_data_seek");
 
318
    perror("pgpme_data_seek");
319
319
    plaintext_length = -1;
320
320
    goto decrypt_end;
321
321
  }
451
451
  
452
452
  gnutls_certificate_free_credentials(mc->cred);
453
453
  gnutls_global_deinit();
454
 
  gnutls_dh_params_deinit(mc->dh_params);
455
454
  return -1;
456
455
}
457
456
 
831
830
                          .dh_bits = 1024, .priority = "SECURE256"
832
831
                          ":!CTYPE-X.509:+CTYPE-OPENPGP" };
833
832
    bool gnutls_initalized = false;
834
 
    bool gpgme_initalized = false;
 
833
    bool pgpme_initalized = false;
835
834
    
836
835
    {
837
836
      struct argp_option options[] = {
978
977
    }
979
978
    
980
979
    if(not init_gpgme(&mc, pubkey, seckey, tempdir)){
981
 
      fprintf(stderr, "gpgme_initalized failed\n");
 
980
      fprintf(stderr, "pgpme_initalized failed\n");
982
981
      exitcode = EXIT_FAILURE;
983
982
      goto end;
984
983
    } else {
985
 
      gpgme_initalized = true;
 
984
      pgpme_initalized = true;
986
985
    }
987
986
    
988
987
    if_index = (AvahiIfIndex) if_nametoindex(interface);
1099
1098
    if (gnutls_initalized){
1100
1099
      gnutls_certificate_free_credentials(mc.cred);
1101
1100
      gnutls_global_deinit ();
1102
 
      gnutls_dh_params_deinit(mc.dh_params);
1103
1101
    }
1104
1102
    
1105
 
    if(gpgme_initalized){
 
1103
    if(pgpme_initalized){
1106
1104
      gpgme_release(mc.ctx);
1107
1105
    }
1108
1106
    
1135
1133
            free(fullname);
1136
1134
          }
1137
1135
        }
1138
 
        closedir(d);
1139
1136
      }
1140
1137
      ret = rmdir(tempdir);
1141
1138
      if(ret == -1){