Merge pull request #2505 from bmiklautz/tls_shutdown

rename and update tls_disconnect
This commit is contained in:
Marc-André Moreau 2015-03-31 09:26:30 -04:00
commit ad6723835b
2 changed files with 3 additions and 10 deletions

View File

@ -90,7 +90,7 @@ struct rdp_tls
FREERDP_API int tls_connect(rdpTls* tls, BIO *underlying);
FREERDP_API BOOL tls_accept(rdpTls* tls, BIO *underlying, const char* cert_file, const char* privatekey_file);
FREERDP_API BOOL tls_disconnect(rdpTls* tls);
FREERDP_API BOOL tls_send_alert(rdpTls* tls);
FREERDP_API int tls_write_all(rdpTls* tls, const BYTE* data, int length);

View File

@ -709,7 +709,7 @@ int tls_do_handshake(rdpTls* tls, BOOL clientMode)
if (verify_status < 1)
{
WLog_ERR(TAG, "certificate not trusted, aborting.");
tls_disconnect(tls);
tls_send_alert(tls);
verify_status = 0;
}
}
@ -853,7 +853,7 @@ BOOL tls_accept(rdpTls* tls, BIO* underlying, const char* cert_file, const char*
return tls_do_handshake(tls, FALSE) > 0;
}
BOOL tls_disconnect(rdpTls* tls)
BOOL tls_send_alert(rdpTls* tls)
{
if (!tls)
return FALSE;
@ -884,14 +884,7 @@ BOOL tls_disconnect(rdpTls* tls)
if (tls->ssl->s3->wbuf.left == 0)
tls->ssl->method->ssl_dispatch_alert(tls->ssl);
SSL_shutdown(tls->ssl);
}
else
{
SSL_shutdown(tls->ssl);
}
return TRUE;
}