Vanetza
Loading...
Searching...
No Matches
backend_null.hpp
1#ifndef BACKEND_NULL_HPP_3E6GMTPL
2#define BACKEND_NULL_HPP_3E6GMTPL
3
4#include <vanetza/security/backend.hpp>
5
6namespace vanetza
7{
8namespace security
9{
10
11/**
12 * \brief A backend doing nothing
13 *
14 * This backend is INSECURE quite obviously!
15 * It will return a faked signature and silently accept all data at verification.
16 */
17class BackendNull : public Backend
18{
19public:
20 static constexpr auto backend_name = "Null";
21
22 /// \see Backend::sign_data
23 EcdsaSignature sign_data(const ecdsa256::PrivateKey& private_key, const ByteBuffer& data_buffer) override;
24
25 /// \see Backend::sign_digest
26 Signature sign_digest(const PrivateKey&, const ByteBuffer&) override;
27
28 /// \see Backend::verify_data
29 bool verify_data(const ecdsa256::PublicKey& public_key, const ByteBuffer& data, const EcdsaSignature& sig) override;
30
31 /// \see Backend::verify_digest
32 bool verify_digest(const PublicKey&, const ByteBuffer& digest, const Signature&) override;
33
34 /// \see Backend::decompress_point
35 boost::optional<Uncompressed> decompress_point(const EccPoint& ecc_point) override;
36
37 /// \see Backend::calculate_hash
38 ByteBuffer calculate_hash(HashAlgorithm, const ByteBuffer&) override;
39
40private:
41 EcdsaSignature fake_signature() const;
42};
43
44} // namespace security
45} // namespace vanetza
46
47#endif /* BACKEND_NULL_HPP_3E6GMTPL */
48
A backend doing nothing.
bool verify_data(const ecdsa256::PublicKey &public_key, const ByteBuffer &data, const EcdsaSignature &sig) override
bool verify_digest(const PublicKey &, const ByteBuffer &digest, const Signature &) override
Signature sign_digest(const PrivateKey &, const ByteBuffer &) override
EcdsaSignature sign_data(const ecdsa256::PrivateKey &private_key, const ByteBuffer &data_buffer) override
ByteBuffer calculate_hash(HashAlgorithm, const ByteBuffer &) override
boost::optional< Uncompressed > decompress_point(const EccPoint &ecc_point) override
EcdsaSignature specified in TS 103 097 v1.2.1, section 4.2.9.
Definition signature.hpp:17