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).
This commit is contained in:
+45
@@ -0,0 +1,45 @@
|
||||
#include <gtest/gtest.h>
|
||||
#include <vanetza/common/byte_sequence.hpp>
|
||||
#include <vanetza/security/signature.hpp>
|
||||
#include <vanetza/security/v2/tests/check_ecc_point.hpp>
|
||||
#include <vanetza/security/v2/tests/check_signature.hpp>
|
||||
#include <vanetza/security/v2/tests/check_visitor.hpp>
|
||||
#include <boost/variant/apply_visitor.hpp>
|
||||
|
||||
namespace vanetza
|
||||
{
|
||||
namespace security
|
||||
{
|
||||
|
||||
void check(const EcdsaSignature& expected, const EcdsaSignature& actual)
|
||||
{
|
||||
check(expected.R, actual.R);
|
||||
EXPECT_EQ(expected.s, actual.s);
|
||||
}
|
||||
|
||||
void check(const EcdsaSignatureFuture& expected, const EcdsaSignatureFuture& actual)
|
||||
{
|
||||
check(expected.get(), actual.get());
|
||||
}
|
||||
|
||||
EcdsaSignature create_random_ecdsa_signature(int seed)
|
||||
{
|
||||
const std::size_t field = v2::field_size(v2::PublicKeyAlgorithm::ECDSA_NISTP256_With_SHA256);
|
||||
EcdsaSignature signature;
|
||||
signature.s = random_byte_sequence(field, seed);
|
||||
signature.R = X_Coordinate_Only { random_byte_sequence(field, ~seed) };
|
||||
return signature;
|
||||
}
|
||||
|
||||
namespace v2
|
||||
{
|
||||
|
||||
void check(const Signature& expected, const Signature& actual)
|
||||
{
|
||||
ASSERT_EQ(get_type(expected), get_type(actual));
|
||||
// TODO boost::apply_visitor(check_visitor<Signature>(), expected, actual);
|
||||
}
|
||||
|
||||
} // namespace v2
|
||||
} // namespace security
|
||||
} // namespace vanetza
|
||||
Reference in New Issue
Block a user