/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 client.cpp

  • Committer: Teddy Hogeborn
  • Date: 2008-06-30 01:43:39 UTC
  • Revision ID: teddy@fukt.bsnet.se-20080630014339-rsuztydpl2w5ml83
* server.py: Rewritten to use Zeroconf (mDNS/DNS-SD) in place of the
             old broadcast-UDP-to-port-49001 method.

Show diffs side-by-side

added added

removed removed

Lines of Context:
21
21
 
22
22
#define SOCKET_ERR(err,s) if(err<0) {perror(s); status = 1; goto quit;}
23
23
#define PORT 49001
24
 
#define CERTFILE "/conf/conf.d/cryptkeyreq/client-cert.pem"
25
 
#define KEYFILE "/conf/conf.d/cryptkeyreq/client-key.pem"
26
 
#define CAFILE "/conf/conf.d/cryptkeyreq/ca.pem"
 
24
 
 
25
#ifndef CERT_ROOT
 
26
#define CERT_ROOT "/conf/conf.d/cryptkeyreq/"
 
27
#endif
 
28
#define CERTFILE CERT_ROOT "client-cert.pem"
 
29
#define KEYFILE CERT_ROOT "client-key.pem"
 
30
#define CAFILE CERT_ROOT "ca.pem"
27
31
 
28
32
gnutls_certificate_credentials_t x509_cred;
29
33
 
62
66
 
63
67
  struct termios t_old, t_new;
64
68
  int status = 0;
65
 
 
 
69
  
 
70
  if (tcgetattr (STDIN_FILENO, &t_old) != 0){
 
71
    return 1;
 
72
  }
 
73
  
66
74
  session = initgnutls ();
67
75
 
68
76
#ifdef DEBUG
106
114
  FD_ZERO(&rfds_orig);
107
115
  FD_SET(udp_sd, &rfds_orig);
108
116
  FD_SET(STDIN_FILENO, &rfds_orig);
109
 
 
110
 
 
111
 
  if (tcgetattr (STDIN_FILENO, &t_old) != 0){
112
 
    return 1;
113
 
  }
 
117
  
114
118
  t_new = t_old;
115
119
  t_new.c_lflag &= ~ECHO;
116
120
  if (tcsetattr (STDIN_FILENO, TCSAFLUSH, &t_new) != 0){