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

  • Committer: Teddy Hogeborn
  • Date: 2008-08-10 03:32:42 UTC
  • Revision ID: teddy@fukt.bsnet.se-20080810033242-ea0qikoxqik0nibr
* mandos-client.c (main): Cast pid_t to unsigned int before printing.

* plugins.d/password-request.c (pgp_packet_decrypt): Use "%u" to print
                                                     wrong_key_usage.
  (start_mandos_communication): Use PRIu16 to print uint16_t.

Show diffs side-by-side

added added

removed removed

Lines of Context:
50
50
                                   sockaddr_in6, PF_INET6,
51
51
                                   SOCK_STREAM, INET6_ADDRSTRLEN,
52
52
                                   uid_t, gid_t */
 
53
#include <inttypes.h>           /* PRIu16 */
53
54
#include <sys/socket.h>         /* socket(), struct sockaddr_in6,
54
55
                                   struct in6_addr, inet_pton(),
55
56
                                   connect() */
100
101
bool debug = false;
101
102
static const char *keydir = "/conf/conf.d/mandos";
102
103
static const char mandos_protocol_version[] = "1";
103
 
const char *argp_program_version = "mandosclient 0.9";
 
104
const char *argp_program_version = "password-request 1.0";
104
105
const char *argp_program_bug_address = "<mandos@fukt.bsnet.se>";
105
106
 
106
107
/* Used for passing in values through the Avahi callback functions */
228
229
    } else {
229
230
      fprintf(stderr, "Unsupported algorithm: %s\n",
230
231
              result->unsupported_algorithm);
231
 
      fprintf(stderr, "Wrong key usage: %d\n",
 
232
      fprintf(stderr, "Wrong key usage: %u\n",
232
233
              result->wrong_key_usage);
233
234
      if(result->file_name != NULL){
234
235
        fprintf(stderr, "File name: %s\n", result->file_name);
455
456
  }
456
457
  
457
458
  if(debug){
458
 
    fprintf(stderr, "Setting up a tcp connection to %s, port %d\n",
459
 
            ip, port);
 
459
    fprintf(stderr, "Setting up a tcp connection to %s, port %" PRIu16
 
460
            "\n", ip, port);
460
461
  }
461
462
  
462
463
  tcp_sd = socket(PF_INET6, SOCK_STREAM, 0);
491
492
  to.in6.sin6_scope_id = (uint32_t)if_index;
492
493
  
493
494
  if(debug){
494
 
    fprintf(stderr, "Connection to: %s, port %d\n", ip, port);
 
495
    fprintf(stderr, "Connection to: %s, port %" PRIu16 "\n", ip,
 
496
            port);
495
497
    char addrstr[INET6_ADDRSTRLEN] = "";
496
498
    if(inet_ntop(to.in6.sin6_family, &(to.in6.sin6_addr), addrstr,
497
499
                 sizeof(addrstr)) == NULL){
676
678
      char ip[AVAHI_ADDRESS_STR_MAX];
677
679
      avahi_address_snprint(ip, sizeof(ip), address);
678
680
      if(debug){
679
 
        fprintf(stderr, "Mandos server \"%s\" found on %s (%s, %d) on"
680
 
                " port %d\n", name, host_name, ip, interface, port);
 
681
        fprintf(stderr, "Mandos server \"%s\" found on %s (%s, %"
 
682
                PRIu16 ") on port %d\n", name, host_name, ip,
 
683
                interface, port);
681
684
      }
682
685
      int ret = start_mandos_communication(ip, port, interface, mc);
683
686
      if (ret == 0){