Skip to content

Commit c5f60e3

Browse files
Allocate BSSL stack for SigningVerifier (#7291)
The BearSSL SigningVerifier was moved to the 2nd stack because some uses required much more stack than available on the normal stack. Add a reference to the second stack on object creation (which will allocate it, if there is no BSSL stack already allocated), and delete that reference on exit. Fixes #7288
1 parent 157ce57 commit c5f60e3

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

libraries/ESP8266WiFi/src/BearSSLHelpers.h

+3-1
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
#define _BEARSSLHELPERS_H
2525

2626
#include <bearssl/bearssl.h>
27+
#include <StackThunk.h>
2728
#include <Updater.h>
2829

2930
// Internal opaque structures, not needed by user applications
@@ -157,7 +158,8 @@ class SigningVerifier : public UpdaterVerifyClass {
157158
virtual bool verify(UpdaterHashClass *hash, const void *signature, uint32_t signatureLen) override;
158159

159160
public:
160-
SigningVerifier(PublicKey *pubKey) { _pubKey = pubKey; }
161+
SigningVerifier(PublicKey *pubKey) { _pubKey = pubKey; stack_thunk_add_ref(); }
162+
~SigningVerifier() { stack_thunk_del_ref(); }
161163

162164
private:
163165
PublicKey *_pubKey;

0 commit comments

Comments
 (0)