Permalink
Browse files

don't load fingerprint twice from config

  • Loading branch information...
abma committed Sep 9, 2018
1 parent f71b04f commit a85462b9c0a3cc17bb1bf50004d86e8b4abf2e1d
Showing with 4 additions and 6 deletions.
  1. +1 −1 src/inetclass.h
  2. +1 −2 src/socket.cpp
  3. +1 −2 src/tasserver.cpp
  4. +1 −1 src/tasserver.h
@@ -34,7 +34,7 @@ class iNetClass
{
}

virtual void OnInvalidFingerprintReceived(const std::string& /*fingerprint*/)
virtual void OnInvalidFingerprintReceived(const std::string& /*fingerprint*/, const std::string& /*expected_fingerprint*/)
{
}
};
@@ -203,9 +203,8 @@ bool Socket::VerifyCertificate()
const char* name = SSL_get_cipher_name(m_ssl);
wxLogMessage("Using cipher %s", name);

//FIXME: read from config and prompt when missmatch / doesn't exist
if (fingerprint != m_excepted_fingerprint) {
m_net_class.OnInvalidFingerprintReceived(fingerprint);
m_net_class.OnInvalidFingerprintReceived(fingerprint, m_excepted_fingerprint);
return false;
}

@@ -2076,9 +2076,8 @@ bool TASServer::IsCurrentBattle(int battle_id)
return true;
}

void TASServer::OnInvalidFingerprintReceived(const std::string& fingerprint)
void TASServer::OnInvalidFingerprintReceived(const std::string& fingerprint, const std::string& expected_fingerprint)
{
const std::string expected_fingerprint = sett().GetServerFingerprint(GetServerName());
m_se->OnInvalidFingerprintReceived(fingerprint, expected_fingerprint);
}

@@ -143,7 +143,7 @@ class TASServer : public IServer, public iNetClass, public wxTimer
void OnDisconnected(wxSocketError err) override;
void OnDataReceived() override;
void OnError(const std::string& err) override;
void OnInvalidFingerprintReceived(const std::string& fingerprint) override;
void OnInvalidFingerprintReceived(const std::string& fingerprint, const std::string& expected_fingerprint) override;

void UDPPing(); /// used for nat travelsal
/// generic udp "ping" function

0 comments on commit a85462b

Please sign in to comment.