Skip to content
Snippets Groups Projects
Commit 6b2ae528 authored by Eelco Dolstra's avatar Eelco Dolstra
Browse files

Use secret-key-files for verifying

parent e39999ed
No related branches found
No related tags found
No related merge requests found
......@@ -102,11 +102,24 @@ bool verifyDetached(const std::string & data, const std::string & sig,
PublicKeys getDefaultPublicKeys()
{
PublicKeys publicKeys;
// FIXME: filter duplicates
for (auto s : settings.get("binary-cache-public-keys", Strings())) {
PublicKey key(s);
publicKeys.emplace(key.name, key);
// FIXME: filter duplicates
}
for (auto secretKeyFile : settings.get("secret-key-files", Strings())) {
try {
SecretKey secretKey(readFile(secretKeyFile));
publicKeys.emplace(secretKey.name, secretKey.toPublicKey());
} catch (SysError & e) {
/* Ignore unreadable key files. That's normal in a
multi-user installation. */
}
}
return publicKeys;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment