1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-04-21 10:26:06 +03:00

54 Commits

Author SHA1 Message Date
Allman-astyler
eea9999dc5 Revert "Allman now (#6080)" (#6090)
This reverts commit 98125f88605cd7e46e9be4e1b3ad0600dd5d2b51.
2019-05-14 00:09:54 +02:00
Allman-astyler
98125f8860 Allman now (#6080)
* switch restyle script for CI

* remove confirmation

* restyle with allman
2019-05-13 16:41:34 +02:00
david gauchard
e5b4de3633
fix DEBUG macros (#5728)
* fix DEBUG macros

All fmt strings in flash
fix #5658

This also allows to avoid warnings and easy mistakes with (no brace):
    if (something)
        DEBUGV("blah");

* use newlib unaligned-compatible printf for DEBUGV

* remove useless putprintf since ::printf already uses ets_putc
2019-03-14 11:19:21 +01:00
liebman
e46ccae9d5 optionally allow redirects on HTTPClient & OTA updates (#5009)
* optionally allow redirects on http OTA updates

* Refactored HTTPClient::begin(url...) & setURL functions, now only beginInternal parses URL, sets ports
Added HTTPRedirect example.

* fix indentation for style check

* add space after while for style check

* don't use deprecated begin method in redirect example

* moved redirect handling code to HTTPClient.
only GET and HEAD requests are currently handled automatically
Redirects that fail to be automatically handled return the redirect code as before

* added support for POST/303 redirect
added device redirect tests

* add missing getLocation() implementation

* if the new location is only a path then only update the URI
2019-03-13 01:51:17 +01:00
david gauchard
50cbdc0b92 update AddrList and examples (#5422) 2018-12-03 15:15:50 -03:00
Earle F. Philhower, III
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
david gauchard
92373a9837 Deprecate axTLS, update examples (#5366)
* update examples

* fix serial<->tcp example, use STASSID instead of SSID (name collision)

* fix HTTPSRequest.ino

* update AxTLS HTTPS examples, update AxTLS API to deprecated

* fixes

* fixes + fix astyle (no preproc directives) + restyling script

* fix HTTPClient library

* fixes

* common.sh: do not reload arduino when already present (for locally CI testing)

* common.sh: do not reload ArduinoJson when already present (for locally CI testing)

* fix

* fix

* fix deprecated example

* fix WiFiHTTPSServer.ino

* reduce footprint

* wipfix

* fix led builtin

* fix example

* finished updating APSSID on all examples

* style

* restyle examples

* helper to run CI test locally

* local CI runner more verbose

* +const

* deprecation deprecation

* deprecation

* Update NTPClient.ino

const char[] => const char *

* Update interactive.ino

const char[] => const char *
2018-11-29 20:49:27 -08:00
Jeroen88
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
per1234
4e3af9795b Add missing keywords.txt files to bundled libraries (#5183) 2018-09-29 10:48:23 -07:00
david gauchard
85e68093e9
Automatic stack location selection (SYS or HEAP), enable per library AR-chive in arduino build system (#5018)
Automatic stack location selection (SYS or HEAP), enable per library AR-chive in arduino build system 

* enable dot_a_linkage on internal libraries
* add device tests
* boards generator: deprecate --noextra4k/--allowWPS and fix documentation
2018-08-20 14:35:52 +02:00
klucsik
b126a9c526 https fingerprint clue (#4863)
Adding a clue on the https part that yo will definitely need the fingerprint. 
(My first commit)
2018-07-03 00:40:50 -04:00
Earle F. Philhower, III
e3c970210f
Add BearSSL client and server, support true bidir, lower memory, modern SSL (#4273)
BearSSL (https://www.bearssl.org) is a TLS(SSL) library written by
Thomas Pornin that is optimized for lower-memory embedded systems
like the ESP8266. It supports a wide variety of modern ciphers and
is unique in that it doesn't perform any memory allocations during
operation (which is the unfortunate bane of the current axTLS).

BearSSL is also absolutely focused on security and by default performs
all its security checks on x.509 certificates during the connection
phase (but if you want to be insecure and dangerous, that's possible
too).

While it does support unidirectional SSL buffers, like axTLS,
as implemented the ESP8266 wrappers only support bidirectional
buffers. These bidirectional buffers avoid deadlocks in protocols
which don't have well separated receive and transmit periods.

This patch adds several classes which allow connecting to TLS servers
using this library in almost the same way as axTLS:
BearSSL::WiFiClientSecure - WiFiClient that supports TLS
BearSSL::WiFiServerSecure - WiFiServer supporting TLS and client certs

It also introduces objects for PEM/DER encoded keys and certificates:
BearSSLX509List - x.509 Certificate (list) for general use
BearSSLPrivateKey - RSA or EC private key
BearSSLPublicKey - RSA or EC public key (i.e. from a public website)

Finally, it adds a Certificate Authority store object which lets
BearSSL access a set of trusted CA certificates on SPIFFS to allow it
to verify the identity of any remote site on the Internet, without
requiring RAM except for the single matching certificate.
CertStoreSPIFFSBearSSL - Certificate store utility

Client certificates are supported for the BearSSL::WiFiClientSecure, and
what's more the BearSSL::WiFiServerSecure can also *require* remote clients
to have a trusted certificate signed by a specific CA (or yourself with
self-signing CAs).

Maximum Fragment Length Negotiation probing and usage are supported, but
be aware that most sites on the Internet don't support it yet.  When
available, you can reduce the memory footprint of the SSL client or server
dramatically (i.e. down to 2-8KB vs. the ~22KB required for a full 16K
receive fragment and 512b send fragment).  You can also manually set a
smaller fragment size and guarantee at your protocol level all data will
fit within it.

Examples are included to show the usage of these new features.

axTLS has been moved to its own namespace, "axtls".  A default "using"
clause allows existing apps to run using axTLS without any changes.

The BearSSL::WiFi{client,server}Secure implements the axTLS
client/server API which lets many end user applications take advantage
of BearSSL with few or no changes.

The BearSSL static library used presently is stored at
https://github.com/earlephilhower/bearssl-esp8266 and can be built
using the standard ESP8266 toolchain.
2018-05-14 20:46:47 -07:00
Marian Craciunescu
bd87970aae add http client configurable timeout usefull when download is slow on server side (#4705)
* add http client configurable timeout usefull when download is slow from server side

* member init outside constructor body.

* removed this.
2018-05-04 11:18:15 -03:00
Ivan Grokhotkov
61cd8d8385 examples: format all .ino files
This formats all the example source files using Arduino style rules.
2018-03-08 14:32:06 +08:00
liebman
1cd4a00cff Remove compiler warnings (#4043) 2017-12-29 13:14:56 -03:00
Joey Babcock
a71118caeb Improve error messages (#2800)
I was having trouble understanding what some of the serial output meant so I changed it to the best of my ability
2017-12-29 11:49:29 -03:00
James Stanley
2abbc36da4 Put WiFi into station mode in examples (#3731) 2017-10-22 13:53:01 +08:00
Clemens Kirchgatterer
18297458be allows global object instances be switch off with defines (#2344) 2016-08-01 11:21:50 +08:00
sk1tt1sh
9c36ff9932 Fix example for ESP8266httpUpdate (#2251)
* Fix minor typo in spelling of failed. Removed s from http paths.

* add check if we are just updating spiffs to not reboot. example now works with this change.
2016-07-18 19:33:34 +08:00
Jeroen Vogelpoel
edba2d2829 Exposed sketch MD5 through HTTP headers (#2236)
* Exposed sketch MD5 through HTTP headers

* Updated spacing, docs, example
2016-07-08 10:07:21 +08:00
Andronicus Riyono
46fccac3e5 fix bug #1940 2016-04-20 14:09:41 +08:00
Ivan Grokhotkov
a455f22587 HTTPClient, HTTPUpdate: save some RAM by moving strings into flash 2016-04-09 12:46:29 +03:00
Ivan Grokhotkov
bf7f33d918 Fix code formatting 2016-04-09 12:46:29 +03:00
Ivan Grokhotkov
bbc5e9ba01 Update library versions 2016-04-09 12:46:29 +03:00
Ivan Grokhotkov
c450023a32 ESP8266httpUpdate: decouple HTTPS overloads 2016-04-09 12:46:29 +03:00
Markus Sattler
b2a6ab8059 #1499 2016-01-25 21:05:24 +01:00
Markus Sattler
2b23b005aa allow control of enabling debug and debug level from IDE 2016-01-02 12:25:39 +01:00
Markus Sattler
ef748e369a allow downgrade to HTTP 1.0
use HTTP/1.0 for update since the update handler not support any transfer Encoding
2015-12-31 14:02:00 +01:00
Markus Sattler
5a4ced251d add check for magic header of bin before update is started.
see: #1250
2015-12-19 14:39:07 +01:00
Markus Sattler
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
Markus Sattler
28dd31a80f add advanced error handling for HTTP update
see: #1111
2015-12-16 23:05:23 +01:00
Markus Sattler
4dd5d8cf7d allow control of restart on http update
#1202
2015-12-13 23:04:27 +01:00
Markus Sattler
fdadadc787 add default values for updateSpiffs 2015-12-10 12:03:53 +01:00
Markus Sattler
95089b75b9 fix startUpdate always false 2015-12-09 19:56:14 +01:00
Markus Sattler
b1ea7b602e httpUpdate Improve error handling 2015-12-09 16:27:04 +01:00
Markus Sattler
d8e3c766a3 ESP8266HTTPUpdate - improve error displaying 2015-12-06 11:07:25 +01:00
Markus Sattler
95d53c37c3 add httpUpdateSPIFFS.ino example 2015-12-05 20:47:58 +01:00
Markus Sattler
ecce35d240 allow SPIFFS 2015-12-05 20:33:08 +01:00
Ivan Grokhotkov
14f67c4ebc Rename ESP8266httpClient to ESP8266HTTPClient (part 1) 2015-11-30 09:48:07 +03:00
Markus Sattler
ceb8acbb94 typo 2015-11-27 14:08:16 +01:00
Markus Sattler
f115e42105 add httpUpdate.ino example
#1021
2015-11-27 13:55:21 +01:00
Markus Sattler
9f0fdd573f update ESP8266HTTPUpdate to use httpClient class
add support for MD5 check
2015-11-27 13:48:13 +01:00
Ivan Grokhotkov
a2789df2a5 ESP8266httpUpdate: add method overload to allow updates using WiFiClientSecure 2015-11-17 03:13:37 +03:00
Marvin Roger
0b89b9b467 Fix FAILD typo 2015-11-06 14:17:45 +01:00
Marvin Roger
1071e8ada1 Add libraries categories 2015-11-02 19:23:26 +01:00
Markus Sattler
966bf45b35 rename stopAllexcepted to stopAllExcept and simplify the compare 2015-08-29 15:33:41 +02:00
Markus Sattler
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
Kiril Zyapkov
954499bc12 httpUpdate: fix case sensitivity issues
On Linux (presumably Mac too), the header of the library
could not be included, caps changed to match the filename.

The line 'architectures=ESP8266' in library.properties caused:
WARNING: library ESP8266httpUpdate claims to run on [ESP8266] architecture(s) and may be incompatible with your current board which runs on [esp8266] architecture(s).
2015-07-11 12:35:02 +03:00
Markus Sattler
715d4ab722 disable DEBUG_HTTP_UPDATE 2015-07-07 18:07:41 +03:00
Markus Sattler
fdb723cbad Merge remote-tracking branch 'remotes/esp8266/esp8266' into esp8266
Conflicts:
	hardware/esp8266com/esp8266/cores/esp8266/core_esp8266_main.cpp
2015-06-23 13:08:05 +02:00