Check for xrdp being terminated during SSL_accept BIO loop
This commit is contained in:
+7
-1
@@ -1026,7 +1026,8 @@ log_encrypted_file_unsupported(char *buf, int size, int rwflag, void *u)
|
||||
|
||||
int
|
||||
ssl_tls_accept(struct ssl_tls *self, long ssl_protocols,
|
||||
const char *tls_ciphers)
|
||||
const char *tls_ciphers,
|
||||
int (*is_term)(void))
|
||||
{
|
||||
int connection_status;
|
||||
long options = 0;
|
||||
@@ -1213,6 +1214,11 @@ ssl_tls_accept(struct ssl_tls *self, long ssl_protocols,
|
||||
g_sck_can_send(self->trans->sck, SSL_WANT_READ_WRITE_TIMEOUT);
|
||||
break;
|
||||
}
|
||||
|
||||
if (is_term != NULL && (*is_term)())
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
+2
-1
@@ -90,7 +90,8 @@ struct ssl_tls *
|
||||
ssl_tls_create(struct trans *trans, const char *key, const char *cert);
|
||||
int
|
||||
ssl_tls_accept(struct ssl_tls *self, long ssl_protocols,
|
||||
const char *tls_ciphers);
|
||||
const char *tls_ciphers,
|
||||
int (*is_term)(void));
|
||||
int
|
||||
ssl_tls_disconnect(struct ssl_tls *self);
|
||||
void
|
||||
|
||||
+2
-1
@@ -1053,7 +1053,8 @@ trans_set_tls_mode(struct trans *self, const char *key, const char *cert,
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (ssl_tls_accept(self->tls, ssl_protocols, tls_ciphers) != 0)
|
||||
if (ssl_tls_accept(self->tls, ssl_protocols,
|
||||
tls_ciphers, self->is_term) != 0)
|
||||
{
|
||||
LOG(LOG_LEVEL_ERROR, "trans_set_tls_mode: ssl_tls_accept failed");
|
||||
return 1;
|
||||
|
||||
@@ -674,6 +674,7 @@ xrdp_listen_init(struct xrdp_listen *self)
|
||||
}
|
||||
ltrans->trans_conn_in = xrdp_listen_conn_in;
|
||||
ltrans->callback_data = self;
|
||||
ltrans->is_term = g_is_term;
|
||||
list_add_item(self->trans_list, (intptr_t) ltrans);
|
||||
}
|
||||
return 0;
|
||||
|
||||
Reference in New Issue
Block a user