From 456cdf30919bc014f13961764a8819a8d125f868 Mon Sep 17 00:00:00 2001 From: Abtin Keshavarzian Date: Wed, 27 May 2020 21:38:50 -0700 Subject: [PATCH] [mle] add constant kMleSecurityTagSize for MLE security tag size (#5015) --- src/core/thread/mle.cpp | 6 +++--- src/core/thread/mle.hpp | 3 ++- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/core/thread/mle.cpp b/src/core/thread/mle.cpp index ec2269d7f..a5c3d9c6c 100644 --- a/src/core/thread/mle.cpp +++ b/src/core/thread/mle.cpp @@ -2520,7 +2520,7 @@ otError Mle::SendMessage(Message &aMessage, const Ip6::Address &aDestination) Header header; uint32_t keySequence; uint8_t nonce[Crypto::AesCcm::kNonceSize]; - uint8_t tag[4]; + uint8_t tag[kMleSecurityTagSize]; Crypto::AesCcm aesCcm; uint8_t buf[64]; uint16_t length; @@ -2605,14 +2605,14 @@ void Mle::HandleUdpReceive(Message &aMessage, const Ip6::MessageInfo &aMessageIn uint32_t keySequence; const Key * mleKey; uint32_t frameCounter; - uint8_t messageTag[4]; + uint8_t messageTag[kMleSecurityTagSize]; uint8_t nonce[Crypto::AesCcm::kNonceSize]; Mac::ExtAddress macAddr; Crypto::AesCcm aesCcm; uint16_t mleOffset; uint8_t buf[64]; uint16_t length; - uint8_t tag[4]; + uint8_t tag[kMleSecurityTagSize]; uint8_t command; Neighbor * neighbor; diff --git a/src/core/thread/mle.hpp b/src/core/thread/mle.hpp index 98ea3387a..bf7860bfb 100644 --- a/src/core/thread/mle.hpp +++ b/src/core/thread/mle.hpp @@ -1650,7 +1650,8 @@ protected: private: enum { - kMleHopLimit = 255, + kMleHopLimit = 255, + kMleSecurityTagSize = 4, // Security tag size in bytes. // Parameters related to "periodic parent search" feature (CONFIG_ENABLE_PERIODIC_PARENT_SEARCH). // All timer intervals are converted to milliseconds.