From eb9119968cfc53f41526981924e5c8d44612f98a Mon Sep 17 00:00:00 2001 From: Olivier Roques Date: Wed, 8 Apr 2020 15:29:55 +0200 Subject: [HICN-595] Bring TLS up to date HICN-2 would enable TLS only if OpenSSL 1.1.1 was present. However the mechanism to do so was broken and hiperf always ended up using normal consumer and producer sockets. This patch fixes that by updating the build files. It also fixes various bugs in the TLS implementation that went unnoticed and cleans up the code. Change-Id: Ifda75a9929e14460af43fe79d737d0c926bb671e Signed-off-by: Olivier Roques Signed-off-by: Mauro Sardara --- libtransport/includes/hicn/transport/core/packet.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'libtransport/includes/hicn/transport/core/packet.h') diff --git a/libtransport/includes/hicn/transport/core/packet.h b/libtransport/includes/hicn/transport/core/packet.h index e58e7962d..2efd7439d 100644 --- a/libtransport/includes/hicn/transport/core/packet.h +++ b/libtransport/includes/hicn/transport/core/packet.h @@ -148,15 +148,15 @@ class Packet : public std::enable_shared_from_this { std::pair getPayloadReference() const { int signature_size = 0; + if (_is_ah(format_)) { signature_size = (uint32_t)getSignatureSize(); } auto header_size = getHeaderSizeFromFormat(format_, signature_size); - auto payload_length = packet_->length() - header_size; + auto payload_length = payloadSize(); - return std::make_pair(packet_->data() + header_size, - payload_length); + return std::make_pair(packet_->data() + header_size, payload_length); } Packet &updateLength(std::size_t length = 0); @@ -229,6 +229,7 @@ class Packet : public std::enable_shared_from_this { Packet &setTTL(uint8_t hops); uint8_t getTTL() const; + void separateHeaderPayload(); void resetPayload(); private: @@ -248,7 +249,6 @@ class Packet : public std::enable_shared_from_this { } uint8_t *getSignature() const; - void separateHeaderPayload(); protected: Name name_; -- cgit 1.2.3-korg