cc_config_owned = false;
}
}
- else
+ else if (reason)
{
- if (reason)
- {
- msg(D_MULTI_LOW, "MULTI: connection rejected: %s, CLI:%s", reason, np(client_reason));
- }
- if (!is_cas_pending(mi->context.c2.context_auth))
- {
- send_auth_failed(&mi->context, client_reason); /* mid-session reauth failed */
- multi_schedule_context_wakeup(m, mi);
- }
+ msg(D_MULTI_LOW, "MULTI: connection rejected: %s, CLI:%s", reason, np(client_reason));
}
}
}
/* at least one key is enabled for decryption */
int active = 0;
+ /* at least one key already failed authentication */
+ bool failed_auth = false;
+
if (latency && multi->tas_last + latency >= now)
{
return TLS_AUTHENTICATION_UNDEFINED;
if (TLS_AUTHENTICATED(multi, ks))
{
active++;
- if (ks->authenticated > KS_AUTH_FALSE)
+ if (ks->authenticated == KS_AUTH_FALSE)
+ {
+ failed_auth = true;
+ }
+ else
{
unsigned int s1 = ACF_DISABLED;
unsigned int s2 = ACF_DISABLED;
if (s1 == ACF_FAILED || s2 == ACF_FAILED)
{
ks->authenticated = KS_AUTH_FALSE;
+ failed_auth = true;
}
else if (s1 == ACF_UNDEFINED || s2 == ACF_UNDEFINED)
{
}
#if 0
- dmsg(D_TLS_ERRORS, "TAS: a=%d s=%d d=%d", active, success, deferred);
+ dmsg(D_TLS_ERRORS, "TAS: a=%d s=%d d=%d f=%d", active, success, deferred, failed_auth);
#endif
-
- if (success)
+ if (failed_auth)
+ {
+ /* We have at least one session that failed authentication. There
+ * might be still another session with valid keys.
+ * Although our protocol allows keeping the VPN session alive
+ * with the other session (and we actually did that in earlier
+ * version, this behaviour is really strange from a user (admin)
+ * experience */
+ return TLS_AUTHENTICATION_FAILED;
+ }
+ else if (success)
{
return TLS_AUTHENTICATION_SUCCEEDED;
}