Skip to content
Snippets Groups Projects
Verified Commit f57cf735 authored by Petr Špaček's avatar Petr Špaček
Browse files

trust_anchors: do not bootstrap if root TA exists

Previously a typo in keyfile path triggered re-bootstrap even if root TA
was already installed.
parent 373b42ed
Tags
1 merge request!788daemon/lua/trust_anchors: don't crash when dealing with unknown algorhitm
......@@ -317,6 +317,11 @@ local function add_file(path, unmanaged)
-- Bootstrap if requested and keyfile doesn't exist
if managed and not io.open(path, 'r') then
if trust_anchors.keysets['\0'] then
error(string.format(
"[ ta ] keyfile '%s' doesn't exist and root key is already installed, "
.. "cannot bootstrap; provide a path to valid file with keys", path))
end
log("[ ta ] keyfile '%s': doesn't exist, bootstrapping", path);
local tas, msg = bootstrap(trust_anchors.bootstrap_url, trust_anchors.bootstrap_ca)
if not tas then
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment