Files
Ashin Walpola d107534eb2 Keep vanetza-idf in obu-firmware, so a plain clone builds the firmware
obu-firmware builds against the vanetza-idf C-ITS library, which until now
came from the colleague's microbu-esp32c5 tree beside the repository and was
not tracked here, so a clone of this repository could not build the firmware
it ships. The library alone is now part of obu-firmware, as
obu-firmware/external/vanetza-idf: their external/vanetza-idf at commit
cf4b99f, unchanged (9775 files; see its PROVENANCE.md). CMake takes it from
there by default; -DVANETZA_IDF_DIR still points the build elsewhere.

The rest of the colleague's tree (their own VAM firmware, PKI tooling,
station-link Python tools, the V2X2MAP bridge) stays out of this repository
and gitignored; nothing is pushed to their repository. NOTES.md, docs/06,
TODO.md and the pcap verifier's usage line point at the new location.
2026-09-24 10:56:05 +02:00

72 lines
1.7 KiB
C++

#include <vanetza/security/v2/null_certificate_provider.hpp>
namespace vanetza
{
namespace security
{
namespace v2
{
VerificationKey create_null_verification_key()
{
Uncompressed coordinates;
coordinates.x.resize(32);
coordinates.y.resize(32);
EccPoint ecc_point = coordinates;
ecdsa_nistp256_with_sha256 ecdsa;
ecdsa.public_key = ecc_point;
VerificationKey verification_key;
verification_key.key = ecdsa;
return verification_key;
}
EcdsaSignature create_null_signature()
{
EcdsaSignature signature;
X_Coordinate_Only coordinate;
coordinate.x.resize(32);
signature.R = std::move(coordinate);
signature.s.resize(32);
return signature;
}
Certificate create_null_certificate()
{
Certificate cert;
cert.signer_info = HashedId8 {};
cert.subject_info.subject_type = SubjectType::Authorization_Ticket;
cert.subject_attributes.push_back(SubjectAssurance(0x00));
cert.subject_attributes.push_back(create_null_verification_key());
cert.validity_restriction.push_back(StartAndEndValidity {});
cert.signature = create_null_signature();
return cert;
}
NullCertificateProvider::NullCertificateProvider() { }
const Certificate& NullCertificateProvider::own_certificate()
{
return null_certificate();
}
std::list<Certificate> NullCertificateProvider::own_chain()
{
return std::list<Certificate> {};
}
const ecdsa256::PrivateKey& NullCertificateProvider::own_private_key()
{
static const ecdsa256::PrivateKey null_key {};
return null_key;
}
const Certificate& NullCertificateProvider::null_certificate()
{
static const Certificate null_certificate = create_null_certificate();
return null_certificate;
}
} // namespace v2
} // namespace security
} // namespace vanetza