Skip to content
Snippets Groups Projects
Commit 036612b0 authored by Adrien Béraud's avatar Adrien Béraud
Browse files

certstore: cleanup

Change-Id: Ic9bd9a2b570b334cd84652cae97c9a1ffe3350b5
parent b23278d2
No related branches found
No related tags found
No related merge requests found
......@@ -148,9 +148,7 @@ CertificateStore::getCertificate(const std::string& k)
{
auto getCertificate_ = [this](const std::string& k) -> std::shared_ptr<crypto::Certificate> {
auto cit = certs_.find(k);
if (cit == certs_.cend())
return {};
return cit->second;
return cit != certs_.cend() ? cit->second : std::shared_ptr<crypto::Certificate>{};
};
std::unique_lock<std::mutex> l(lock_);
auto crt = getCertificate_(k);
......@@ -633,7 +631,7 @@ TrustStore::getCertificateStatus(const std::string& cert_id) const
cert = cert->issuer? cert->issuer : certStore_.getCertificate(cert->getIssuerUID());
}
return allowed? PermissionStatus::ALLOWED : PermissionStatus::UNDEFINED;
return allowed ? PermissionStatus::ALLOWED : PermissionStatus::UNDEFINED;
}
std::vector<std::string>
......
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