SecurityManager.known(): check all files, fixes #4614

Before this fix, because known() only checked the key-type file, the
location file could go missing without being automatically regenerated.

Now a save() is triggered if not all files are present.
This commit is contained in:
Thomas Waldmann 2019-06-25 23:15:13 +02:00
parent 52c6b92598
commit c68cad9727
1 changed files with 2 additions and 1 deletions

View File

@ -73,7 +73,8 @@ class SecurityManager:
shutil.rmtree(path)
def known(self):
return os.path.exists(self.key_type_file)
return all(os.path.exists(f)
for f in (self.key_type_file, self.location_file, self.manifest_ts_file))
def key_matches(self, key):
if not self.known():