Merge pull request #3823 from akallabeth/ssl_error_check_fix

Fixed SSL error checks in transport_ssl_cb
This commit is contained in:
David Fort 2017-03-01 11:21:41 +01:00 committed by GitHub
commit 5bb7a05026

View File

@ -154,13 +154,13 @@ out:
static void transport_ssl_cb(SSL* ssl, int where, int ret) static void transport_ssl_cb(SSL* ssl, int where, int ret)
{ {
if (where | SSL_CB_ALERT) if (where & SSL_CB_ALERT)
{ {
rdpTransport* transport = (rdpTransport*) SSL_get_app_data(ssl); rdpTransport* transport = (rdpTransport*) SSL_get_app_data(ssl);
switch (ret) switch (ret)
{ {
case SSL3_AL_FATAL | SSL_AD_ACCESS_DENIED: case (SSL3_AL_FATAL << 8) | SSL_AD_ACCESS_DENIED:
{ {
if (!freerdp_get_last_error(transport->context)) if (!freerdp_get_last_error(transport->context))
{ {
@ -169,7 +169,7 @@ static void transport_ssl_cb(SSL* ssl, int where, int ret)
} }
break; break;
case SSL3_AL_FATAL | SSL_AD_INTERNAL_ERROR: case (SSL3_AL_FATAL << 8) | SSL_AD_INTERNAL_ERROR:
{ {
if (transport->NlaMode) if (transport->NlaMode)
{ {
@ -193,6 +193,9 @@ static void transport_ssl_cb(SSL* ssl, int where, int ret)
break; break;
case (SSL3_AL_WARNING << 8) | SSL3_AD_CLOSE_NOTIFY:
break;
default: default:
WLog_Print(transport->log, WLOG_WARN, "Unhandled SSL error (where=%d, ret=%d [%s, %s])", where, ret, WLog_Print(transport->log, WLOG_WARN, "Unhandled SSL error (where=%d, ret=%d [%s, %s])", where, ret,
SSL_alert_type_string_long(ret), SSL_alert_desc_string_long(ret)); SSL_alert_type_string_long(ret), SSL_alert_desc_string_long(ret));