1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-04-19 23:22:16 +03:00

61 Commits

Author SHA1 Message Date
david gauchard
fc77f2e89c
littlefs: fixes for mock/emulation, use in FSBrowser example (#6211)
* littlefs: fixes for mock/emulation, use in FSBrowser example
* emulation: makefile: integrate arch size into object file names
2019-06-20 23:34:27 +02:00
Tyler Moore
6191fbbd92 Modified ESP8266WebServer (#6020)
-Expose HTTP Digest authentication with H1 hash as the argument
-Preserved HTTP authentication with username/password arguments
-Added a public  static function for generating the H1 hash
-Created an example of how to use this called HttpHashCredAuth.ino
2019-05-23 09:57:51 -07:00
david gauchard
6bd26a3b4a
host emulation: improve udp, persistent spiffs (#5605) 2019-01-15 22:56:54 +01:00
Develo
e9d052c621
WIP - Update ArduinoOTA and examples with MDNS.update() calls (#5494)
* ArduinoOTA: allow use without MDNS, add MDNS.update() in handle()

* Update examples with MDNS.update() in loop

* Update CaptivePortalAdvanced.ino

Fix typo

* Update CaptivePortalAdvanced.ino

astyle

* Update Arduino_Wifi_AVRISP.ino

astyle
2018-12-14 03:29:32 -03: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
Earle F. Philhower, III
233d3e3b5e
Move BearSSLHelpers into BearSSL namespace (#5315)
BearSSLX509List, BearSSLSession, BearSSLPublicKey, and BearSSLPrivateKey
were all in the global namespace and not in the BearSSL:: one, due to an
oversight when they were originally created.  Move them to the proper
namespace with the following mapping:
    BearSSLX509List => BearSSL::X509List
    BearSSLSession => BearSSL::Session
    BearSSLPublicKey => BearSSL::PublicKey
    BearSSLPrivateKey => BearSSL::PrivateKey
2018-11-06 19:27:40 -08:00
daud
678c7beab5 fix typo (#5189) 2018-09-30 14:28:13 -03: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
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
Earle F. Philhower, III
f9ac524b13
Add -Werror to acceptance builds for C and CPP (#4369)
Use platform.local.txt to add -Werror to GCC for the build of all
code.  Any warnings on a submitted patch will cause an error.

Several examples and libraries had warnings/errors (missing returns
on functions, types, etc.).  Clean those up with this commit as well.
2018-02-17 18:47:10 -08:00
Earle F. Philhower, III
bd1c7ce1dc Add SSL enabled WiFiServer, Updater, WebServer
Adds SSL server mode for WiFiServerSecure, for plain SSL connections,
ESP8266WebServerSecure, for HTTPS web serving, and SecureHTTPSUpdater for
encrypted OTA updates.

Example code is provided for all new options, as well as a BASH script for
generating their own, self-signed certificates.

Both ESP8266WebServerSecure and SecureHTTPSUpdater are important for secure
password-based authentication.  HTTP Basic Authentication, the only supported
model presently, sends the username and password in *cleartext* and therefore
should *never* be used in any un-SSL encrypted channel unless you don't mind
sharing your login and password with anyone else on the internet.  Even if the
ESP8266 is not safety critical, this cleartext broadcast could expose you should
you reuse this password elsewhere on your network or the internet.
2018-01-10 11:56:32 +08:00
James Stanley
2abbc36da4 Put WiFi into station mode in examples (#3731) 2017-10-22 13:53:01 +08:00
Ahmed El Sharnoby
eebc5ec593 Digest Authentication in Webserver Library (#3053)
* Add Digest Auth

* Check for Opaque and Nonce

* Remove Serial Debug and fix Indentation

* Added example sketch with documentation,Fixed indentation and Defaults

* Digest Authentication minor changes + new padded 32 digit random function

* update license to public domain

* renaming functions
2017-09-18 05:31:32 -05:00
Me No Dev
6390cf6bd6 Chunked encoding (#2199)
* Add chunked encoding

example:
```cpp
  server.on("/chunked", HTTP_GET, [](){
    server.send(200, "text/html", String());
    server.sendContent("<!DOCTYPE html><html><head><title>Chunked
Test</title></head><body>");
    server.sendContent("<p>Chunk 1</p>");
    server.sendContent("<p>Chunk 2</p>");
    server.sendContent("<p>Chunk 3</p>");
    server.sendContent("<p>Chunk 4</p>");
    server.sendContent("<p>Chunk 5</p>");
    server.sendContent("<p>Chunk 6</p>");
    server.sendContent("</html>");
    server.sendContent("");//end of chunked
  });
```

* update examples, keep setContentLength and add bool _chunked

* fix wrong session id

* set _chunked to false earlier for cases where users use only sendContent
2016-06-28 14:35:12 +08:00
Ivan Grokhotkov
00429e833d Merge pull request #1772 from gmag11/patch-2
Add more file types handling
2016-03-24 00:59:49 +03:00
gmag11
18d984a9aa Add more file types handling
Add correct handling for *.json *.h *.html and *.ico
2016-03-14 14:00:57 +01:00
gmag11
9f2e173e84 Update index.html
Fix context menu due to wrong variable name "event" --> "e"
2016-03-14 13:57:07 +01:00
Me No Dev
bda06d686c Add HTTP Basic Auth to WebServer and libb64 (base64) to core 2015-11-30 03:37:47 +02:00
Markus Sattler
a27029cbc5 see #395
server.send() already injects the "Connection" and "Access-Control-Allow-Origin" headers.
No point in doing that twice. (browsers could get confused)
2015-11-27 09:47:06 +01:00
Me No Dev
0063d80c74 "Fix" sketches and libs to use the new upload api 2015-11-19 23:20:03 +02:00
Ivan Grokhotkov
0772a69b1c Merge pull request #913 from me-no-dev/esp8266
Add SPIFFS WebServer Example
2015-10-28 14:54:31 +03:00
luc
ee0b8621f3 Add header access using same method as arguments 2
based on @brianensor PR
+sample and some sanity check
2015-10-28 13:58:53 +08:00
Me No Dev
4c078799ca Add SPIFFS WebServer Example 2015-10-21 14:09:55 +03:00
Ivan Grokhotkov
41fbe93560 AdvancedWebServer: remove mDNS from loop as well 2015-09-01 01:09:21 +03:00
Ivan Grokhotkov
143f29bc29 Fix mDNS library usage in ESP8266WebServer examples 2015-09-01 00:58:27 +03:00
Ivan Grokhotkov
496da02f14 Verify sketches as part of travis build
Squashed commits:
[7d1b42f] Encrypt token, skip some tests
[17b8f39] Fix sha1 example path
[f3050b1] Fix build, add webhook
[fd2c9bd] Fix build errors, update mDNS library readme
[7b87031] Make common.sh more flexible
[3ba3eb2] Test all sketches
[87beb8a] Build all sketches in esp8266 core
[f2464f1] Fix paths
[823a9ae] Remove sudo usage
[7fce734] Fix arduino commands
[619bc7d] Move all commands into travis script
[15a5ada] First attempt test runner
2015-07-23 16:06:07 +03:00
John Doe
703ab8df64 make Update erase/write sector by sector as well 2015-07-06 12:34:55 +03:00
John Doe
9d0a690421 fix WebUpload example 2015-07-06 12:34:36 +03:00
John Doe
7596ed0742 inlining and enchancements 2015-07-06 12:34:09 +03:00
John Doe
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
John Doe
a409ce2e6b fix example not working on firefox 2015-06-12 20:31:09 +03:00
John Doe
fe562e6785 fix sd example returning bad json on empty folder 2015-06-09 01:34:59 +03:00
Ivan Grokhotkov
db1e033186 Remove SPIFFS wrapper 2015-05-23 10:13:59 +03:00
Ivan Grokhotkov
3422294a7f Fix typo 2015-05-22 18:16:44 +03:00
Ivan Grokhotkov
8fdb824e11 Add setContentLength method to web server, update examples
related to #304
2015-05-22 17:57:30 +03:00
ficeto
2e6fe502a4 Add File System Server Example
Serve files from the onboard flash
Edit them with the included file manager (http://esp8266fs.local/edit)
Create simple graphs filled with sensor data with the included simple
library (example is the index page, editable through the editor)
The sketch uses the new extension for packing files into SPIFFS image
and uploading it to your ESP8266
2015-05-21 21:23:14 +03:00
Matt Jenkins
5401d758f6 Merge branch 'esp8265' of https://github.com/esp8266/Arduino into esp8266 2015-05-14 13:31:59 +01:00
Ivan Grokhotkov
3c9d1f20bb Merge branch 'ficeto-esp8266' into esp8266
* ficeto-esp8266:
  add template methods for stream to stream writes to SD and FS
  alignment not needed. we use fixed addresses
  Rework SPIFFS API to be more Arduino like
  fix missed edits
  disable automount
  fix SPIFFS to work
  pull get/set NoDelay for WiFiClient
  Add SPIFFS Support
  export sketch data folder to the build config
  Revert "Revert "Edit SD Server example to use the new Write(Stream) method""
  add template client write
  Revert "Add WiFiClient.write for Stream"
  Revert "Edit SD Server example to use the new Write(Stream) method"
  Edit SD Server example to use the new Write(Stream) method
  Add WiFiClient.write for Stream
  make upload callback packets aligned to defined size

Conflicts:
	hardware/esp8266com/esp8266/libraries/ESP8266WebServer/examples/SDWebServer/SDWebServer.ino
	hardware/esp8266com/esp8266/libraries/ESP8266WebServer/src/ESP8266WebServer.cpp
	hardware/esp8266com/esp8266/libraries/ESP8266WebServer/src/ESP8266WebServer.h
2015-05-14 14:38:22 +03:00
Ivan Grokhotkov
36d0968ada Web server refactoring 2015-05-14 13:33:12 +03:00
Matt Jenkins
46391b60e6 Merge branch 'esp8266' of https://github.com/esp8266/Arduino into esp8266 2015-05-14 11:31:09 +01:00
ficeto
cde17ac259 Merge pull request #19 from esp8266/esp8266
pull latest changes
2015-05-14 11:48:36 +03:00
Ivan Grokhotkov
ce73ac216b fix SDWebServer sample 2015-05-14 02:47:39 +03:00
ficeto
8d1c59842e Revert "Revert "Edit SD Server example to use the new Write(Stream) method""
This reverts commit 163a98375637ab8e3e177bb7853303e397e39dc0.
2015-05-13 12:48:14 +03:00
ficeto
2f45612bb8 Revert "Edit SD Server example to use the new Write(Stream) method"
This reverts commit 4ae8a6d631d532409dde5ea35af03bccbb62974f.
2015-05-13 12:15:52 +03:00
ficeto
30228c3641 Edit SD Server example to use the new Write(Stream) method 2015-05-13 12:09:34 +03:00
Matt Jenkins
6f22f15e4d Merge branch 'esp8266' of https://github.com/esp8266/Arduino into esp8266 2015-05-12 20:39:05 +01:00
Matt Jenkins
bf2c3d04e2 Added advanced web server demo 2015-05-12 20:13:48 +01:00
Ivan Grokhotkov
89248032d6 Merge branch 'esp8266' of https://github.com/ficeto/Arduino into esp8266
Conflicts:
	hardware/esp8266com/esp8266/libraries/ESP8266WebServer/examples/SDWebServer/SDWebServer.ino
2015-05-12 18:58:10 +03:00
Ivan Grokhotkov
699b06b875 implement async replies in mDNS library
No need to call mdns.update() from loop() any more.
2015-05-12 17:59:24 +03:00
ficeto
1f657fab73 plaintext POST fixes and rework of the SD example
Added a single file web editor/browser/uploader and all needed methods
to work with the files on the SD Card
2015-05-11 13:43:26 +03:00