if (!msg->showMsgBox(UserMsgBox::M_YESNO,
"Unknown certificate issuer",
text.c_str()))
- throw AuthFailureException("Unknown certificate issuer");
+ throw AuthCancelledException();
status &= ~(GNUTLS_CERT_INVALID |
GNUTLS_CERT_SIGNER_NOT_FOUND |
if (!msg->showMsgBox(UserMsgBox::M_YESNO,
"Certificate is not yet valid",
text.c_str()))
- throw AuthFailureException("Certificate is not yet valid");
+ throw AuthCancelledException();
status &= ~GNUTLS_CERT_NOT_ACTIVATED;
}
if (!msg->showMsgBox(UserMsgBox::M_YESNO,
"Expired certificate",
text.c_str()))
- throw AuthFailureException("Expired certificate");
+ throw AuthCancelledException();
status &= ~GNUTLS_CERT_EXPIRED;
}
if (!msg->showMsgBox(UserMsgBox::M_YESNO,
"Insecure certificate algorithm",
text.c_str()))
- throw AuthFailureException("Insecure certificate algorithm");
+ throw AuthCancelledException();
status &= ~GNUTLS_CERT_INSECURE_ALGORITHM;
}
if (!msg->showMsgBox(UserMsgBox::M_YESNO,
"Certificate hostname mismatch",
text.c_str()))
- throw AuthFailureException("Certificate hostname mismatch");
+ throw AuthCancelledException();
}
} else if (err == GNUTLS_E_CERTIFICATE_KEY_MISMATCH) {
std::string text;
if (!msg->showMsgBox(UserMsgBox::M_YESNO,
"Unexpected server certificate",
text.c_str()))
- throw AuthFailureException("Unexpected server certificate");
+ throw AuthCancelledException();
status &= ~(GNUTLS_CERT_INVALID |
GNUTLS_CERT_SIGNER_NOT_FOUND |
if (!msg->showMsgBox(UserMsgBox::M_YESNO,
"Unexpected server certificate",
text.c_str()))
- throw AuthFailureException("Unexpected server certificate");
+ throw AuthCancelledException();
status &= ~GNUTLS_CERT_NOT_ACTIVATED;
}
if (!msg->showMsgBox(UserMsgBox::M_YESNO,
"Unexpected server certificate",
text.c_str()))
- throw AuthFailureException("Unexpected server certificate");
+ throw AuthCancelledException();
status &= ~GNUTLS_CERT_EXPIRED;
}
if (!msg->showMsgBox(UserMsgBox::M_YESNO,
"Unexpected server certificate",
text.c_str()))
- throw AuthFailureException("Unexpected server certificate");
+ throw AuthCancelledException();
status &= ~GNUTLS_CERT_INSECURE_ALGORITHM;
}
if (!msg->showMsgBox(UserMsgBox::M_YESNO,
"Unexpected server certificate",
text.c_str()))
- throw AuthFailureException("Unexpected server certificate");
+ throw AuthCancelledException();
}
}
#include <rfb/CMsgWriter.h>
#include <rfb/CSecurity.h>
+#include <rfb/Exception.h>
#include <rfb/Hostname.h>
#include <rfb/LogWriter.h>
#include <rfb/Security.h>
} else {
disconnect();
}
+ } catch (rfb::AuthCancelledException& e) {
+ vlog.info("%s", e.str());
+ disconnect();
} catch (rdr::Exception& e) {
vlog.error("%s", e.str());
abort_connection_with_unexpected_error(e);