aboutsummaryrefslogtreecommitdiffstats
path: root/libtransport/src/auth/signer.cc
diff options
context:
space:
mode:
Diffstat (limited to 'libtransport/src/auth/signer.cc')
-rw-r--r--libtransport/src/auth/signer.cc11
1 files changed, 5 insertions, 6 deletions
diff --git a/libtransport/src/auth/signer.cc b/libtransport/src/auth/signer.cc
index f13df53eb..500732ba1 100644
--- a/libtransport/src/auth/signer.cc
+++ b/libtransport/src/auth/signer.cc
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2021 Cisco and/or its affiliates.
+ * Copyright (c) 2021-2022 Cisco and/or its affiliates.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at:
@@ -36,8 +36,6 @@ Signer::~Signer() {}
void Signer::signPacket(PacketPtr packet) {
DCHECK(key_ != nullptr);
- core::Packet::Format format = packet->getFormat();
-
if (!packet->hasAH()) {
throw errors::MalformedAHPacketException();
}
@@ -48,8 +46,9 @@ void Signer::signPacket(PacketPtr packet) {
packet->updateLength(); // update IP payload length
// Copy IP+TCP / ICMP header before zeroing them
- hicn_header_t header_copy;
- hicn_packet_copy_header(format, packet->packet_start_, &header_copy, false);
+ u8 header_copy[HICN_HDRLEN_MAX];
+ size_t header_len;
+ packet->saveHeader(header_copy, &header_len);
// Copy bitmap from interest manifest
uint32_t request_bitmap[BITMAP_SIZE] = {0};
@@ -78,7 +77,7 @@ void Signer::signPacket(PacketPtr packet) {
packet->setSignatureSize(signature_len_);
// Restore header
- hicn_packet_copy_header(format, &header_copy, packet->packet_start_, false);
+ packet->loadHeader(header_copy, header_len);
// Restore bitmap in interest manifest
if (packet->isInterest()) {