1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-06-17 22:23:10 +03:00

- Make everything const by default.

- Remove setMeshInstance method from RequestData class.

- Remove delay(50) and WiFi.disconnect() from setup() in the examples since those statements do not seem to have an effect any longer.

- Improve documentation.
This commit is contained in:
Anders
2020-04-29 22:04:59 +02:00
parent a24b8d23f0
commit effcc3a2d0
40 changed files with 607 additions and 518 deletions

View File

@ -32,7 +32,7 @@ namespace MeshCryptoInterface
return CryptoInterface::sha256Hmac(message, hashKey, hashKeyLength, hmacLength);
}
bool verifyMeshHmac(const String &message, const String &messageHmac, const uint8_t *hashKey, uint8_t hashKeyLength)
bool verifyMeshHmac(const String &message, const String &messageHmac, const uint8_t *hashKey, const uint8_t hashKeyLength)
{
String generatedHmac = createMeshHmac(message, hashKey, hashKeyLength, messageHmac.length()/2); // We know that each HMAC byte should become 2 String characters due to uint8ArrayToHexString.
if(generatedHmac == messageHmac)
@ -41,7 +41,7 @@ namespace MeshCryptoInterface
return false;
}
uint8_t *initializeKey(uint8_t *key, uint8_t keyLength, const String &keySeed)
uint8_t *initializeKey(uint8_t *key, const uint8_t keyLength, const String &keySeed)
{
assert(keyLength <= CryptoInterface::SHA256_NATURAL_LENGTH);
uint8_t hashArray[CryptoInterface::SHA256_NATURAL_LENGTH] {};