1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-07-02 14:22:55 +03:00

- Replace Crypto files with CryptoInterface which uses BearSSL as a cryptographic backend.

- Move cryptographic functions from JsonTranslator to CryptoInterface.

- Make AP activation separate from FloodingMesh::begin().

- Fix English bug.

- Improve comments.
This commit is contained in:
Anders
2019-11-05 22:29:59 +01:00
parent afc88f2652
commit 3132325bf8
15 changed files with 353 additions and 1363 deletions

View File

@ -26,6 +26,7 @@
#include "UtilityFunctions.h"
#include "TypeConversionFunctions.h"
#include "JsonTranslator.h"
#include "CryptoInterface.h"
using EspnowProtocolInterpreter::espnowHashKeyLength;
@ -127,7 +128,7 @@ uint64_t EncryptedConnectionData::getOwnSessionKey() const { return _ownSessionK
uint64_t EncryptedConnectionData::incrementSessionKey(uint64_t sessionKey, const uint8_t *hashKey, uint8_t hashKeyLength)
{
String hmac = JsonTranslator::createHmac(uint64ToString(sessionKey), hashKey, hashKeyLength);
String hmac = CryptoInterface::createBearsslHmac(uint64ToString(sessionKey), hashKey, hashKeyLength);
/* HMAC truncation should be OK since hmac sha256 is a PRF and we are truncating to the leftmost (MSB) bits.
PRF: https://crypto.stackexchange.com/questions/26410/whats-the-gcm-sha-256-of-a-tls-protocol/26434#26434