/* ---------------------------------------------------------------------------- * "THE TSCHUNK LICENSE" (Revision 42): * wrote this file. As long as you retain this notice * you can do whatever you want with this stuff. If we meet some day, and you * think this stuff is worth it, you can buy me a Tschunk in return. * ---------------------------------------------------------------------------*/ #include #include #include #include #ifdef PUBLIC_SIGN_KEY const char pubkey[] PROGMEM = PUBLIC_SIGN_KEY; BearSSL::PublicKey *signPubKey = nullptr; BearSSL::HashSHA256 *hash; BearSSL::SigningVerifier *sign; void signedUpdatesHelperInit() { signPubKey = new BearSSL::PublicKey(pubkey); hash = new BearSSL::HashSHA256(); sign = new BearSSL::SigningVerifier(signPubKey); Update.installSignature(hash, sign); } String signedUpdatesHelperRun(WiFiClient& wifi, const String& url, const String& currentVersion = "") { t_httpUpdate_return ret = ESPhttpUpdate.update(wifi, url, currentVersion); if (ret == HTTP_UPDATE_FAILED) return ESPhttpUpdate.getLastErrorString(); return String(); } #endif