File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11#include " Identity.h"
22#include < string.h>
3+ #include < assert.h>
34#define ED25519_NO_SEED 1
45#include < ed_25519.h>
56
@@ -14,7 +15,14 @@ Identity::Identity(const char* pub_hex) {
1415}
1516
1617bool Identity::verify (const uint8_t * sig, const uint8_t * message, int msg_len) const {
17- return ed25519_verify (sig, message, msg_len, pub_key);
18+ // ed25519_verify uses static buffers internally (ge.c) and is NOT reentrant.
19+ // This guard catches concurrent calls (e.g. from multiple FreeRTOS tasks).
20+ static volatile bool in_verify = false ;
21+ assert (!in_verify && " ed25519_verify is not reentrant - concurrent call detected" );
22+ in_verify = true ;
23+ bool result = ed25519_verify (sig, message, msg_len, pub_key);
24+ in_verify = false ;
25+ return result;
1826}
1927
2028bool Identity::readFrom (Stream& s) {
You can’t perform that action at this time.
0 commit comments