Commit 4fed5df2 authored by Adrien Béraud's avatar Adrien Béraud

ringaccount: handle missing CA but present CA key

Change-Id: I5d79ecc58bf4ea155e421e7bf4e12d9364fbaca1
parent ad63b452
......@@ -1391,14 +1391,12 @@ RingAccount::updateCertificates(ArchiveContent& archive, dht::crypto::Identity&
// Currently set the CA flag and update expiration dates
bool updated = false;
// Update CA if possible and relevant
auto& cert = archive.id.second;
auto ca = cert->issuer;
if (ca and not ca->issuer) {
if (not ca->isCA() or ca->getExpiration() < clock::now()) {
ca = std::make_shared<Certificate>(Certificate::generate(*archive.ca_key, "Ring CA", {}, true));
updated = true;
}
// Update CA if possible and relevant
if (not ca or (not ca->issuer and (not ca->isCA() or ca->getExpiration() < clock::now()))) {
ca = std::make_shared<Certificate>(Certificate::generate(*archive.ca_key, "Ring CA", {}, true));
updated = true;
}
// Update certificate
......
Markdown is supported
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