diff options
Diffstat (limited to 'libtransport')
-rw-r--r-- | libtransport/src/hicn/transport/utils/signer.cc | 2 | ||||
-rw-r--r-- | libtransport/src/hicn/transport/utils/verifier.cc | 6 |
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); |