Skip to content

Commit

Permalink
security: enable moving certificates into v3::CertificateCache
Browse files Browse the repository at this point in the history
  • Loading branch information
riebl committed Sep 9, 2024
1 parent 90f0677 commit 6f7cf39
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions vanetza/security/v3/certificate_cache.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ const Certificate* CertificateCache::lookup(const HashedId8& digest) const
}
}

void CertificateCache::store(const Certificate& cert)
void CertificateCache::store(Certificate cert)
{
auto maybe_hash = cert.calculate_digest();
if (maybe_hash) {
m_storage.emplace(*maybe_hash, cert);
m_storage.emplace(*maybe_hash, std::move(cert));
m_digests.insert(*maybe_hash);
}
}
Expand Down
2 changes: 1 addition & 1 deletion vanetza/security/v3/certificate_cache.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class CertificateCache
* Store a (pre-validated) certificate in cache
* \param cert certificate
*/
void store(const Certificate& cert);
void store(Certificate cert);

size_t size() const { return m_storage.size(); }

Expand Down

0 comments on commit 6f7cf39

Please sign in to comment.