Files
MicrOBU/microbu-esp32c5/external/vanetza-idf/vanetza/security/straight_verify_service.hpp
T
Ashin Walpola 0e9525162d Keep the colleague's microbu-esp32c5 tree in this repository
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).
2026-09-23 17:46:40 +02:00

88 lines
2.2 KiB
C++

#pragma once
#include <vanetza/security/verify_service.hpp>
namespace vanetza
{
// forward declaration
class PositionProvider;
class Runtime;
namespace security
{
// forward declarations
class Backend;
namespace v2
{
// forward declarations
class CertificateCache;
class CertificateProvider;
class CertificateValidator;
class SignHeaderPolicy;
} // namespace v2
namespace v3
{
// forward declarations
class CertificateCache;
class CertificateProvider;
class CertificateValidator;
class SignHeaderPolicy;
} // namespace v3
/**
* Verify service with basic certificate and signature checks
*/
class StraightVerifyService : public VerifyService
{
public:
StraightVerifyService(const Runtime&, Backend&);
StraightVerifyService(const Runtime&, Backend&, PositionProvider&);
void use_certificate_cache(v2::CertificateCache*);
void use_certificate_provider(v2::CertificateProvider*);
void use_certificate_validator(v2::CertificateValidator*);
void use_sign_header_policy(v2::SignHeaderPolicy*);
void use_certificate_provider(v3::CertificateProvider*);
void use_certificate_cache(v3::CertificateCache*);
void use_certificate_validator(v3::CertificateValidator*);
void use_sign_header_policy(v3::SignHeaderPolicy*);
VerifyConfirm verify(const VerifyRequest&) override;
VerifyConfirm verify(const v2::SecuredMessage&);
VerifyConfirm verify(const v3::SecuredMessage&);
private:
const Runtime& m_runtime;
Backend& m_backend;
PositionProvider* m_position_provider = nullptr;
struct {
v2::CertificateCache* m_cert_cache = nullptr;
v2::CertificateProvider* m_cert_provider = nullptr;
v2::CertificateValidator* m_cert_validator = nullptr;
v2::SignHeaderPolicy* m_sign_policy = nullptr;
constexpr bool complete() const
{
return m_cert_cache && m_cert_provider && m_cert_validator && m_sign_policy;
}
} m_context_v2;
struct {
v3::CertificateCache* m_cert_cache = nullptr;
v3::CertificateValidator* m_cert_validator = nullptr;
v3::SignHeaderPolicy* m_sign_policy = nullptr;
} m_context_v3;
};
} // namespace security
} // namespace vanetza