From 35058cdfe0134c88f1aa8d23342d1d7b9d39e296 Mon Sep 17 00:00:00 2001 From: Alberto Compagno Date: Tue, 7 Jan 2020 11:46:02 +0100 Subject: [HICN-2] Added P2P confidential communication on hICN P2P confidential communications exploit the TLS 1.3 protocol to let a consumer to establish a secure communication on an hICN name. Currently we don't support the consumer authentication (mutual authentication in TLS) and the 0-rtt session establishment. Change-Id: I2be073847c08a17f28c837d444081920c5e57a07 Signed-off-by: Alberto Compagno Signed-off-by: Olivier Roques Signed-off-by: Mauro Sardara --- .../hicn/transport/protocols/verification_manager.h | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) (limited to 'libtransport/src/hicn/transport/protocols/verification_manager.h') diff --git a/libtransport/src/hicn/transport/protocols/verification_manager.h b/libtransport/src/hicn/transport/protocols/verification_manager.h index 6e5d32127..293e8103a 100644 --- a/libtransport/src/hicn/transport/protocols/verification_manager.h +++ b/libtransport/src/hicn/transport/protocols/verification_manager.h @@ -30,22 +30,36 @@ namespace protocol { using Packet = core::Packet; using interface::ConsumerSocket; using interface::VerificationPolicy; +using ContentObjectPtr = std::shared_ptr; class VerificationManager { public: virtual ~VerificationManager() = default; virtual VerificationPolicy onPacketToVerify(const Packet& packet) = 0; + virtual bool onKeyToVerify() { return false; } }; class SignatureVerificationManager : public VerificationManager { public: - SignatureVerificationManager(ConsumerSocket* icn_socket) - : icn_socket_(icn_socket) {} + SignatureVerificationManager(interface::ConsumerSocket* icn_socket) + : icn_socket_(icn_socket), key_packets_() {} interface::VerificationPolicy onPacketToVerify(const Packet& packet) override; + bool onKeyToVerify() override; private: ConsumerSocket* icn_socket_; + std::queue key_packets_; + + ContentObjectPtr copyPacket(const Packet& packet) { + std::shared_ptr packet_copy = + packet.acquireMemBufReference(); + ContentObjectPtr content_object_copy = + std::make_shared(std::move(packet_copy)); + std::unique_ptr payload_copy = packet.getPayload(); + content_object_copy->appendPayload(std::move(payload_copy)); + return content_object_copy; + } }; } // end namespace protocol -- cgit 1.2.3-korg