From 1a71ef6c628d6f6a3b4a9b24db205bbca0e977dc Mon Sep 17 00:00:00 2001 From: suwatchai Date: Sun, 4 Jul 2021 19:53:02 +0700 Subject: [PATCH] Increase BearSSL buffer for ESP8266 for token generation process which prevent crash in some ESP8266 device. --- README.md | 2 +- library.json | 2 +- library.properties | 2 +- src/Firebase_ESP_Client.cpp | 2 +- src/Firebase_ESP_Client.h | 4 ++-- src/README.md | 2 +- src/signer/Signer.cpp | 10 +++++----- src/signer/Signer.h | 9 +++++---- 8 files changed, 17 insertions(+), 16 deletions(-) diff --git a/README.md b/README.md index afc2f8b1a..5cd6b715d 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # Firebase Arduino Client Library for ESP8266 and ESP32 -Google's Firebase Arduino Client Library for ESP8266 and ESP32 v2.3.6 +Google's Firebase Arduino Client Library for ESP8266 and ESP32 v2.3.7 This library supports ESP8266 and ESP32 MCU from Espressif. The following are platforms in which the libraries are also available (RTDB only). diff --git a/library.json b/library.json index fd17a01dd..de6e90b60 100644 --- a/library.json +++ b/library.json @@ -1,6 +1,6 @@ { "name": "Firebase Arduino Client Library for ESP8266 and ESP32", - "version": "2.3.6", + "version": "2.3.7", "keywords": "communication, REST, esp32, esp8266, arduino", "description": "This client library provides the functions to work with Firebase Realtime database, Cloud Firestore, Firebase Storage, Google Cloud Storage, Cloud Functions for Firebase and Cloud Messaging.", "repository": { diff --git a/library.properties b/library.properties index 6e47d740b..0037c6402 100644 --- a/library.properties +++ b/library.properties @@ -1,6 +1,6 @@ name=Firebase Arduino Client Library for ESP8266 and ESP32 -version=2.3.6 +version=2.3.7 author=Mobizt diff --git a/src/Firebase_ESP_Client.cpp b/src/Firebase_ESP_Client.cpp index 0c8a4b5ea..9443e4213 100644 --- a/src/Firebase_ESP_Client.cpp +++ b/src/Firebase_ESP_Client.cpp @@ -1,5 +1,5 @@ /** - * Google's Firebase ESP Client Main class, Firebase_ESP_Client.cpp v2.3.6 + * Google's Firebase ESP Client Main class, Firebase_ESP_Client.cpp v2.3.7 * * This library supports Espressif ESP8266 and ESP32 * diff --git a/src/Firebase_ESP_Client.h b/src/Firebase_ESP_Client.h index 3c9bd730a..9128a4afb 100644 --- a/src/Firebase_ESP_Client.h +++ b/src/Firebase_ESP_Client.h @@ -1,9 +1,9 @@ #ifndef FIREBASE_CLIENT_VERSION -#define FIREBASE_CLIENT_VERSION "2.3.6" +#define FIREBASE_CLIENT_VERSION "2.3.7" #endif /** - * Google's Firebase ESP Client Main class, Firebase_ESP_Client.h v2.3.6 + * Google's Firebase ESP Client Main class, Firebase_ESP_Client.h v2.3.7 * * This library supports Espressif ESP8266 and ESP32 * diff --git a/src/README.md b/src/README.md index 3114dd809..24b9e236b 100644 --- a/src/README.md +++ b/src/README.md @@ -1,7 +1,7 @@ # Firebase Arduino Client Library for ESP8266 and ESP32 -Google's Firebase Arduino Client Library for ESP8266 and ESP32 v2.3.6 +Google's Firebase Arduino Client Library for ESP8266 and ESP32 v2.3.7 The default filessystem used in the library is flash and SD. diff --git a/src/signer/Signer.cpp b/src/signer/Signer.cpp index 5c512b3cc..551ff7f06 100644 --- a/src/signer/Signer.cpp +++ b/src/signer/Signer.cpp @@ -1,5 +1,5 @@ /** - * Google's Firebase Token Generation class, Signer.cpp version 1.1.1 + * Google's Firebase Token Generation class, Signer.cpp version 1.1.2 * * This library supports Espressif ESP8266 and ESP32 * @@ -504,7 +504,7 @@ bool Firebase_Signer::refreshToken() #elif defined(ESP8266) config->signer.wcs = new WiFiClientSecure(); config->signer.wcs->setInsecure(); - config->signer.wcs->setBufferSizes(1024, 512); + config->signer.wcs->setBufferSizes(1024, 1024); #endif config->signer.json = new FirebaseJson(); config->signer.data = new FirebaseJsonData(); @@ -1274,7 +1274,7 @@ bool Firebase_Signer::getIdToken(bool createUser, const char *email, const char #elif defined(ESP8266) config->signer.wcs = new WiFiClientSecure(); config->signer.wcs->setInsecure(); - config->signer.wcs->setBufferSizes(512, 512); + config->signer.wcs->setBufferSizes(1024, 1024); #endif config->signer.json = new FirebaseJson(); config->signer.data = new FirebaseJsonData(); @@ -1473,7 +1473,7 @@ bool Firebase_Signer::requestTokens() #elif defined(ESP8266) config->signer.wcs = new WiFiClientSecure(); config->signer.wcs->setInsecure(); - config->signer.wcs->setBufferSizes(512, 512); + config->signer.wcs->setBufferSizes(1024, 1024); #endif config->signer.json = new FirebaseJson(); config->signer.data = new FirebaseJsonData(); @@ -1669,7 +1669,7 @@ bool Firebase_Signer::handleEmailSending(const char *payload, fb_esp_user_email_ #elif defined(ESP8266) config->signer.wcs = new WiFiClientSecure(); config->signer.wcs->setInsecure(); - config->signer.wcs->setBufferSizes(512, 512); + config->signer.wcs->setBufferSizes(1024, 1024); #endif config->signer.json = new FirebaseJson(); config->signer.data = new FirebaseJsonData(); diff --git a/src/signer/Signer.h b/src/signer/Signer.h index fa8085aa5..9e1973d48 100644 --- a/src/signer/Signer.h +++ b/src/signer/Signer.h @@ -1,5 +1,5 @@ /** - * Google's Firebase Token Generation class, Signer.h version 1.1.1 + * Google's Firebase Token Generation class, Signer.h version 1.1.2 * * This library supports Espressif ESP8266 and ESP32 * @@ -65,7 +65,7 @@ class Firebase_Signer friend class FB_RTDB; friend class FirebaseData; friend class QueryFilter; - + public: Firebase_Signer(); ~Firebase_Signer(); @@ -102,7 +102,7 @@ class Firebase_Signer void errorToString(int httpCode, std::string &buff); bool tokenReady(); void sendTokenStatusCB(); - const char* getToken(fb_esp_auth_token_type type); + const char *getToken(fb_esp_auth_token_type type); fb_esp_auth_token_type getTokenType(); std::string getCAFile(); int getCAFileStorage(); @@ -112,7 +112,8 @@ class Firebase_Signer #if defined(ESP8266) void set_scheduled_callback(callback_function_t callback) { - _cb = std::move([callback]() { schedule_function(callback); }); + _cb = std::move([callback]() + { schedule_function(callback); }); _cb(); } #endif