Skip to content
Snippets Groups Projects
Unverified Commit dd7c1e1c authored by Sébastien Blin's avatar Sébastien Blin
Browse files

certstore: only check first id to avoid removing certificates

Change-Id: Icc2baab0a6a52cbfee9b975187294c70477b5de0
GitLab: #579
parent 1f82d818
No related branches found
No related tags found
No related merge requests found
...@@ -68,11 +68,13 @@ CertificateStore::loadLocalCertificates() ...@@ -68,11 +68,13 @@ CertificateStore::loadLocalCertificates()
try { try {
auto crt = std::make_shared<crypto::Certificate>( auto crt = std::make_shared<crypto::Certificate>(
fileutils::loadFile(certPath_ + DIR_SEPARATOR_CH + f)); fileutils::loadFile(certPath_ + DIR_SEPARATOR_CH + f));
while (crt) {
auto id = crt->getId().toString(); auto id = crt->getId().toString();
auto longId = crt->getLongId().toString(); auto longId = crt->getLongId().toString();
if (id != f && longId != f) if (id != f && longId != f)
throw std::logic_error("Certificate id mismatch"); throw std::logic_error("Certificate id mismatch");
while (crt) {
id = crt->getId().toString();
longId = crt->getLongId().toString();
certs_.emplace(std::move(id), crt); certs_.emplace(std::move(id), crt);
certs_.emplace(std::move(longId), crt); certs_.emplace(std::move(longId), crt);
loadRevocations(*crt); loadRevocations(*crt);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment