From 4b36dc3d5dd3ec206aa24d49557c61ae5886be2b Mon Sep 17 00:00:00 2001 From: Olivier Roques Date: Fri, 20 Mar 2020 12:12:28 +0100 Subject: [HICN-580] Improve memory usage in signer and verifier This patch reduces the amount of memory used by the signer and verifier classes. It also removes some logs from VPP collectd plugins. Change-Id: I3dac7b9104b5586ac22dee60f506bee51ece2cbe Signed-off-by: Olivier Roques --- libtransport/includes/hicn/transport/security/signer.h | 7 +------ libtransport/includes/hicn/transport/security/verifier.h | 11 +---------- 2 files changed, 2 insertions(+), 16 deletions(-) (limited to 'libtransport/includes') diff --git a/libtransport/includes/hicn/transport/security/signer.h b/libtransport/includes/hicn/transport/security/signer.h index 31b21462b..45bcdb516 100644 --- a/libtransport/includes/hicn/transport/security/signer.h +++ b/libtransport/includes/hicn/transport/security/signer.h @@ -76,15 +76,10 @@ class Signer { PARCKeyStore *getKeyStore(); private: - PARCBufferComposer *composer_ = nullptr; - PARCBuffer *key_buffer_ = nullptr; - PARCSymmetricKeyStore *symmetricKeyStore_ = nullptr; + CryptoSuite suite_; PARCSigner *signer_ = nullptr; - PARCSignature *signature_ = nullptr; PARCKeyId *key_id_ = nullptr; - CryptoSuite suite_; size_t signature_length_; - static uint8_t zeros[200]; }; } // namespace utils diff --git a/libtransport/includes/hicn/transport/security/verifier.h b/libtransport/includes/hicn/transport/security/verifier.h index 7ec6e7eda..838868427 100644 --- a/libtransport/includes/hicn/transport/security/verifier.h +++ b/libtransport/includes/hicn/transport/security/verifier.h @@ -84,20 +84,11 @@ class Verifier { */ int verify(const Packet &packet); - CryptoHash getPacketHash(const Packet &packet, - std::shared_ptr hasher); + CryptoHash getPacketHash(const Packet &packet, CryptoHasher &hasher); private: PARCVerifier *verifier_ = nullptr; - PARCCertificateFactory *factory_ = nullptr; - PARCCertificate *certificate_ = nullptr; - PARCKeyId *keyId_ = nullptr; - PARCKey *key_ = nullptr; - PARCBuffer *key_buffer_ = nullptr; - PARCSymmetricKeyStore *symmetricKeyStore_ = nullptr; PARCSigner *signer_ = nullptr; - PARCBufferComposer *composer_ = nullptr; - static uint8_t zeros[200]; }; } // namespace utils -- cgit 1.2.3-korg