mirror of
https://github.com/espressif/openthread.git
synced 2026-09-16 14:10:09 +00:00
[mac] remove "packed" requirement for Mac::KeyMaterial (#7021)
This commit removes the `OT_TOOL_PACKED` requirement from types `otMacKeyMaterial` and `Mac::KeyMaterial`. Generally, we define a type as "packed" if it may be embedded in a message/buffer (e.g. a TLV) and/or may be cast from a buffer pointer. Neither case applies to `KeyMaterial`.
This commit is contained in:
@@ -53,7 +53,7 @@ extern "C" {
|
||||
* @note This number versions both OpenThread platform and user APIs.
|
||||
*
|
||||
*/
|
||||
#define OPENTHREAD_API_VERSION (167)
|
||||
#define OPENTHREAD_API_VERSION (168)
|
||||
|
||||
/**
|
||||
* @addtogroup api-instance
|
||||
|
||||
@@ -212,21 +212,14 @@ typedef otCryptoKeyRef otMacKeyRef;
|
||||
* This structure represents a MAC Key.
|
||||
*
|
||||
*/
|
||||
OT_TOOL_PACKED_BEGIN
|
||||
struct otMacKeyMaterial
|
||||
typedef struct otMacKeyMaterial
|
||||
{
|
||||
union
|
||||
{
|
||||
otMacKeyRef mKeyRef; ///< Reference to the key stored.
|
||||
otMacKey mKey; ///< Key stored as literal.
|
||||
} mKeyMaterial;
|
||||
} OT_TOOL_PACKED_END;
|
||||
|
||||
/**
|
||||
* This structure represents a MAC Key reference.
|
||||
*
|
||||
*/
|
||||
typedef struct otMacKeyMaterial otMacKeyMaterial;
|
||||
} otMacKeyMaterial;
|
||||
|
||||
/**
|
||||
* This enumeration defines constants about key types.
|
||||
|
||||
@@ -440,7 +440,6 @@ typedef otMacKeyRef KeyRef;
|
||||
* This class represents a MAC Key Material.
|
||||
*
|
||||
*/
|
||||
OT_TOOL_PACKED_BEGIN
|
||||
class KeyMaterial : public otMacKeyMaterial, public Unequatable<KeyMaterial>
|
||||
{
|
||||
public:
|
||||
@@ -550,7 +549,7 @@ private:
|
||||
#endif
|
||||
Key &GetKey(void) { return static_cast<Key &>(mKeyMaterial.mKey); }
|
||||
void SetKey(const Key &aKey) { mKeyMaterial.mKey = aKey; }
|
||||
} OT_TOOL_PACKED_END;
|
||||
};
|
||||
|
||||
/**
|
||||
* This structure represents an IEEE 802.15.4 Extended PAN Identifier.
|
||||
|
||||
Reference in New Issue
Block a user