From 4db3d6c8f082ab6676bcd8abaaf55db82e005338 Mon Sep 17 00:00:00 2001 From: Rhys Weatherley Date: Thu, 21 Jun 2018 19:48:13 +1000 Subject: [PATCH] Define an identifier for storing Ethernet MAC addresses in the key ring --- libraries/Crypto/KeyRing.cpp | 11 +++++++++++ libraries/Crypto/KeyRing.h | 2 ++ 2 files changed, 13 insertions(+) diff --git a/libraries/Crypto/KeyRing.cpp b/libraries/Crypto/KeyRing.cpp index 909ff57c..3cc2ef2a 100644 --- a/libraries/Crypto/KeyRing.cpp +++ b/libraries/Crypto/KeyRing.cpp @@ -196,6 +196,17 @@ KeyRingClass KeyRing; * primary remote device that this device will be communicating with. */ +/** + * \var KeyRingClass::EthernetMACAddress + * \brief Identifier for storing a generated MAC address into the other + * data section of the key ring. + * + * When using the Arduino Ethernet library, the MAC address needs to be + * provided in the sketch. This identifier provides a convenient place + * to store the MAC address if you want to generate it randomly instead + * of specifying a fixed value. + */ + /** @cond mantis8 */ // 32-bit version of Mantis-8, extracted from the Skinny-C repository: diff --git a/libraries/Crypto/KeyRing.h b/libraries/Crypto/KeyRing.h index c2c967da..c360408b 100644 --- a/libraries/Crypto/KeyRing.h +++ b/libraries/Crypto/KeyRing.h @@ -65,6 +65,8 @@ public: static const uint16_t LocalEd25519Default = 0x4501; // 'E', 0x01 static const uint16_t RemoteEd25519Default = 0x6501; // 'e', 0x01 + static const uint16_t EthernetMACAddress = 0x4D01; // 'M', 0x01 + private: static const size_t ChunkSize = 36;