/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: Björn Påhlsson
  • Date: 2007-10-20 21:38:25 UTC
  • Revision ID: belorn@tower-20071020213825-abf6f0d1c33ee961
First working version with: IPv6, GnuTLS, X.509 certificates, DN
retrieval.

Show diffs side-by-side

added added

removed removed

Lines of Context:
44
44
 
45
45
int main (){
46
46
  int sd, ret;
47
 
  char buffer[4096];
 
47
  char buffer[512];
48
48
  struct sockaddr_in6 to;
49
49
  struct sockaddr_in6 from;
50
50
  gnutls_session_t session;
98
98
    }
99
99
  }
100
100
 
 
101
  write(1,buffer,ret);
 
102
  write(1,"\n",1);
 
103
 
101
104
  //shutdown procedure
102
105
  close(sd);
103
106
 
128
131
      gnutls_perror (ret);
129
132
      return 1;
130
133
    }
131
 
 
132
 
  //retrive password
133
 
  ret = gnutls_record_recv (session, buffer, sizeof(buffer));
134
 
 
135
 
  write(1,buffer,ret);
 
134
  printf ("- Handshake was completed\n");
 
135
 
 
136
  //message to be seent
 
137
  gnutls_record_send (session, "The secret message is \"squeamish ossifrage\"\n", 44);
136
138
 
137
139
  //shutdown procedure
138
140
  gnutls_bye (session, GNUTLS_SHUT_RDWR);