fix blocking issues. Full TLS over TLS.
This commit is contained in:
parent
cefcac3414
commit
426dc2cf84
@ -79,7 +79,7 @@ BOOL transport_disconnect(rdpTransport* transport)
|
|||||||
if (transport->layer == TRANSPORT_LAYER_TLS)
|
if (transport->layer == TRANSPORT_LAYER_TLS)
|
||||||
status &= tls_disconnect(transport->TlsIn);
|
status &= tls_disconnect(transport->TlsIn);
|
||||||
|
|
||||||
if (transport->layer == TRANSPORT_LAYER_TSG)
|
if (transport->layer == TRANSPORT_LAYER_TSG || transport->layer == TRANSPORT_LAYER_TSG_TLS)
|
||||||
{
|
{
|
||||||
tsg_disconnect(transport->tsg);
|
tsg_disconnect(transport->tsg);
|
||||||
}
|
}
|
||||||
@ -119,11 +119,15 @@ static int transport_bio_tsg_write(BIO* bio, const char* buf, int num)
|
|||||||
int status;
|
int status;
|
||||||
rdpTsg* tsg;
|
rdpTsg* tsg;
|
||||||
|
|
||||||
|
LWD("len %d", num);
|
||||||
|
|
||||||
/* printf("transport_bio_tsg_write: %d\n", num); */
|
/* printf("transport_bio_tsg_write: %d\n", num); */
|
||||||
|
|
||||||
tsg = (rdpTsg*) bio->ptr;
|
tsg = (rdpTsg*) bio->ptr;
|
||||||
status = tsg_write(tsg, (BYTE*) buf, num);
|
status = tsg_write(tsg, (BYTE*) buf, num);
|
||||||
|
|
||||||
|
LWD("status %d", status);
|
||||||
|
|
||||||
/* printf("tsg_write: %d\n", status); */
|
/* printf("tsg_write: %d\n", status); */
|
||||||
|
|
||||||
BIO_clear_retry_flags(bio);
|
BIO_clear_retry_flags(bio);
|
||||||
@ -141,11 +145,15 @@ static int transport_bio_tsg_read(BIO* bio, char* buf, int size)
|
|||||||
int status;
|
int status;
|
||||||
rdpTsg* tsg;
|
rdpTsg* tsg;
|
||||||
|
|
||||||
|
LWD("len %d", size);
|
||||||
|
|
||||||
/* printf("transport_bio_tsg_read: %d\n", size); */
|
/* printf("transport_bio_tsg_read: %d\n", size); */
|
||||||
|
|
||||||
tsg = (rdpTsg*) bio->ptr;
|
tsg = (rdpTsg*) bio->ptr;
|
||||||
status = tsg_read(bio->ptr, (BYTE*) buf, size);
|
status = tsg_read(bio->ptr, (BYTE*) buf, size);
|
||||||
|
|
||||||
|
LWD("status %d", status);
|
||||||
|
|
||||||
/* printf("tsg_read: %d\n", status); */
|
/* printf("tsg_read: %d\n", status); */
|
||||||
|
|
||||||
BIO_clear_retry_flags(bio);
|
BIO_clear_retry_flags(bio);
|
||||||
@ -155,7 +163,7 @@ static int transport_bio_tsg_read(BIO* bio, char* buf, int size)
|
|||||||
BIO_set_retry_read(bio);
|
BIO_set_retry_read(bio);
|
||||||
}
|
}
|
||||||
|
|
||||||
return status;
|
return status > 0 ? status : -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int transport_bio_tsg_puts(BIO* bio, const char* str)
|
static int transport_bio_tsg_puts(BIO* bio, const char* str)
|
||||||
@ -281,7 +289,7 @@ BOOL transport_connect_nla(rdpTransport* transport)
|
|||||||
freerdp* instance;
|
freerdp* instance;
|
||||||
rdpSettings* settings;
|
rdpSettings* settings;
|
||||||
|
|
||||||
if (transport->layer == TRANSPORT_LAYER_TSG)
|
if (transport->layer == TRANSPORT_LAYER_TSG || transport->layer == TRANSPORT_LAYER_TSG_TLS)
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
||||||
if (!transport_connect_tls(transport))
|
if (!transport_connect_tls(transport))
|
||||||
@ -568,9 +576,11 @@ int transport_read_layer(rdpTransport* transport, UINT8* data, int bytes)
|
|||||||
else if (transport->layer == TRANSPORT_LAYER_TSG)
|
else if (transport->layer == TRANSPORT_LAYER_TSG)
|
||||||
status = tsg_read(transport->tsg, data + read, bytes - read);
|
status = tsg_read(transport->tsg, data + read, bytes - read);
|
||||||
else if (transport->layer == TRANSPORT_LAYER_TSG_TLS) {
|
else if (transport->layer == TRANSPORT_LAYER_TSG_TLS) {
|
||||||
|
/*
|
||||||
LWD("TlsIn SSL pending %d want %s", SSL_pending(transport->TlsIn->ssl), want(transport->TlsIn));
|
LWD("TlsIn SSL pending %d want %s", SSL_pending(transport->TlsIn->ssl), want(transport->TlsIn));
|
||||||
LWD("TlsOut SSL pending %d want %s", SSL_pending(transport->TlsOut->ssl), want(transport->TlsOut));
|
LWD("TlsOut SSL pending %d want %s", SSL_pending(transport->TlsOut->ssl), want(transport->TlsOut));
|
||||||
LWD("TsgTls SSL pending %d want %s", SSL_pending(transport->TsgTls->ssl), want(transport->TsgTls));
|
LWD("TsgTls SSL pending %d want %s", SSL_pending(transport->TsgTls->ssl), want(transport->TlsIn));
|
||||||
|
*/
|
||||||
status = tls_read(transport->TsgTls, data + read, bytes - read);
|
status = tls_read(transport->TsgTls, data + read, bytes - read);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -998,7 +1008,7 @@ BOOL transport_set_blocking_mode(rdpTransport* transport, BOOL blocking)
|
|||||||
status &= tcp_set_blocking_mode(transport->TcpIn, blocking);
|
status &= tcp_set_blocking_mode(transport->TcpIn, blocking);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (transport->layer == TRANSPORT_LAYER_TSG)
|
if (transport->layer == TRANSPORT_LAYER_TSG || transport->layer == TRANSPORT_LAYER_TSG_TLS)
|
||||||
{
|
{
|
||||||
tsg_set_blocking_mode(transport->tsg, blocking);
|
tsg_set_blocking_mode(transport->tsg, blocking);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user