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

41 Commits

Author SHA1 Message Date
Ivan Grokhotkov
ddda374985 WiFiClientSecure: don't trash unread decrypted data when writing (#4024)
* WiFiClientSecure: don't decrypt when testing for 'connected'

* WiFiClientSecure: don't trash unread decrypted data when writing

When application requests to write data, check if there is any unread
decrypted data left. If there is, don't write immediately, but save the
data to be written. When all decrypted data has been consumed by the
application, send out the saved outgoing data.

Fixes https://github.com/esp8266/Arduino/issues/2256.
2017-12-26 11:28:18 -03:00
Ivan Grokhotkov
526f4fbb6c WiFiClientSecure: add option to allow self-signed certificates
Mainly useful for testing WiFiClientSecure in local environments.

If allowSelfSignedCerts is called before verifyCertChain, then the
certificate chain will be verified, but the final certificate may be
self-signed.
2017-10-08 07:08:51 +08:00
Ivan Grokhotkov
84b046f98c WiFiClientSecure: add support for keys and certificates in PROGMEM 2017-10-08 05:04:04 +08:00
Ivan Grokhotkov
507a15910e WiFiClientSecure: display certificates when debugging is enabled 2017-10-02 00:27:22 +08:00
Earle F. Philhower, III
8f04be4c5b Remove unused ax_port_*alloc() functions (#3482)
The ax_port_malloc, ax_port_calloc, ax_port_realloc, and ax_port_free
functions in WiFiClientSecure are not actually used by the AXTLS library.
It's directly using the library routines, and these function are never
used.  Remove these dead bits of code to make the axtls operation clearer.
2017-08-01 18:38:35 +03:00
Ivan Grokhotkov
8c3bb69530 WiFiClientSecure: don’t send close alert when opening new session
When WiFiClientSecure::connect was called, it would first tear down and
existing and set up new TCP session, then tear down existing TLS session
(using ssl_free), and then set up a new one. This caused TLS close-
notify alert to be sent to the new TCP session, preventing new session
from being established. This change postpones setting IO ctx to the new
TCP connection, fixing this issue.

Ref https://github.com/esp8266/Arduino/issues/3330
2017-06-05 17:30:57 +08:00
Ivan Grokhotkov
f6d232f1ac WiFiClientSecure: match CN and SANs ignoring case
Some websites have certificates with uppercase letters in CN. This change
makes _verifyDN function accept such certificates by converting all names
to lower case before comparing them.

Resolves #2978
2017-05-21 22:00:33 -05:00
Ivan Grokhotkov
79cfad5d46 WiFiClientSecure: initialize ssl_ctx when loading certificate
Fixes #2470
2017-05-21 22:00:33 -05:00
Trygve Laugstøl
2d9e767630 Fixing a few compiler warnings to allow compilation with -Wall -Wextra and -Werror. (#3153) 2017-05-08 04:56:08 -05:00
Ivan Grokhotkov
c5c138ec5a axtls: update to bddda2a0
- update ssl_client_new signature
- add max fragment length negotiation support (hardcoded to 4096 bytes)
- build axtls with -f{function,data}-sections, ~1k less DRAM usage,
  ~3k less flash
- strip prefix from build paths in debug symbols
2017-04-29 22:58:19 +08:00
Frank Sautter
af58a74cc0 Allow usage of byte arrays to set RootCAs (#2968) 2017-02-15 14:22:23 +03:00
Rodion Kvashnin
2126146e20 Fix warnings (#2881)
* Suppressed -Wunused-parameter and -Wunused-function by casting to void unused identifiers.

* Explicit initialization of all fields to suppress -Wmissing-field-initializers.

* Fixed signed/unsigned integer comparison.

* memset initialization of structs.

* More -Wunused-parameter fixes.
2017-01-31 10:07:59 +03:00
Ivan Grokhotkov
b41266097f WiFiClientSecure: certificate loading refactoring, support for CA root cert verification 2016-08-25 13:01:10 +08:00
Me No Dev
45f177f985 weaken axTLS methods so they can be overwritten by the async library (#2423) 2016-08-23 01:11:06 +03:00
Ivan Grokhotkov
8db4dcea42 WifiClient::write refactoring (second attempt) (#2177)
* WiFiClient: use DataSource for writes

* ESP8266WebServer: delegate writing to WiFiClient

* ESP8266WebServer: set write timeout before sending content
2016-06-23 17:47:18 +08:00
Ivan Grokhotkov
e64e32b329 Fix regression in WiFiClientSecure, update HTTPS test case (#2150) 2016-06-15 11:49:51 +08:00
Ivan Grokhotkov
43412970ae Fix for crash in WiFiClientSecure when WiFi is disconnected (#2139)
* WiFiClient: implement stopAll() via stop()

* WiFiClientSecure: clean up ClientContext used by axTLS when stop is called (#2097)
2016-06-13 18:36:30 +08:00
Ivan Grokhotkov
e8b8a606e4 Update axTLS to 139914f
- Fix occasional software WDT due to lengthy bigint operations
- Implement truly blocking reads as a workaround for half-duplex nature of axTLS
2016-05-10 23:34:33 +08:00
Ivan Grokhotkov
8c65f2fcd0 Update axTLS to fe4518d, SNI support in WiFiClientSecure (#1285)
Fixes #1933
2016-04-19 08:29:13 +03:00
Ivan Grokhotkov
2c40d82459 WiFiClientSecure: implement connection timeout, fix connected method behaviour 2016-03-02 16:30:32 +03:00
Ivan Grokhotkov
fbe58b7b14 WiFiClientSecure: don't panic if memory allocation fails
If it fails due to a malloc somewhere in bigint.c, we will still crash (although with a less obvious crash message). If it fails in increase_bm_data_size, axTLS will handle this and report that connection has been aborted. This error will be passed on to the user, so that an application can recover and attempt to reconnect.
2016-02-26 18:41:27 +03:00
Ivan Grokhotkov
fcf9c0d7ce Verify domain name in WiFiClientSecure::verify 2016-02-26 18:41:27 +03:00
Ivan Grokhotkov
ce1b64bc43 Merge pull request #1320 from alltheblinkythings/SerialInterframeFixes
Fixes for poor HardwareSerial performance/crashes exacerbated by SDK1.5
2016-01-04 21:26:59 +08:00
Markus Sattler
2b23b005aa allow control of enabling debug and debug level from IDE 2016-01-02 12:25:39 +01:00
Christopher Pascoe
2375fb0f86 Cleanup: remove unused includes of cbuf.h. 2015-12-29 12:25:24 -05:00
George Talusan
c3de2851c0 fix undefined DEBUG_TLS_MEM_PRINT hiding return statement 2015-12-27 21:36:48 -05:00
Markus Sattler
5333ebfed7 add function peekBytes to WiFiClient/WiFiClientSecure to allow to peek multiple bytes if possible 2015-12-19 14:37:36 +01:00
asez73
4be40bc5fa Skip ':' inside SHA1 signatures in WiFiClientSecure.cpp .
Improves the convenience of the verification of fingerprints.
As ':' are commonly inserted by web browser inside the SHA1 of https web sites, this created false problems with signatures "not matching".
Now, copied and pasted signature from Firefox simply because the verify function will skipped them...
2015-12-15 11:41:29 +01:00
Christopher Pascoe
a7609bce35 Remove double include of cbuf.h. 2015-12-09 22:17:50 -08:00
Ivan Grokhotkov
5cd42a0316 WiFiClientSecure: don't trash certificate and private key on stop() 2015-12-09 09:23:47 +03:00
Ivan Grokhotkov
14b70e9328 Allow setting client side TLS key and certificate 2015-12-04 19:02:46 +03:00
Me No Dev
a44632b8cf make compiler happier 2015-11-25 18:11:16 +02:00
Ivan Grokhotkov
8bf1e98f24 Improve debug output on critical errors 2015-11-21 20:04:38 +03:00
Ivan Grokhotkov
e9f0ea2afe WiFiClientSecure: handle full size TLS fragments (#43)
- free up some memory by getting rid of intermediate buffer
- libaxtls: update to 6830d98
    - allocate plaintext buffer in two stages: 4*MSS initially, grow to 16k after handshake
    - free certificate data after handshake is complete
    - preallocate some structures to reduce memory fragmentation
2015-11-17 02:47:57 +03:00
Ivan Grokhotkov
77428baddc WiFiClientSecure rx overflow fixes
- Increase plaintext rx buffer size to 4096
- Request more data from axtls only when rx buffer is empty
2015-11-15 22:38:06 +03:00
Ivan Grokhotkov
810ab68ae5 Fix WiFiClientSecure::connected (#43)
thanks @whyameye
2015-11-09 01:37:22 +03:00
Ivan Grokhotkov
ebdaedff4b More error checks in WiFiClientSecure 2015-09-28 19:32:45 +03:00
Ivan Grokhotkov
5387b2286e WiFiClientSecure::available fix
Attempt to read data from SSL engine inside WiFiClientSecure::available() if RX buffer is empty.
Fix #784.
2015-09-16 16:24:52 +03:00
Ivan Grokhotkov
f73d414f38 WiFiClientSecure: add certificate fingerprint verification (#43) 2015-09-14 10:22:54 +03:00
Ivan Grokhotkov
098c71ca02 Improve receive handling in TLS support (#43) 2015-09-13 22:49:30 +03:00
Ivan Grokhotkov
9a2f2f2849 Add axTLS, first draft of WiFiClientSecure (#43) 2015-09-01 15:45:12 +03:00