Exemplo n.º 1
0
void alert_cb (buffers_t* buffers, Botan::TLS::Alert const& alert, const unsigned char a[], size_t sz) 
{
    TRACE("BOTAN WAS TO DELIVER ALERT: %s \n", alert.type_string().c_str());
    // TODO: find something better to do here
    buffers->alert_produced = true;
    buffers->which_alert = (int)alert.type();
    if ( alert.type() == Botan::TLS::Alert::CLOSE_NOTIFY)
    {
        TRACE("PeerASKED to close TLS transport\n");
        buffers -> peer_closed_transport = true;
    }
    else if (alert.is_valid() && alert.is_fatal() )
    {
        if ( alert.type() == Botan::TLS::Alert::DECRYPT_ERROR )
        {
            std::cout << "TLS Layer issue: Decrypt error. Probable cause: " ;
            std::cout << "the private key and the certificate don't match." ;
        } else
        {
            std::cout << "TLS Layer issue: " ;
            std::cout << alert.type_string() << std::endl;
        }
        buffers->alert_is_fatal = true;
        TRACE("TLS alert is fatal!!\n");
    } else {
        std::cout << alert.type_string() << std::endl;
        TRACE("Non-fatal alert!!\n");
    }
}
Exemplo n.º 2
0
void MumbleClient::OnAlert(Botan::TLS::Alert alert, const uint8_t[], size_t)
{
	trace("[mumble] TLS alert: %s\n", alert.type_string().c_str());

	if (alert.is_fatal())
	{
		closesocket(m_socket);

		m_connectionInfo.isConnected = false;
	}
}
Exemplo n.º 3
0
 void alert_received(Botan::TLS::Alert alert, const uint8_t[], size_t)
    {
    std::cout << "Alert: " << alert.type_string() << std::endl;
    }
Exemplo n.º 4
0
void SecureSocket::alert(Botan::TLS::Alert alert, const Botan::byte *data, size_t length)
{
    cout << alert.type_string() << endl << flush;
}