1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-07-11 15:22:13 +03:00
Commit Graph

30 Commits

Author SHA1 Message Date
98125f8860 Allman now (#6080)
* switch restyle script for CI

* remove confirmation

* restyle with allman
2019-05-13 16:41:34 +02:00
14f1b1d4a7 Add progress callback to Updater class. (#5754)
* Add progress callback to Updater class.

This is a backport of the same functionality in the ESP32 core.

* Add progress callback to Updater class.

* Add typedef for callback function.

* Fixed initializing order.

* Added missing include (functional).
2019-02-16 23:45:24 -03:00
d8acfffdb0 Add cryptographically signed update support (#5213)
Using a pluggable architecture, allow updates delivered via the Update
class to be verified as signed by a certificate.  By using plugins, avoid
pulling either axTLS or BearSSL into normal builds.

A signature is appended to a binary image, followed by the size of the
signature as a 32-bit int.  The updater takes a verification function
and checks this signature using whatever method it chooses, and if it
fails the update is not applied.

A SHA256 hash class is presently implemented for the signing hash (since
MD5 is a busted algorithm).

A BearSSLPublicKey based verifier is implemented for RSA keys.  The
application only needs the Public Key, while to sign you can use
OpenSSL and your private key (which should never leave your control
or be deployed on any endpoints).

An example using automatic signing is included.

Update the docs to show the signing steps and how to use it in the
automatic and manual modes.

Also remove one debugging line from the signing tool.

Saves ~600 bytes when in debug mode by moving strings to PMEM

Windows can't run the signing script, nor does it normally have OpenSSL
installed.  When trying to build an automatically signed binary, warn
and don't run the python.
2018-12-02 19:57:47 -08:00
9fb4a05d67 Fix led-pin in updater, also no need to backup LED state (#5217) 2018-10-08 07:02:27 -07:00
13f374666d Add WiFiClient parameter to HTTPClient (#4980)
Make HTTPClient take a WiFiClient parameter, allowing you to pass in a
simple HTTP WiFiClient or a BearSSL or axTLS WiFiClientSecure with
any desired verification options.  Deprecate the older, TLSTraits methods.
Add basic HttpsClient example.

Add optional LED feedback to the Update class
2018-10-06 07:50:03 -07:00
d5c43f0102 Utilized UPDATE_ERROR_ERASE, added _setError function and refactored code (#4190)
* Added _setError function in the header file

_setError function wraps a few lines to eliminate repetitiveness when debugging for errors.

* Added _setError function

_setError function wraps a few lines to eliminate repetitiveness when debugging for errors.
2018-01-18 13:34:35 -03:00
4b319d9b0c UpdaterClass::printError now accepts the Print object 2018-01-08 18:35:27 +08:00
01e1c586cb Updater: if low on heap memory, use smaller write buffer 2017-05-09 06:17:06 -05:00
9b0ad39e94 Updater: check boot mode before starting update
ref. https://github.com/esp8266/Arduino/issues/1017
2017-05-09 06:17:06 -05:00
063e4cc88f Add tests for MD5Builder, reformat and clean up code 2016-06-13 12:47:33 +08:00
2f933e20fa Make Updater be able to run inside async callbacks (#2096) 2016-06-05 18:00:10 +08:00
995f02f437 add more debug levels 2016-01-02 12:54:34 +01:00
fa7f7bde81 add _verifyHeader and _verifyEnd
_verifyHeader is called before the beginning of the update progress to verify the first byte using peek
_verifyEnd is called on the end before the eboot command is written to verify first byte + flash config

add missing _reset() on timeout
2015-12-20 12:45:36 +01:00
53e01932d3 add magic byte check for Update class
Note: only check of first 0xE9 possible.
2015-12-20 11:46:00 +01:00
02e6b2fc16 setMD5 has now returns bool
handle setMD5 failed in HTTP update
reset UpdaterClass when MD5 check failed
see: #1244
2015-12-18 08:30:35 +01:00
b2de8735c8 check current flash before starting update, to avoid update problems.
see: #1111
2015-12-16 19:45:55 +01:00
68a406274a add parameter name to h for better reading 2015-12-05 17:16:53 +01:00
92069e657b Replace some manually managed buffers with Strings, fix code style 2015-11-11 01:07:02 +03:00
a8976a01fd Add MD5 to core, Fix OTA examples and Digest Authentication to OTA and espota.py 2015-11-09 00:42:30 +02:00
e613e42249 Fix example sketch, espota output and failing updater
I get 100% success with OTA now
2015-11-08 02:01:12 +02:00
f54386e1c0 update UpdaterClass to flashing SPIFFS image 2015-09-18 16:44:10 +02:00
a3bc0e924b revert some space auto formatting 2015-08-29 13:56:03 +02:00
8e50cdb190 Updater.cpp:
- use new AutoInterruptLock
 - add delay to give the RTOS some time to handle TCP

WiFiClient.cpp
 - add stopAllexcepted to cancel all TCP excepted one

ClientContext.h
 - add getLocalPort()

ESP8266HTTPUpdate.cpp
 - close all not needed TCP and UDP

osapi.h
 - missing commit from SDK
2015-08-29 13:45:58 +02:00
b500a1f26a Made changes to allow the compiler to compile without warnings. 2015-08-09 14:10:20 -05:00
5763dbba3b Code review 2015-07-06 21:04:08 +03:00
1741bc68b6 speed :) and prevent write if we are not running 2015-07-06 12:35:35 +03:00
7596ed0742 inlining and enchancements 2015-07-06 12:34:09 +03:00
0d969e9760 Fixes and HTTP Post update example
Because eboot first erases the space required for the new sketch, and
if the new sketch is larger then the old one, with the old way, part of
the beginning of new sketch will be deleted. Therefore for now I opted
to keep the max update size either half the available space for
sketches or what's left from the first one, whichever is smaller.
To be able to create a simple post mechanism for updates, I needed to
have a way to write the new binary, without knowing it's final size, so
I added an option to the end() method. Example in the WebServer
examples.
2015-07-06 12:32:28 +03:00
3427299065 minor enchancement 2015-07-06 12:32:04 +03:00
6f2069deac New Update library, example, upload and more
Proper error handling in the uploading python script
Much faster OTA example sketch with better results
New Update class that simplifies updating the firmware from any source
Updated Esp.updateSketch() to use the new class
2015-07-06 12:31:24 +03:00