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

57 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
Earle F. Philhower, III
9ec03ed3f6
Move WiFi debug messages to PMEM (#5388)
Save ~1200 bytes in debug mode by making debug strings into PSTRs().
2018-11-29 12:55:40 -08: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
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
Jacob Killelea
303af24467 Spelling correction in comments 2016-03-21 12:42:18 -07:00
Markus Sattler
dec6739e3f add more debug to WiFi 2016-01-08 19:06:28 +01:00
Markus Sattler
fd443d4e17 split ESP8266WiFiClass in different sub classes for better overview. 2015-12-29 14:03:15 +01:00
Markus Sattler
6f00503bc3 add reconnect function for STA 2015-12-28 20:19:36 +01:00
Markus Sattler
cee4ef3078 less static stuff 2015-12-28 20:13:56 +01:00
Markus Sattler
64326f9573 rework mode management
may fixes: #1138
2015-12-28 19:30:56 +01:00
Markus Sattler
d521cea232 reorder part 3 2015-12-28 17:55:38 +01:00
Markus Sattler
20de9a5673 reorder part two 2015-12-28 17:38:58 +01:00
Markus Sattler
49b0821beb reorder part one 2015-12-28 17:22:36 +01:00
Markus Sattler
b1b19299bb mode docu to cpp and make it doxygen compatible 2015-12-28 17:02:09 +01:00
Markus Sattler
09a7940006 code style 2015-12-28 16:36:55 +01:00
Markus Sattler
195e595453 add setSleepMode + getSleepMode and setPhyMode + getPhyMode to WiFi 2015-12-26 13:02:31 +01:00
Martin Ayotte
481d74ba86 add show_hidden argument to scanNetworks() 2015-12-16 12:06:29 -05:00
Ivan Grokhotkov
40da463ee6 ESP8266WiFi library: add persistent option, fix #1054 2015-11-21 20:06:10 +03:00
Markus Sattler
83b452b824 add missing WiFiClientSecure include in ESP8266WiFi.h 2015-11-16 19:28:59 +01:00
Marvin Roger
0b89b9b467 Fix FAILD typo 2015-11-06 14:17:45 +01:00
Martin Ayotte
6436a175c4 add dns_no argument to dnsIP() int ESP8266WiFi class 2015-10-18 14:22:24 -04:00
Martin Ayotte
7f318d72cf add dnsIP() to ESP8266WiFi class 2015-10-18 14:18:14 -04:00
Pascal Gollor
f1dcfb2794 use String return for both SSID functions 2015-10-01 18:52:46 +02:00
Pascal Gollor
0034697b6e use String instead of char pointer for SSID() and psk() 2015-09-30 18:15:53 +02:00
Pascal Gollor
b13095763d add function begin without any parameters and add functin psk to return current pre shared kex form sdk config 2015-09-28 16:48:06 +02:00
Paul Mandel
4719a31898 Rebasing into single commit
Adding getMode function to ESP8266WiFiClass.cpp

Adding getMode function to ESP8266WiFiClass.h

Changing return type of getMode to WiFiMode for clarity

Changing return type of getMode to WiFiMode for clarity

Add return typecast
2015-09-16 09:39:40 -07:00
Ivan Grokhotkov
7bfd425754 Update to SDK 1.3.0 2015-08-10 10:51:09 +03:00
Markus Sattler
fe9ef36861 add softAPdisconnect function ``int softAPdisconnect(bool wifioff = false);``
external mode calls now change the use flags
see #529
2015-07-13 10:50:41 +02:00
Markus Sattler
1aa8e8e6c8 add basic WPS function 2015-07-04 10:30:11 +02:00
Markus Sattler
36a4131f35 allow setting the host name of AP interface 2015-07-04 10:00:27 +02:00
Anwar Hahj Jefferson-George
212a2cfa60 Update ESP8266WiFi.h 2015-06-29 18:04:25 +03:00
Markus Sattler
9a1ff7f70d add WiFi scan Async mode 2015-06-16 18:26:34 +02:00
Ivan Grokhotkov
e6e57a8b81 Better handling of wifi disconnect (#231)
When network interface is down, some nasty things happen, for instance tcp_connect returns without ever calling error callback.
This change adds some workarounds for that: before doing a tcp connect and DNS resolve we check if there is a route available.
Also added a listener for wifi events which stops (aborts) all the WiFiClients and WiFiUDPs when wifi is disconnected. This should
help libraries detect disconnect properly.
2015-06-11 18:01:33 +03:00
chad cormier roussel
7daa6c6b69 Add function overload to config to include DNS
Disable DHCP if using static IP

With dhcp disabled, I noticed about 50% less conncection time
2015-06-03 15:29:25 -04:00
Markus Sattler
f18bb28813 fix bug #343
add __attribute__ to printf functions for better compiler warning handling.
remove ICACHE_FLASH_ATTR, all cpp files are automatic in FLASH (ld script)
2015-05-28 18:58:09 +02:00
Markus Sattler
c415ebe8b4 add function to get the MAC / BSSID as String 2015-05-28 17:31:45 +02:00
Markus Sattler
5a86c20f1e add rssi function of new SDK 1.1.0
fix warning in hexdump and ESP8266WiFiMulti
2015-05-25 09:47:13 +02:00
Ivan Grokhotkov
4fdd546ad5 Fix build 2015-05-24 15:35:18 +03:00
Ivan Grokhotkov
f7dbb35c92 Fix case of WiFi.channel() method 2015-05-22 18:11:09 +03:00
Ivan Grokhotkov
5bdb26ac29 code review 2015-05-22 03:36:04 +03:00
Markus Sattler
bc37b9ea68 ESP8266WiFi extended functions
- begin changes
     allow setting BSSID/MAC and Channel of an AP for faster connection (#261)
     now checks if ssid and passphrase to big
     selecting Wifi mode in better way (fix for #28)

 - ESP8266WiFiMulti uses the new functions to auto select best AP even in a multi AP WiFi network (more the one AP has same SSID)

 - add new functions to get current Connected AP:
     uint8_t * BSSID(void);
     int32_t Channel(void);

 - add new functions to get infos from scanned networks:
     uint8_t * BSSID(uint8_t networkItem);
     int32_t Channel(uint8_t networkItem);
     bool isHidden(uint8_t networkItem);
     bool getNetworkInfo(uint8_t networkItem, const char** ssid, uint8_t * encryptionType, int32_t * RSSI, uint8_t ** BSSID, int32_t * channel, bool * isHidden);
2015-05-21 21:15:54 +02:00
ficeto
93c456602c Merge pull request #23 from Links2004/esp8266
pull markus's changes
2015-05-17 16:45:32 +03:00
Markus Sattler
108a40acfd add support for list of AP connections
- auto select ssid with best signal
 - for debugging enable DEBUG_WIFI_MULTI macro and call Serial.setDebugOutput(true);

change ESP8266WiFiClass::status() return type to wl_status_t
2015-05-16 22:40:53 +02:00
ficeto
66d9dbb070 ESP8266WiFiClass::waitForConnectResult()
waitForConnectResult() waits until wifi status is not disconnected,
unless STA is disabled, in which case it returns WL_DISCONNECTED
2015-05-16 19:00:36 +03:00
ficeto
fbec557ddb Importing my changes 2015-04-30 20:48:50 +03:00
Ivan Grokhotkov
a4536d5935 Minor code style changes 2015-04-30 18:54:16 +08:00
Markus Sattler
483533ac4c add back SmartConfig 2015-04-30 11:44:26 +02:00
Ivan Grokhotkov
4cc06c2100 Add method to configure softAP IP address
fix #76
2015-04-21 20:52:02 +08:00