mirror of
https://github.com/zerotier/ZeroTierOne.git
synced 2025-06-06 20:43:44 +02:00
Default to built-in root topology if signature check fails (instead of exiting)
This commit is contained in:
parent
f281886bfd
commit
715afc0314
1 changed files with 7 additions and 3 deletions
|
@ -552,9 +552,13 @@ Node::ReasonForTermination Node::run()
|
||||||
rootTopology = ZT_DEFAULTS.defaultRootTopology;
|
rootTopology = ZT_DEFAULTS.defaultRootTopology;
|
||||||
try {
|
try {
|
||||||
Dictionary rt(rootTopology);
|
Dictionary rt(rootTopology);
|
||||||
if (!Topology::authenticateRootTopology(rt))
|
if (Topology::authenticateRootTopology(rt)) {
|
||||||
return impl->terminateBecause(Node::NODE_UNRECOVERABLE_ERROR,"root-topology failed signature verification check");
|
|
||||||
_r->topology->setSupernodes(Dictionary(rt.get("supernodes")));
|
_r->topology->setSupernodes(Dictionary(rt.get("supernodes")));
|
||||||
|
} else {
|
||||||
|
LOG("%s failed signature check, using built-in defaults instead",rootTopologyPath.c_str());
|
||||||
|
Utils::rm(rootTopologyPath.c_str());
|
||||||
|
_r->topology->setSupernodes(Dictionary(Dictionary(ZT_DEFAULTS.defaultRootTopology).get("supernodes")));
|
||||||
|
}
|
||||||
} catch ( ... ) {
|
} catch ( ... ) {
|
||||||
return impl->terminateBecause(Node::NODE_UNRECOVERABLE_ERROR,"invalid root-topology format");
|
return impl->terminateBecause(Node::NODE_UNRECOVERABLE_ERROR,"invalid root-topology format");
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue