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).
51 lines
1.5 KiB
C++
51 lines
1.5 KiB
C++
#include "certificate_validation_v3.hpp"
|
|
#include <vanetza/common/position_provider.hpp>
|
|
#include <vanetza/common/runtime.hpp>
|
|
#include <vanetza/security/persistence.hpp>
|
|
#include <vanetza/security/v3/certificate_validator.hpp>
|
|
#include <vanetza/security/v3/location_checker.hpp>
|
|
|
|
namespace
|
|
{
|
|
|
|
class DefaultCertificateValidationV3 : public CertificateValidationV3
|
|
{
|
|
public:
|
|
DefaultCertificateValidationV3(
|
|
const vanetza::Runtime& runtime, vanetza::PositionProvider& positioning,
|
|
const vanetza::security::v3::LocationChecker& location_checker)
|
|
{
|
|
m_validator.use_runtime(&runtime);
|
|
m_validator.use_position_provider(&positioning);
|
|
m_validator.use_location_checker(&location_checker);
|
|
}
|
|
|
|
vanetza::security::v3::CertificateValidator& validator() override
|
|
{
|
|
return m_validator;
|
|
}
|
|
|
|
vanetza::security::PrivateKey load_authorization_ticket_key(
|
|
const std::string& path) const override
|
|
{
|
|
return vanetza::security::load_private_key_from_pem_file(path);
|
|
}
|
|
|
|
void add_chain_certificate(const vanetza::security::v3::Certificate&) override
|
|
{
|
|
}
|
|
|
|
private:
|
|
vanetza::security::v3::DefaultCertificateValidator m_validator;
|
|
};
|
|
|
|
} // namespace
|
|
|
|
std::unique_ptr<CertificateValidationV3> create_default_certificate_validation_v3(
|
|
const vanetza::Runtime& runtime, vanetza::PositionProvider& positioning,
|
|
const vanetza::security::v3::LocationChecker& location_checker)
|
|
{
|
|
return std::make_unique<DefaultCertificateValidationV3>(
|
|
runtime, positioning, location_checker);
|
|
}
|