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 --- libtransport/src/hicn/transport/core/name.cc | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'libtransport/src/hicn/transport/core/name.cc') diff --git a/libtransport/src/hicn/transport/core/name.cc b/libtransport/src/hicn/transport/core/name.cc index 46ef98948..85e2b8565 100644 --- a/libtransport/src/hicn/transport/core/name.cc +++ b/libtransport/src/hicn/transport/core/name.cc @@ -116,9 +116,9 @@ std::string Name::toString() const { return name_string; } -uint32_t Name::getHash32() const { +uint32_t Name::getHash32(bool consider_suffix) const { uint32_t hash; - if (hicn_name_hash((hicn_name_t *)&name_, &hash) < 0) { + if (hicn_name_hash(&name_, &hash, consider_suffix) < 0) { throw errors::RuntimeException("Error computing the hash of the name!"); } return hash; @@ -206,6 +206,17 @@ std::ostream &operator<<(std::ostream &os, const Name &name) { return os; } +size_t hash::operator()( + const transport::core::Name &name) const { + return name.getHash32(false); +} + +size_t compare2::operator()( + const transport::core::Name &name1, + const transport::core::Name &name2) const { + return name1.equals(name2, false); +} + } // end namespace core } // end namespace transport -- cgit 1.2.3-korg