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::verify_data
26 bool verify_data(const ecdsa256::PublicKey& public_key, const ByteBuffer& data, const EcdsaSignature& sig) override;
27
28 /// \see Backend::verify_digest
29 bool verify_digest(const PublicKey&, const ByteBuffer& digest, const Signature&) override;
30
31 /// \see Backend::decompress_point
32 boost::optional<Uncompressed> decompress_point(const EccPoint& ecc_point) override;
33
34 /// \see Backend::calculate_hash
35 ByteBuffer calculate_hash(KeyType, const ByteBuffer&) override;
36
37private:
38 EcdsaSignature fake_signature() const;
39};
40
41} // namespace security
42} // namespace vanetza
43
44#endif /* BACKEND_NULL_HPP_3E6GMTPL */
45
A backend doing nothing.
bool verify_data(const ecdsa256::PublicKey &public_key, const ByteBuffer &data, const EcdsaSignature &sig) override
ByteBuffer calculate_hash(KeyType, const ByteBuffer &) override
bool verify_digest(const PublicKey &, const ByteBuffer &digest, const Signature &) override
EcdsaSignature sign_data(const ecdsa256::PrivateKey &private_key, const ByteBuffer &data_buffer) 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