Skip to content

Commit a1843c8

Browse files
committed
Hints from @earlephilhower
1 parent 0f1b7ce commit a1843c8

File tree

3 files changed

+14
-10
lines changed

3 files changed

+14
-10
lines changed

cores/esp8266/Updater.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,10 @@
1010
#endif
1111

1212
#if ARDUINO_SIGNING
13+
namespace BearSSL {
1314
extern UpdaterHashClass& hash;
1415
extern UpdaterVerifyClass& sign;
16+
}
1517
#endif
1618

1719
extern "C" {
@@ -36,7 +38,7 @@ UpdaterClass::UpdaterClass()
3638
, _progress_callback(nullptr)
3739
{
3840
#if ARDUINO_SIGNING
39-
installSignature(&hash, &sign);
41+
installSignature(&BearSSL::hash, &BearSSL::sign);
4042
#endif
4143
}
4244

libraries/ESP8266WiFi/src/BearSSLHelpers.cpp

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
2121
*/
2222

23+
#include "BearSSLHelpers.h"
2324
#include <memory>
2425
#include <vector>
2526
#include <bearssl/bearssl.h>
@@ -28,7 +29,10 @@
2829
#include <string.h>
2930
#include <Arduino.h>
3031
#include <StackThunk.h>
31-
#include "BearSSLHelpers.h"
32+
#include <Updater_Signing.h>
33+
#ifndef ARDUINO_SIGNING
34+
#define ARDUINO_SIGNING 0
35+
#endif
3236

3337
namespace brssl {
3438
// Code here is pulled from brssl sources, with the copyright and license
@@ -901,13 +905,12 @@ make_stack_thunk(br_ssl_engine_sendrec_buf);
901905
#endif
902906

903907
#if ARDUINO_SIGNING
904-
namespace {
905-
static PublicKey signPubKey(signing_pubkey);
906-
static HashSHA256 __hash;
907-
static SigningVerifier __sign(&signPubKey);
908-
}
909-
extern UpdaterHashClass& hash = __hash;
910-
extern UpdaterVerifyClass& sign = __sign;
908+
static PublicKey signPubKey(signing_pubkey);
909+
static HashSHA256 __hash;
910+
static SigningVerifier __sign(&signPubKey);
911+
912+
UpdaterHashClass& hash = __hash;
913+
UpdaterVerifyClass& sign = __sign;
911914
#endif
912915

913916
};

libraries/ESP8266WiFi/src/BearSSLHelpers.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626
#include <bearssl/bearssl.h>
2727
#include <Updater.h>
2828

29-
3029
// Internal opaque structures, not needed by user applications
3130
namespace brssl {
3231
class public_key;

0 commit comments

Comments
 (0)