-
Notifications
You must be signed in to change notification settings - Fork 13.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use 2nd stack for update signature verification #7149
Conversation
Fixes esp8266#7145 When doing a signed update, the signature calculation can use a lot of stack, so move it silently to the BearSSL second stack. Also fix a memory leak of signature-bytes found by @JiriBilek
Apologies for a silly question: how can I test it? Is it fine just to get and replace changed files in my nearly-up-to-date repository copy? |
You can try that, or use the GIT method described here: |
Tested on my application, the stack size remains the same before and after the update (not a big surprise, though), no crashes so far. |
I found this issue while debugging OTA signature verification problems. This PR seems to break the signed OTA updates for me. It seems to be stuck right after calling After this patch it works fine again: @@ -899,7 +899,7 @@
bool SigningVerifier::verify(UpdaterHashClass *hash, const void *signature, uint32_t signatureLen) {
if (!_pubKey || !hash || !signature || signatureLen != length()) return false;
-#if !CORE_MOCK
+#if CORE_MOCK
return thunk_SigningVerifier_verify(_pubKey, hash, signature, signatureLen);
#else
return SigningVerifier_verify(_pubKey, hash, signature, signatureLen); I don't know if that is directly related with this PR, otherwise I can open an issue. |
Please open a new issue and follow the template instructions. |
Fixes #7145
When doing a signed update, the signature calculation can use a lot of
stack, so move it silently to the BearSSL second stack.
Also fix a memory leak of signature-bytes found by @JiriBilek