aboutsummaryrefslogtreecommitdiffstats
path: root/libtransport
diff options
context:
space:
mode:
authorAngelo Mantellini <manangel@cisco.com>2019-02-13 17:27:33 +0100
committerAngelo Mantellini <manangel@cisco.com>2019-02-13 18:41:25 +0100
commit2ba6db73e9a319b665853d65682230be98dde8d9 (patch)
tree77522585bb9c365e85fd4dfde8bb8eaeb9a66f15 /libtransport
parent2f039d41169b95fa1ee9b1be9fbdc8e899707d25 (diff)
[HICN-61] Compile Error in libtransport in windows environment
Change-Id: I25642a194996e449b91d492b22a379466c524940 Signed-off-by: Angelo Mantellini <manangel@cisco.com>
Diffstat (limited to 'libtransport')
-rw-r--r--libtransport/src/hicn/transport/utils/signer.cc2
-rw-r--r--libtransport/src/hicn/transport/utils/verifier.cc6
2 files changed, 5 insertions, 3 deletions
diff --git a/libtransport/src/hicn/transport/utils/signer.cc b/libtransport/src/hicn/transport/utils/signer.cc
index 7ebbc4636..e1262ec94 100644
--- a/libtransport/src/hicn/transport/utils/signer.cc
+++ b/libtransport/src/hicn/transport/utils/signer.cc
@@ -130,7 +130,7 @@ void Signer::sign(Packet &packet) {
utils::CryptoHash hash = hasher.finalize();
PARCSignature *signature = parcSigner_SignDigestNoAlloc(
- this->signer_, hash.hash_, packet.getSignature(), sign_len_bytes);
+ this->signer_, hash.hash_, packet.getSignature(), (uint32_t)sign_len_bytes);
PARCBuffer *buffer = parcSignature_GetSignature(signature);
size_t bytes_len = parcBuffer_Remaining(buffer);
diff --git a/libtransport/src/hicn/transport/utils/verifier.cc b/libtransport/src/hicn/transport/utils/verifier.cc
index aec80cff6..4295aaab7 100644
--- a/libtransport/src/hicn/transport/utils/verifier.cc
+++ b/libtransport/src/hicn/transport/utils/verifier.cc
@@ -128,9 +128,9 @@ int Verifier::verify(const Packet &packet) {
PARCKeyId *key_id = parcKeyId_Create(buffer);
parcBuffer_Release(&buffer);
- int ah_payload_len = packet.getSignatureSize();
+ int ah_payload_len = (int)packet.getSignatureSize();
uint8_t *_signature = packet.getSignature();
- uint8_t signature[ah_payload_len];
+ uint8_t * signature = new uint8_t[ah_payload_len];
// TODO Remove signature copy at this point, by not setting to zero
// the validation payload.
@@ -191,6 +191,8 @@ int Verifier::verify(const Packet &packet) {
memcpy(hicn_packet, &header_copy, HICN_V6_TCP_HDRLEN);
}
+ delete[] signature;
+
parcKeyId_Release(&key_id);
parcBuffer_Release(&bits);