Add extracted tools: CitrineOS, OpenOCPP, ShapeShifter
- CitrineOS core extracted (CSMS OCPP 2.0.1) - OpenOCPP extracted (firmware OCPP 1.6J/2.0.1) - ShapeShifter library installed (pip install -e) - ShapeShifter specification extracted - EVerest extracted TODO updated with progress
This commit is contained in:
41
tools/EVerest-main/lib/everest/tls/tests/crypto_test.cpp
Normal file
41
tools/EVerest-main/lib/everest/tls/tests/crypto_test.cpp
Normal file
@@ -0,0 +1,41 @@
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
// Copyright 2024 Pionix GmbH and Contributors to EVerest
|
||||
|
||||
#include "gtest/gtest.h"
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include <everest/tls/openssl_conv.hpp>
|
||||
#include <everest/tls/openssl_util.hpp>
|
||||
|
||||
#include <evse_security/certificate/x509_hierarchy.hpp>
|
||||
#include <evse_security/certificate/x509_wrapper.hpp>
|
||||
|
||||
namespace {
|
||||
|
||||
using evse_security::HashAlgorithm;
|
||||
using evse_security::X509Wrapper;
|
||||
using openssl::load_certificates;
|
||||
using openssl::conversions::to_X509Wrapper;
|
||||
|
||||
TEST(evseSecurity, certificateHash) {
|
||||
auto chain = load_certificates("client_chain.pem");
|
||||
ASSERT_GT(chain.size(), 0);
|
||||
|
||||
std::vector<X509Wrapper> certs;
|
||||
|
||||
for (const auto& cert : chain) {
|
||||
certs.push_back(to_X509Wrapper(cert.get()));
|
||||
}
|
||||
|
||||
for (std::uint8_t i = 0; i < certs.size() - 1; i++) {
|
||||
SCOPED_TRACE("i=" + std::to_string(i));
|
||||
const auto& cert = certs[i];
|
||||
const auto& issuer = certs[i + 1];
|
||||
const auto resA = cert.get_certificate_hash_data(issuer);
|
||||
EXPECT_EQ(resA.hash_algorithm, HashAlgorithm::SHA256);
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace
|
||||
Reference in New Issue
Block a user