/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-28 17:59:38 UTC
  • Revision ID: belorn@tower-20071028175938-26b85eaa85b84771
Working client and server and password system

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[512];
 
47
  char buffer[4096];
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
 
 
104
101
  //shutdown procedure
105
102
  close(sd);
106
103
 
131
128
      gnutls_perror (ret);
132
129
      return 1;
133
130
    }
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);
 
131
 
 
132
  //retrive password
 
133
  ret = gnutls_record_recv (session, buffer, sizeof(buffer));
 
134
 
 
135
  write(1,buffer,ret);
138
136
 
139
137
  //shutdown procedure
140
138
  gnutls_bye (session, GNUTLS_SHUT_RDWR);