mirror of
https://github.com/oxen-io/oxen-core.git
synced 2023-12-14 02:22:56 +01:00
Warn and refuse to submit proofs if we detect duplicate ed/x25519 keys (#1121)
This commit is contained in:
parent
cb4dde8b0c
commit
8dc42c1a97
|
@ -2060,6 +2060,15 @@ namespace cryptonote
|
|||
if ((uint64_t) std::time(nullptr) < next_proof_time)
|
||||
return;
|
||||
|
||||
auto pubkey = m_service_node_list.get_pubkey_from_x25519(m_service_node_keys->pub_x25519);
|
||||
if (pubkey != crypto::null_pkey && pubkey != m_service_node_keys->pub)
|
||||
{
|
||||
MGINFO_RED(
|
||||
"Failed to submit uptime proof: another service node on the network is using the same ed/x25519 keys as "
|
||||
"this service node. This typically means both have the same 'key_ed25519' private key file.");
|
||||
return;
|
||||
}
|
||||
|
||||
if (!check_external_ping(m_last_storage_server_ping, STORAGE_SERVER_PING_LIFETIME, "the storage server"))
|
||||
{
|
||||
MGINFO_RED(
|
||||
|
|
|
@ -2066,6 +2066,10 @@ namespace service_nodes
|
|||
{
|
||||
my_uptime_proof_confirmation = false;
|
||||
LOG_PRINT_L2("Accepted uptime proof from " << proof.pubkey);
|
||||
|
||||
if (m_service_node_keys && proof.pubkey_ed25519 == m_service_node_keys->pub_ed25519)
|
||||
MGINFO_RED("Uptime proof from SN " << proof.pubkey << " is not us, but is using our ed/x25519 keys; "
|
||||
"this is likely to lead to deregistration of one or both service nodes.");
|
||||
}
|
||||
|
||||
auto old_x25519 = iproof.pubkey_x25519;
|
||||
|
|
Loading…
Reference in a new issue