comparison freeDiameter/p_cnx.c @ 219:e5bcc8c9322e

Add hostname verification
author Sebastien Decugis <sdecugis@nict.go.jp>
date Fri, 19 Feb 2010 17:21:32 +0900
parents abd3c441780b
children 6418a188c1b5
comparison
equal deleted inserted replaced
218:113eb3d50ad9 219:e5bcc8c9322e
248 248
249 /* Now, we have an established connection in cnx */ 249 /* Now, we have an established connection in cnx */
250 250
251 pthread_cleanup_push((void *)fd_cnx_destroy, cnx); 251 pthread_cleanup_push((void *)fd_cnx_destroy, cnx);
252 252
253 /* Set the hostname in the connection, so that handshake verifies the remote identity */
254 fd_cnx_sethostname(cnx,peer->p_hdr.info.pi_diamid);
255
253 /* Handshake if needed (secure port) */ 256 /* Handshake if needed (secure port) */
254 if (nc->dotls) { 257 if (nc->dotls) {
255 CHECK_FCT_DO( fd_cnx_handshake(cnx, GNUTLS_CLIENT, peer->p_hdr.info.config.pic_priority, NULL), 258 CHECK_FCT_DO( fd_cnx_handshake(cnx, GNUTLS_CLIENT, peer->p_hdr.info.config.pic_priority, NULL),
256 { 259 {
257 /* Handshake failed ... */ 260 /* Handshake failed ... */
"Welcome to our mercurial repository"