obu-firmware builds against vanetza-idf from microbu-esp32c5/external, but that tree was gitignored, so a clone of this repository could not build the firmware it ships. It is now committed here as ordinary files in its own folder, microbu-esp32c5/: the colleague's commit cf4b99f plus the V2X2MAP bridge's signature verification (--trust) used on the bench. Nothing is fetched from or pushed to the colleague's repository; this repository and its remotes carry everything. The folder's own .gitignore keeps build output, downloaded components and private key material out, as it did there; the committed file set is identical to that repository's tracked files. The ESP32-C5 is still flashed from obu-firmware/, which only takes vanetza-idf from microbu-esp32c5/, so the two stay separate folders. FLASHING.md says how to take a newer version of the colleague's tree (copy it over the folder, rebuild, test, commit).
46 lines
1.3 KiB
C++
46 lines
1.3 KiB
C++
#pragma once
|
|
|
|
#include "hashed_id8.hpp"
|
|
#include <vanetza/security/hashed_id.hpp>
|
|
#include <vanetza/security/v3/revocation_lookup.hpp>
|
|
#include <boost/optional/optional.hpp>
|
|
#include <filesystem>
|
|
#include <memory>
|
|
#include <unordered_map>
|
|
#include <unordered_set>
|
|
|
|
namespace vanetza
|
|
{
|
|
namespace pki
|
|
{
|
|
|
|
class CertificateRevocationList;
|
|
class SecurityModule;
|
|
|
|
/**
|
|
* Constructor scans \p root and indexes every "*.crl" file.
|
|
* store() replaces any prior CRL from the same issuer (one file per issuer).
|
|
*/
|
|
class CrlFilesystemStore : public security::v3::RevocationLookup
|
|
{
|
|
public:
|
|
CrlFilesystemStore(std::shared_ptr<SecurityModule>, const std::filesystem::path& root);
|
|
|
|
// Returns false if the CRL has no extractable issuer or a malformed payload.
|
|
bool store(const CertificateRevocationList&);
|
|
|
|
bool is_revoked(const security::HashedId8& issuer, const security::HashedId8& cert) const override;
|
|
|
|
protected:
|
|
std::filesystem::path filename(const HashedId8&) const;
|
|
boost::optional<HashedId8> index(const CertificateRevocationList&);
|
|
|
|
private:
|
|
std::shared_ptr<SecurityModule> m_security;
|
|
std::filesystem::path m_root;
|
|
std::unordered_map<security::HashedId8, std::unordered_set<security::HashedId8>> m_revoked;
|
|
};
|
|
|
|
} // namespace pki
|
|
} // namespace vanetza
|