Lines Matching refs:client

90   rfbClient *client = (rfbClient*)transport;  in PushTLS()  local
95 ret = write(client->sock, data, len); in PushTLS()
112 rfbClient *client = (rfbClient*)transport; in PullTLS() local
117 ret = read(client->sock, data, len); in PullTLS()
131 InitializeTLSSession(rfbClient* client, rfbBool anonTLS) in InitializeTLSSession() argument
136 if (client->tlsSession) return TRUE; in InitializeTLSSession()
138 if ((ret = gnutls_init((gnutls_session_t*)&client->tlsSession, GNUTLS_CLIENT)) < 0) in InitializeTLSSession()
144 if ((ret = gnutls_priority_set_direct((gnutls_session_t)client->tlsSession, in InitializeTLSSession()
150 gnutls_transport_set_ptr((gnutls_session_t)client->tlsSession, (gnutls_transport_ptr_t)client); in InitializeTLSSession()
151 gnutls_transport_set_push_function((gnutls_session_t)client->tlsSession, PushTLS); in InitializeTLSSession()
152 gnutls_transport_set_pull_function((gnutls_session_t)client->tlsSession, PullTLS); in InitializeTLSSession()
160 SetTLSAnonCredential(rfbClient* client) in SetTLSAnonCredential() argument
166 …(ret = gnutls_credentials_set((gnutls_session_t)client->tlsSession, GNUTLS_CRD_ANON, anonCred)) < … in SetTLSAnonCredential()
168 FreeTLS(client); in SetTLSAnonCredential()
177 HandshakeTLS(rfbClient* client) in HandshakeTLS() argument
182 while (timeout > 0 && (ret = gnutls_handshake((gnutls_session_t)client->tlsSession)) < 0) in HandshakeTLS()
192 FreeTLS(client); in HandshakeTLS()
199 FreeTLS(client); in HandshakeTLS()
209 ReadVeNCryptSecurityType(rfbClient* client, uint32_t *result) in ReadVeNCryptSecurityType() argument
218 if (!ReadFromRFBServer(client, (char *)&count, 1)) return FALSE; in ReadVeNCryptSecurityType()
237 if (!ReadFromRFBServer(client, (char *)&tAuth[loop], 4)) return FALSE; in ReadVeNCryptSecurityType()
252 if (!WriteToRFBServer(client, (char *)&tAuth[loop], 4)) return FALSE; in ReadVeNCryptSecurityType()
340 HandleAnonTLSAuth(rfbClient* client) in HandleAnonTLSAuth() argument
342 if (!InitializeTLS() || !InitializeTLSSession(client, TRUE)) return FALSE; in HandleAnonTLSAuth()
344 if (!SetTLSAnonCredential(client)) return FALSE; in HandleAnonTLSAuth()
346 if (!HandshakeTLS(client)) return FALSE; in HandleAnonTLSAuth()
352 HandleVeNCryptAuth(rfbClient* client) in HandleVeNCryptAuth() argument
363 if (!ReadFromRFBServer(client, (char *)&major, 1) || in HandleVeNCryptAuth()
364 !ReadFromRFBServer(client, (char *)&minor, 1)) in HandleVeNCryptAuth()
376 if (!WriteToRFBServer(client, (char *)&major, 1) || in HandleVeNCryptAuth()
377 !WriteToRFBServer(client, (char *)&minor, 1) || in HandleVeNCryptAuth()
378 !ReadFromRFBServer(client, (char *)&status, 1)) in HandleVeNCryptAuth()
389 if (!ReadVeNCryptSecurityType(client, &authScheme)) return FALSE; in HandleVeNCryptAuth()
390 if (!ReadFromRFBServer(client, (char *)&status, 1) || status != 1) in HandleVeNCryptAuth()
395 client->subAuthScheme = authScheme; in HandleVeNCryptAuth()
415 if (!client->GetCredential) in HandleVeNCryptAuth()
420 cred = client->GetCredential(client, rfbCredentialTypeX509); in HandleVeNCryptAuth()
433 if (!InitializeTLSSession(client, anonTLS)) return FALSE; in HandleVeNCryptAuth()
437 if (!SetTLSAnonCredential(client)) return FALSE; in HandleVeNCryptAuth()
441 …if ((ret = gnutls_credentials_set((gnutls_session_t)client->tlsSession, GNUTLS_CRD_CERTIFICATE, x5… in HandleVeNCryptAuth()
444 FreeTLS(client); in HandleVeNCryptAuth()
449 if (!HandshakeTLS(client)) return FALSE; in HandleVeNCryptAuth()
460 ReadFromTLS(rfbClient* client, char *out, unsigned int n) in ReadFromTLS() argument
464 ret = gnutls_record_recv((gnutls_session_t)client->tlsSession, out, n); in ReadFromTLS()
478 WriteToTLS(rfbClient* client, char *buf, unsigned int n) in WriteToTLS() argument
485 ret = gnutls_record_send((gnutls_session_t)client->tlsSession, buf+offset, (size_t)(n-offset)); in WriteToTLS()
498 void FreeTLS(rfbClient* client) in FreeTLS() argument
500 if (client->tlsSession) in FreeTLS()
502 gnutls_deinit((gnutls_session_t)client->tlsSession); in FreeTLS()
503 client->tlsSession = NULL; in FreeTLS()