forked from esp8266/Arduino
-
Notifications
You must be signed in to change notification settings - Fork 2
Patch 1 #2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Patch 1 #2
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
String's destructor does the same as the 'invalidate' method.
+ interactive example (for debugging)
… server side (esp8266#4705) * add http client configurable timeout usefull when download is slow from server side * member init outside constructor body. * removed this.
…rn SSL (esp8266#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.
Clarify the folder of the git installation method for Mac
Arduino builds are now taking 49 minutes or more, and failing due to Travis timeouts. Split the Arduino build task into even and odd half, where each job will build every other test. This will reduce any test's runtime by 50% and speed up checks to avoid the timeout.
The SSL pipeline is multi-stage, and the TCP connection can go down even though there is still data waiting to be decrypted or in the decryption buffer. Explicitly check that there if there can be any data made available to the app, and if so report that we are still connected(). When there is no data and there is no TCP connection, report disconnected.
When the TCP socket is closed there may be some data left in the BearSSL internal buffers which can be read by the application. The BearSSL pump, however, would always return no data available in the case the socket was disconnected before checking if the SSL was in a state where the app could possibly read. Fix by returning if the state is available, even if the connection is gone. Eventually no more data will become available to read and the original -1 will be returned. This should match the existing axTLS ::connected() behavior.
Simple git submodule and makefile for building the bearssl library from source in the Arduino tree.
* interactive example: update with option for using DHCP again after using static IP * lwip2: avoid crash when IP address is set to 0(any) by dhcp not getting its lease renewal in due time * lwip2: automatically remove oldest PCBs in time-wait state, limit their number thanks to @me-no-dev esp8266@07f4d4c#diff-f8258e71e25fb9985ca3799e3d8b88ecR399 * faq: update about tcpCleanup() * lwip2: add a macro HAS_PHY_CAPTURE=1 indicating capture facility is available
Remove and rewrite all the parts of the core/libraries using TIMER1 and consolidate into a single, shared waveform generation interrupt structure. Tone, analogWrite(), Servo all now just call into this shared resource to perform their tasks so are all compatible and can be used simultaneously. This setup enables multiple tones, analogWrites, servos, and stepper motors to be controlled with reasonable accuracy. It uses both TIMER1 and the internal ESP cycle counter to handle timing of waveform edges. TIMER1 is used in non-reload mode and only edges cause interrupts. The interrupt is started and stopped as required, minimizing overhead when these features are not being used. A generic "startWaveform(pin, high-US, low-US, runtime-US)" and "stopWaveform(pin)" allow for further types of interfaces. Minimum high or low period is ~1 us. Add a tone(float) method, useful when working with lower frequencies. Fixes esp8266#4321. Fixes 4349.
When a message is sent by the app that is larger than the SSL buffer, it will take multiple TLS fragments to transfer. Writes will loop through and not return until either all data is transferred or there is an error.
Due to popular demand, remove the hardcoded dependency on SPIFFS or SD from the CertStore by factoring out the file interface into a new class (CertStoreFile) that the user will need to implement as a thin wrapper around either a SPIFFS.file or a SD.file Combine the downloaded certificates into a UNIX "ar" archive and parse that on-the-fly to allow easy inspection and creation of the Cert Store database. Examples updated with a new certificate downloader that creates the certs.ar archive and with a single sample that can be built for either SPIFFS or SD with a #define. Users can copy the implementation of the CertStoreFile they need to their own code as it is self-contained. Also move the CertStore to the BearSSL namespace and remove the suffix and separate SPIFFS/SD sources. Remove the "deep+" change from the CI build as well (no special options needed on any PIO or makefile build). We'll revisit the filesystem wrapper for 2.5.0, hopefully having a unified template for both filesystem usage at a global level. For current users, be aware the interface may change (simplify!) in release 2.5.0. Fixes esp8266#4740
* Scheduled Interrupt * use capital letter for Schedule.h * Prevent memory leak when attach is called multiple times without detach * Add improved schedule_function * WIP : Integrate FunctionalInterrupt & ScheduledInterrupt * Fix travis error
* Instructions update added correction for Windows 10 git install directory * Update installing.md * Update installing.rst * Reminder for VisualMicro install clarifications * tidy up links markup works differently in rst vs md * formatting cleanup * corrected default sketch directory the default Arduino Sketchbook directory is C:\users\{username}\Documents\Arduino (thanks @Juppit) esp8266#4797 (comment) * check for directory before creating
…66#4800) * Update requirements.txt * Update conf.py * Update libraries.rst * Update libraries.rst * Update libraries.rst * Update stack_dump.rst * Update client-examples.rst * Update readme.rst * Update readme.rst * Update server-class.rst * Update server-examples.rst * Update soft-access-point-class.rst * Update station-class.rst * Update station-examples.rst * Update udp-class.rst * Update udp-examples.rst * Update a04-board-generic-is-unknown.rst * Update readme.rst * Update readme.rst * Update readme.rst
* Compatibility and IRQ fixed for waveform/tone/pwm Fix a compiler ambiguity introduced with a floating point frequency option for tone(). Thanks to @Rob58329 for discovering this and proposing the fix. Match original analogWrite behavior by going from 0...1023 (PWMRANGE) and not 0...1024, and also explicitly set the analogWrite pin to an OUTPUT. Thanks to @JAndrassy for finding this. Fixes esp8266#4380 discovered by @cranphin where interrupts were disabled on a stopWaveform(). Remove that completely and bracket the update of non-atomic fields in the structure with disable/enable IRQs for safety. * Fix tone(int,int,int) infinite loop Explicitly cast the frequency, when passed in as an int, to an unsigned int. Verified with snippet: tone(D1, (int)1000, 500); tone(D1, (unsigned int)1000, 500); tone(D1, 1000.0, 500); tone(D1, (int)1000); tone(D1, (unsigned int)1000); tone(D1, 1000.0);
Adding a clue on the https part that yo will definitely need the fingerprint. (My first commit)
* Implement for ssid a similar approach as for passphrase * Additional fixes for 32-char ssid
…in (esp8266#5376) * Move to PROGMEM aware libc, allow PSTR in printf() A Newlib (libc) patch is in progress to move the _P functions from inside Arduino into first-class citizens in libc. This Arduino patch cleans up code that's been migrated there. Binaries for the new libs are included because it seems they're part of the Arduino git tree, and should be replaced with @igrr built ones when/if the Newlib changes are accepted. Notable changes/additions for Arduino: Allow for use of PROGMEM based format and parameter strings in all *printf functions. No need for copying PSTR()s into RAM before printing them out (transparently saves heap space when using _P functions) and makes it easier to print out constant strings for applications. Add "%S" (capital-S) format that I've been told, but cannot verify, is used in Arduino to specify a PROGMEM string parameter in printfs, as an alias for "%s" since plain "%s" can now handle PROGMEM. Optimized the memcpy_P, strnlen_P, and strncpy_P functions to use 32-bit direct reads whenver possible (source and dest alignment mediated), but there is still room for improvement in others. Finally, move several constant arrays from RODATA into PROGMEM and update their accessors. Among these are the ctype array, ~260 bytes, mprec* arrays, ~300 bytes, and strings/daycounts in the time formatting functions, ~200 bytes. All told, sketches will see from 300 to 800 additional RAM heap free on startup (depending on their use of these routines). * Fix merge error in #ifdef/#endif * Fix host test using the newlib generic pgmspace.h Host tests now use the sys/pgmspace.h for compiles instead of the ESP8266-specific version. * Update with rebuilt libraries using latest newlib * Include binaries built directly from @igrr repo Rebuild the binaries using a git clone of https://github.com/igrr/newlib-xtensa Build commands for posterity: ```` rm -rf ./xtensa-lx106-elf/ ./configure --prefix=<DIR>/esp8266/tools/sdk/libc --with-newlib \ --enable-multilib --disable-newlib-io-c99-formats \ --disable-newlib-supplied-syscalls \ --enable-newlib-nano-formatted-io --enable-newlib-reent-small \ --enable-target-optspace \ --program-transform-name="s&^&xtensa-lx106-elf-&" \ --disable-option-checking --with-target-subdir=xtensa-lx106-elf \ --target=xtensa-lx106-elf rm -f etc/config.cache CROSS_CFLAGS="-fno-omit-frame-pointer -DSIGNAL_PROVIDED -DABORT_PROVIDED"\ " -DMALLOC_PROVIDED" \ PATH=<DIR>/esp8266/tools/xtensa-lx106-elf/bin/:$PATH \ make all install ```` * Fix merge define conflict in c_types.h * Fix strlen_P misaligned source error Include fix from newlib-xtensa/fix-strlen branch cleaning up misaligned access on a non-aligned source string. * Fix strlen_P and strcpy_P edge cases Ran the included test suite on ESP8266 tstring.c with the following defines: #define MAX_1 50 #define memcmp memcmp_P #define memcpy memcpy_P #define memmem memmem_P #define memchr memchr_P #define strcat strcat_P #define strncat strncat_P #define strcpy strcpy_P #define strlen strlen_P #define strnlen strnlen_P #define strcmp strcmp_P #define strncmp strncmp_P Uncovered edge case and return value problems in the optimized versions of the strnlen_P and strncpy_P functions. Corrected. * Fix memcpy_P return value memcpy-1.c test suite showed error in return value of memcpy_P. Correct it. * Fix strnlen_P/strlen_P off-by-4 error Random crashes, often on String constructors using a PSTR, would occur due to the accelerated strnlen_P going past the end of the string. Would make debug builds fail, too (ESP.getVersionString() failure). Fix to fall through to normal copy on a word that's got a 0 byte anywhere in it. * Add device tests for libc functional verification Add test suite used to debug libc optimized _P functions to the device tests. * Rebuild from igrr's repo (same source as prior) Rebuild .a from igrr's repo at 347260af117b4177389e69fd4d04169b11d87a97 * WIP - add exceptions * Fix exception to have 0-terminator * Move some exception constants to TEXT from RODATA * Remove throw stubs * Move more exception stuff to ROM * Enable exceptions in platform.io * Remove atexit, is duplicated in rebuilt lib Need to look at the quick-toolchain options, there seems to be a definition for atexit defined there (libgcc?) that needs to be excised. For now, remove our local do-nothing copy. * Update libgcc to remove soft-fp functions The esp-quick-toolchain generated libgcc.a needed to have the soft-FP routines that are in ROM removed from it. Remove them in the new esp-quick-toolchain and update. * Fix merge typos in Makefile * Add unhandled exception handler to postmortem * Return our atexit() handler * Latest stdc++, minimize exception emercengy area * Remove atexit from newlib atexit was defined in newlib strongly, but we also define a noop atexit in core. Since we never exit, use the core's noop and delete the atexit from libc.a Updated in esp-quick-toolchain as well. * Move __FUNCTION__ static strings to PROGMEM __FUNCTION__ is unlikely to be a timing sensitive variable, so move it to PROGMEM and not RODATA (RAM) using linker magic. asserts() now should take no RAM for any strings. * Clean up linker file, update to latest stdc++ * Update to latest stdc++ which doesn't call strerror * Update to GCC5.1 exception emergency allocator Using GCC 5.1's emergency memory allocator for exceptions, much less space is required in programs which do not use exceptions and when space is allocated it is managed more efficiently. * Initial try with new compiler toolchain * Include newlib built from esp-quick-toolchain * Update JSON with all new esp-quick-toolchain builds * Use 64bit Windows compiler on 64bit Windows * Dump std::exception.what() when possible When doing the panic on unhandled exceptions, try and grab the .what() pointer and dump it as part of the termination info. Makes it easy to see mem errors (std::bad_alloc) or std::runtime_error strings. * Use scripted install from esp-quick-toolchain Makes sure proper libraries and includes are present by using a scripted installation from esp-quick-install instead of a manual one. * Update eqk to remove atexit, fix packaging diff
Looks like the pgm_read_(32bit) defines were not used in the main core, and they contained syntax errors when invoked due to some bad bracket/parens. Fix the macros
* Add %z and %x to printf backend %z is a C99 format used for size_t and was not included in any printf. On the 8266 it's a no-op as size_t==int, so ignore it and things just work. %x lowercase support added back in (wasn't present in nano-printf). * Update to toolchain built newlib, fix link error Previous commit was a hand build and copy, this one used the full toolchain and should not include atexit().
Some needed tools are not yet built for Win64, so use the Win32 binaries. Add them to the platform.json file so get.py and Arduino can find them.
The packages JSON file which includes the boards, tools, etc. and needs to have consistent formatting to be reproducible. The current boards.txt.py uses a REGEX to string-replace a bit of it, but that bit has a different indent than the rest of the file. Use Python's JSON writer to format the whole file repeatably.
) * weak hook early_setup() esp8266#2111 esp8266#2133 esp8266#2136 * rename to early_init (more "c" vs early_setup which is more "c++arduino") * example * improve earlyWiFi example, slightly change AddrList interface, move WiFi sketches into WiFi examples * fix CI * fix local CI runner * fix local CI runner * rename early_init() to preinit() * + static ESP8266WiFiClass::preinit_wifi_off() * update early disable wifi example * example update * IPv6 example update * Update ESP8266WiFiGeneric.h camelCase for static method name * Update ESP8266WiFiGeneric.cpp camelCase for static method name * Update EarlyDisableWiFi.ino Expand comment, fix static method name * Update core_esp8266_main.cpp Expanded comment. * Update core_esp8266_main.cpp Expanded comment * Update EarlyDisableWiFi.ino Expanded comment
…6#5412) block size of 4096 for all boads of flash size <= 1024, or blocks size of 4096 for spiffs < 512, or block size of 8192 for all other boards
* Fix the template.json with latest core patches * Add 64-bit %ll printf format support Adds support for %lld, %llx, etc. 64-bit integer printing, useful for logging timestamps and other things. Fixes esp8266#5430 * Remove unwanted updated JSON
unindent
unindent
* Make exceptions a configurable menu Add a menu, Exceptions, which allows exceptions to be disabled for ROM sensitive scripts. Default is enabled. * Update to latest JSON builder
Add setInstanceName() forwarder for compat
d-a-v
pushed a commit
that referenced
this pull request
Jan 5, 2019
* DNSServer: Handle examplewww.com correctly Just replacing 'www.' with the empty string when we assign the domainname will remove all occurrences of 'www.', not just those at the start of the string. Change this to a startsWith check so that only "www." at the beginning of the string is removed. * DNSServer: Rework request handling Rewrite the request handling in the DNSServer code to address the following issues: Compatibility with EDNS #1: RFC6891 says that "Responders that choose not to implement the protocol extensions defined in this document MUST respond with a return code (RCODE) of FORMERR to messages containing an OPT record in the additional section and MUST NOT include an OPT record in the response" If we have any additional records in the request, then we need to return a FORMERR, and not whatever custom error code the user may have set. Compatibility with EDNS #2: If we're returning an error, we need to explicitly zero all of the record counters. In the existing code, if there is an additional record present in the request, we return an ARCOUNT of 1 in the response, despite including no additional records in the payload. Don't answer non-A requests If we receive an AAAA request (or any other non-A record) requests, we shouldn't respond to it with an A record. Don't answer non-IN requests If we receive a request for a non-IN type, don't answer it (it's unlikely that we'd see this in the real world) Don't read off the end of malformed packets If a packet claims to have a query, but then doesn't include one, or includes a query with malformed labels, don't read off the end of the allocated data structure. * DNSServer: Clarify and tidy writing the answer record Modify the code used to write the answer record back to the server so that it is clearer that we are writing network byte order 16-bit quantities, and to clarify what's happening with the pointer used at the start of the answer.
d-a-v
added a commit
that referenced
this pull request
Jun 17, 2021
* release script: fix variable name error * Release process in README is decribed twice. Syncing the two walk-throughs. * adding ARDUINO_ESP8266_VERSION reflecting exactly what's passed to `makecorever.py -v` * remove "unix-" in version name (which was present even for windows but never used)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
No description provided.