Using SSL defines instead of magic numbers.
@@ -151,7 +151,9 @@ static void transport_ssl_cb(SSL* ssl, int where, int ret)
if (where | SSL_CB_ALERT)
{
- if (ret == 561)
+ switch (ret)
+ {
+ case SSL3_AL_FATAL | SSL_AD_ACCESS_DENIED:
{
transport = (rdpTransport*) SSL_get_app_data(ssl);
@@ -160,7 +162,9 @@ static void transport_ssl_cb(SSL* ssl, int where, int ret)
freerdp_set_last_error(transport->context, FREERDP_ERROR_AUTHENTICATION_FAILED);
}
}
- else if (ret == 592)
+ break;
+
+ case SSL3_AL_FATAL | SSL_AD_INTERNAL_ERROR:
{
transport = (rdpTransport*) SSL_get_app_data(ssl);
@@ -182,6 +186,14 @@ static void transport_ssl_cb(SSL* ssl, int where, int ret)
if (!freerdp_get_last_error(transport->context))
freerdp_set_last_error(transport->context, kret);
}
+
+ break;
+
+ default:
+ WLog_WARN(TAG, "Unhandled SSL error (where=%d, ret=%d [%s, %s])", where, ret,
+ SSL_alert_type_string_long(ret), SSL_alert_desc_string_long(ret));
+ break;
+ }
}
}
}
