From 8a2dcc7e9f73c37ddbc015665c09b28dadedb6f0 Mon Sep 17 00:00:00 2001 From: Mike Date: Fri, 7 Jun 2024 08:51:58 +0100 Subject: [PATCH] Fix SSL issues (#2788) This PR aims to address some issues encountered whilst trying to use SSL for a basic `HttpClient` download session. **Fix malloc_count link error 'undefined reference to __wrap_strdup`** Implementation also needs to call mc_malloc, not malloc. **AxCertificate destructor accesses ssl after it's been destroyed** Picked up by valgrind. **Provide time implementations in RTC.cpp, add test** Library code requires libc implementations for `gettimeofday` and `time_t`. On Esp8266 typically get `please start sntp first !` message. This should be synced with `SystemClock` so removed the `time replacement` code from AXTLS and use that. Test added to HostTests to ensure SystemClock and `time()` are synced. Checked on esp8266, rp2040, esp32s2, host. **Replace automatic SSL certificate generation with `generate-cert` build target** These don't need to be auto-generated as they're not always required. There are also multiple ways to get this information into an application. Several samples don't make use of these files, so removed. NOTE: The `make_certs.sh` script no longer appears to work, at least with openssl 3.2.1 (Jan 2024). The headers are generated but Axtls fails to load the certificate with -269 (SSL_ERROR_INVALID_KEY). **Put generated SSL certificate information into PROGMEM** Bit wasteful of RAM. **Enforce consistent 'verifyLater' behaviour with Bearssl** When attempting to fetch an https resource (using HttpClient) *without* setting request `onSslInit` we get this behaviour: - Axtls: Fails with `X509_VFY_ERROR_NO_TRUSTED_CERT` - Bearssl: No problem, goes right ahead. This behaviour with Bearssl is not desirable as it could inadvertently compromise security. Add a check on `verifyLater` and fail with `X509_NOT_TRUSTED` as appropriate. **Notes** - Add `setSslInitHandler` method to HttpClient? NO ! `Use request->onSslInit` - Does this work with lwip2 on esp8266? Doesn't appear to make things worse, but lwip2 looks to be kinda broken. Needs major update. - Certificate generation throws errors with openssl 3, this needs addressing separately as it's only really appropriate for basic testing anyway. --- Sming/Arch/Esp32/Platform/RTC.cpp | 6 + Sming/Arch/Esp8266/Platform/RTC.cpp | 23 +++- Sming/Arch/Rp2040/Platform/RTC.cpp | 8 ++ Sming/Components/axtls-8266/axtls-8266.patch | 130 +----------------- .../Components/malloc_count/malloc_count.cpp | 53 ++++--- Sming/Components/ssl/Axtls/AxConnection.cpp | 6 +- Sming/Components/ssl/Axtls/AxConnection.h | 1 + Sming/Components/ssl/Axtls/AxContext.cpp | 10 +- .../ssl/BearSsl/BrClientConnection.cpp | 6 +- Sming/Components/ssl/BearSsl/BrConnection.cpp | 20 +-- Sming/Components/ssl/BearSsl/BrContext.cpp | 4 +- Sming/Components/ssl/BearSsl/BrPrivateKey.cpp | 2 +- Sming/Components/ssl/BearSsl/BrPublicKey.cpp | 2 +- .../ssl/BearSsl/BrServerConnection.cpp | 4 +- Sming/Components/ssl/BearSsl/X509Context.h | 14 +- Sming/Components/ssl/README.rst | 99 +++++++++++++ Sming/Components/ssl/Tools/make_certs.sh | 8 +- Sming/Components/ssl/component.mk | 8 +- Sming/Components/ssl/src/KeyCertPair.cpp | 8 +- docs/source/experimental/httpserver-ssl.rst | 83 ----------- docs/source/experimental/index.rst | 1 - docs/source/upgrading/5.1-5.2.rst | 12 ++ samples/Basic_AWS/component.mk | 2 +- samples/Basic_AWS/include/ssl/cert.h | 27 ---- samples/Basic_AWS/include/ssl/private_key.h | 34 ----- samples/Basic_Ssl/component.mk | 2 +- samples/Basic_Ssl/include/ssl/cert.h | 27 ---- samples/Basic_Ssl/include/ssl/private_key.h | 35 ----- samples/Echo_Ssl/component.mk | 2 +- samples/Echo_Ssl/include/ssl/cert.h | 27 ---- samples/Echo_Ssl/include/ssl/private_key.h | 35 ----- samples/HttpClient/include/ssl/cert.h | 27 ---- samples/HttpClient/include/ssl/private_key.h | 35 ----- .../include/ssl/cert.h | 27 ---- .../include/ssl/private_key.h | 35 ----- samples/MqttClient_Hello/include/ssl/cert.h | 2 +- .../include/ssl/private_key.h | 2 +- samples/SmtpClient/component.mk | 2 +- samples/SmtpClient/include/ssl/cert.h | 27 ---- samples/SmtpClient/include/ssl/private_key.h | 34 ----- samples/Websocket_Client/include/ssl/cert.h | 27 ---- .../include/ssl/private_key.h | 35 ----- tests/HostTests/modules/DateTime.cpp | 28 ++++ 43 files changed, 268 insertions(+), 712 deletions(-) delete mode 100644 docs/source/experimental/httpserver-ssl.rst delete mode 100644 samples/Basic_AWS/include/ssl/cert.h delete mode 100644 samples/Basic_AWS/include/ssl/private_key.h delete mode 100644 samples/Basic_Ssl/include/ssl/cert.h delete mode 100644 samples/Basic_Ssl/include/ssl/private_key.h delete mode 100644 samples/Echo_Ssl/include/ssl/cert.h delete mode 100644 samples/Echo_Ssl/include/ssl/private_key.h delete mode 100644 samples/HttpClient/include/ssl/cert.h delete mode 100644 samples/HttpClient/include/ssl/private_key.h delete mode 100644 samples/HttpServer_ConfigNetwork/include/ssl/cert.h delete mode 100644 samples/HttpServer_ConfigNetwork/include/ssl/private_key.h delete mode 100644 samples/SmtpClient/include/ssl/cert.h delete mode 100644 samples/SmtpClient/include/ssl/private_key.h delete mode 100644 samples/Websocket_Client/include/ssl/cert.h delete mode 100644 samples/Websocket_Client/include/ssl/private_key.h diff --git a/Sming/Arch/Esp32/Platform/RTC.cpp b/Sming/Arch/Esp32/Platform/RTC.cpp index b5b721f806..0b6236544e 100644 --- a/Sming/Arch/Esp32/Platform/RTC.cpp +++ b/Sming/Arch/Esp32/Platform/RTC.cpp @@ -9,6 +9,7 @@ ****/ #include +#include // #include extern "C" uint64_t esp_clk_rtc_time(void); @@ -45,5 +46,10 @@ bool RtcClass::setRtcNanoseconds(uint64_t nanoseconds) bool RtcClass::setRtcSeconds(uint32_t seconds) { + struct timeval tv { + seconds + }; + settimeofday(&tv, nullptr); + return setRtcNanoseconds(uint64_t(seconds) * NS_PER_SECOND); } diff --git a/Sming/Arch/Esp8266/Platform/RTC.cpp b/Sming/Arch/Esp8266/Platform/RTC.cpp index a90f06b9a2..49e5e5b0f2 100644 --- a/Sming/Arch/Esp8266/Platform/RTC.cpp +++ b/Sming/Arch/Esp8266/Platform/RTC.cpp @@ -10,6 +10,7 @@ #include #include +#include RtcClass RTC; @@ -97,9 +98,29 @@ void loadTime(RtcData& data) // Initialise the time struct if(data.magic != RTC_MAGIC) { - debugf("rtc time init..."); + debug_d("rtc time init..."); data.magic = RTC_MAGIC; data.time = 0; data.cycles = 0; } } + +extern "C" int _gettimeofday_r(struct _reent*, struct timeval* tp, void*) +{ + if(tp) { + // ensureBootTimeIsSet(); + uint32_t micros = RTC.getRtcNanoseconds() / 1000LL; + tp->tv_sec = micros / 1000; + tp->tv_usec = micros % 1000; + } + return 0; +} + +extern "C" time_t time(time_t* t) +{ + time_t seconds = RTC.getRtcSeconds(); + if(t) { + *t = seconds; + } + return seconds; +} diff --git a/Sming/Arch/Rp2040/Platform/RTC.cpp b/Sming/Arch/Rp2040/Platform/RTC.cpp index fef78b61d5..67b8e98e56 100644 --- a/Sming/Arch/Rp2040/Platform/RTC.cpp +++ b/Sming/Arch/Rp2040/Platform/RTC.cpp @@ -11,6 +11,9 @@ #include #include #include +#include + +extern "C" int settimeofday(const struct timeval*, const struct timezone*); RtcClass RTC; @@ -52,6 +55,11 @@ bool RtcClass::setRtcNanoseconds(uint64_t nanoseconds) bool RtcClass::setRtcSeconds(uint32_t seconds) { + struct timeval tv { + seconds + }; + settimeofday(&tv, nullptr); + DateTime dt{seconds}; datetime_t t = { diff --git a/Sming/Components/axtls-8266/axtls-8266.patch b/Sming/Components/axtls-8266/axtls-8266.patch index 16eff5af6a..19688134c4 100644 --- a/Sming/Components/axtls-8266/axtls-8266.patch +++ b/Sming/Components/axtls-8266/axtls-8266.patch @@ -220,140 +220,24 @@ index 53509d0..25c568d 100644 #endif diff --git a/replacements/time.c b/replacements/time.c -index 4972119..d39481c 100644 +index 4972119..1447711 100644 --- a/replacements/time.c +++ b/replacements/time.c -@@ -16,29 +16,25 @@ +@@ -16,6 +16,8 @@ * */ -+#define _C_TYPES_H_ -+#include ++#if 0 + #include --#include -+#include + #include - extern uint32_t system_get_time(void); - extern uint64_t system_mktime(uint32_t year, uint32_t mon, uint32_t day, uint32_t hour, uint32_t min, uint32_t sec); - - static int errno_var = 0; - --int* __errno(void) { -+// These functions are implemented in Espressif SDK versions 2 and later (libmain.a) so we weaken them to avoid linker problems -+#define WEAK_ATTR __attribute__((weak)) -+ -+int* WEAK_ATTR __errno(void) { - // DEBUGV("__errno is called last error: %d (not current)\n", errno_var); - return &errno_var; - } - --unsigned long millis(void) --{ -- return system_get_time() / 1000UL; --} -- --unsigned long micros(void) --{ -- return system_get_time(); --} -- - #ifndef _TIMEVAL_DEFINED - #define _TIMEVAL_DEFINED - struct timeval { -@@ -60,12 +56,12 @@ static time_t s_bootTime = 0; - // calculate offset used in gettimeofday - static void ensureBootTimeIsSet() - { -- if (!s_bootTime) -+ if (s_bootTime == 0) - { - time_t now = sntp_get_current_timestamp(); -- if (now) -+ if (now != 0) - { -- s_bootTime = now - millis() / 1000; -+ s_bootTime = now - (system_get_time() / 1000000); - } - } - } -@@ -79,7 +75,7 @@ static void setServer(int id, const char* name_or_ip) - } - } - --void configTime(int timezone, int daylightOffset_sec, const char* server1, const char* server2, const char* server3) -+void WEAK_ATTR configTime(int timezone, int daylightOffset_sec, const char* server1, const char* server2, const char* server3) - { - sntp_stop(); - -@@ -93,22 +89,16 @@ void configTime(int timezone, int daylightOffset_sec, const char* server1, const - sntp_init(); - } - --int clock_gettime(clockid_t unused, struct timespec *tp) -+int WEAK_ATTR clock_gettime(clockid_t unused, struct timespec *tp) - { -- tp->tv_sec = millis() / 1000; -- tp->tv_nsec = micros() * 1000; -+ unsigned long us = system_get_time(); -+ tp->tv_sec = us / 1000000UL; -+ us %= 1000000UL; -+ tp->tv_nsec = us * 1000; - return 0; - } - --// seconds since 1970 --time_t mktime(struct tm *t) --{ -- // system_mktime expects month in range 1..12 -- #define START_MONTH 1 -- return DIFF1900TO1970 + system_mktime(t->tm_year, t->tm_mon + START_MONTH, t->tm_mday, t->tm_hour, t->tm_min, t->tm_sec); --} -- --time_t time(time_t * t) -+time_t WEAK_ATTR time(time_t * t) - { - time_t seconds = sntp_get_current_timestamp(); - if (t) -@@ -118,30 +108,32 @@ time_t time(time_t * t) - return seconds; - } - --char* asctime(const struct tm *t) -+char* WEAK_ATTR asctime(const struct tm *t) - { - return sntp_asctime(t); - } - --struct tm* localtime(const time_t *clock) -+struct tm* WEAK_ATTR localtime(const time_t *clock) - { - return sntp_localtime(clock); - } - --char* ctime(const time_t *t) -+char* WEAK_ATTR ctime(const time_t *t) - { - struct tm* p_tm = localtime(t); - char* result = asctime(p_tm); - return result; - } - --int gettimeofday(struct timeval *tp, void *tzp) -+int WEAK_ATTR gettimeofday(struct timeval *tp, void *tzp) - { - if (tp) - { - ensureBootTimeIsSet(); -- tp->tv_sec = (s_bootTime + millis()) / 1000; -- tp->tv_usec = micros() * 1000; -+ unsigned long us = system_get_time(); -+ tp->tv_sec = s_bootTime + (us / 1000000UL); -+ us %= 1000000UL; -+ tp->tv_usec = us * 1000UL; +@@ -145,3 +147,5 @@ int gettimeofday(struct timeval *tp, void *tzp) } return 0; } ++ ++#endif diff --git a/ssl/asn1.c b/ssl/asn1.c index a08a618..3c64064 100644 --- a/ssl/asn1.c diff --git a/Sming/Components/malloc_count/malloc_count.cpp b/Sming/Components/malloc_count/malloc_count.cpp index 51ad1e638a..357ba7dff0 100644 --- a/Sming/Components/malloc_count/malloc_count.cpp +++ b/Sming/Components/malloc_count/malloc_count.cpp @@ -82,8 +82,17 @@ constexpr size_t alignment{16}; /* bytes (>= 2*sizeof(size_t)) */ /* a sentinel value prefixed to each allocation */ constexpr size_t sentinel{0xDEADC0DE}; -/* Macro to get pointer to sentinel */ -#define GET_SENTINEL(ptr) (size_t*)((char*)ptr - sizeof(size_t)) +/* Add an offset to a pointer return that as a pointer cast to required type */ +template T offsetPointer(void* ptr, intptr_t offset) +{ + return reinterpret_cast(reinterpret_cast(ptr) + offset); +} + +/* Get pointer to sentinel */ +size_t* getSentinel(void* ptr) +{ + return offsetPointer(ptr, -sizeof(size_t)); +} /* output */ #define PPREFIX "MC## " @@ -224,9 +233,9 @@ extern "C" void* mc_malloc(size_t size) } /* prepend allocation size and check sentinel */ - *(size_t*)ret = size; - ret = (char*)ret + alignment; - *GET_SENTINEL(ret) = sentinel; + *static_cast(ret) = size; + ret = offsetPointer(ret, alignment); + *getSentinel(ret) = sentinel; inc_count(size); if(size >= logThreshold) { @@ -252,19 +261,19 @@ extern "C" void mc_free(void* ptr) return; } - size_t* p_sentinel = GET_SENTINEL(ptr); + size_t* p_sentinel = getSentinel(ptr); if(*p_sentinel != sentinel) { log("free(%p) has no sentinel !!! memory corruption?", ptr); // ... or memory not allocated by our malloc() } else { *p_sentinel = 0; // Clear sentinel to avoid false-positives - ptr = (char*)ptr - alignment; + ptr = offsetPointer(ptr, -alignment); - size_t size = *(size_t*)ptr; + size_t size = *static_cast(ptr); dec_count(size); if(size >= logThreshold) { - log("free(%p) -> %u (cur %u)", (char*)ptr + alignment, size, stats.current); + log("free(%p) -> %u (cur %u)", offsetPointer(ptr, alignment), size, stats.current); } } @@ -289,7 +298,7 @@ extern "C" void* mc_realloc(void* ptr, size_t size) return mc_malloc(size); } - if(*GET_SENTINEL(ptr) != sentinel) { + if(*getSentinel(ptr) != sentinel) { log("free(%p) has no sentinel !!! memory corruption?", ptr); // ... or memory not allocated by our malloc() return REAL(F_REALLOC)(ptr, size); @@ -301,9 +310,9 @@ extern "C" void* mc_realloc(void* ptr, size_t size) return nullptr; } - ptr = (char*)ptr - alignment; + ptr = offsetPointer(ptr, -alignment); - size_t oldsize = *(size_t*)ptr; + size_t oldsize = *static_cast(ptr); void* newptr = REAL(F_REALLOC)(ptr, alignment + size); @@ -317,16 +326,16 @@ extern "C" void* mc_realloc(void* ptr, size_t size) if(size >= logThreshold) { if(newptr == ptr) { - log("realloc(%u -> %u) = %p (cur %u)", oldsize, size, (char*)newptr + alignment, stats.current); + log("realloc(%u -> %u) = %p (cur %u)", oldsize, size, offsetPointer(newptr, alignment), stats.current); } else { - log("realloc(%u -> %u) = %p -> %p (cur %u)", oldsize, size, (char*)ptr + alignment, - (char*)newptr + alignment, stats.current); + log("realloc(%u -> %u) = %p -> %p (cur %u)", oldsize, size, offsetPointer(ptr, alignment), + offsetPointer(newptr, alignment), stats.current); } } - *(size_t*)newptr = size; + *static_cast(newptr) = size; - return (char*)newptr + alignment; + return offsetPointer(newptr, alignment); } static __attribute__((destructor)) void finish() @@ -349,6 +358,8 @@ extern "C" void* WRAP(calloc)(size_t, size_t) __attribute__((alias("mc_calloc")) extern "C" void* WRAP(realloc)(void*, size_t) __attribute__((alias("mc_realloc"))); extern "C" void WRAP(free)(void*) __attribute__((alias("mc_free"))); +using namespace MallocCount; + #ifdef ARCH_ESP8266 extern "C" void* WRAP(pvPortMalloc)(size_t) __attribute__((alias("mc_malloc"))); @@ -360,8 +371,6 @@ extern "C" void WRAP(vPortFree)(void*) __attribute__((alias("mc_free"))); #else -using namespace MallocCount; - void* operator new(size_t size) { return mc_malloc(size); @@ -406,14 +415,14 @@ void operator delete[](void* ptr, size_t) #endif +#endif // ESP8266 + extern "C" char* WRAP(strdup)(const char* s) { auto len = strlen(s) + 1; - auto dup = (char*)malloc(len); + auto dup = static_cast(mc_malloc(len)); memcpy(dup, s, len); return dup; } -#endif - #endif // ENABLE_MALLOC_COUNT diff --git a/Sming/Components/ssl/Axtls/AxConnection.cpp b/Sming/Components/ssl/Axtls/AxConnection.cpp index 2fadb090f0..71dc504fa2 100644 --- a/Sming/Components/ssl/Axtls/AxConnection.cpp +++ b/Sming/Components/ssl/Axtls/AxConnection.cpp @@ -34,14 +34,14 @@ int AxConnection::write(const uint8_t* data, size_t length) int available = tcp_sndbuf(tcp); if(available < required) { - debug_i("SSL: Required: %d, Available: %d", required, available); + debug_i("[SSL] Required: %d, Available: %d", required, available); return SSL_NOT_OK; } int written = ssl_write(ssl, data, length); - debug_d("SSL: Write len: %d, Written: %d", length, written); + debug_d("[SSL] Write len: %d, Written: %d", length, written); if(written < 0) { - debug_e("SSL: Write Error: %d", written); + debug_e("[SSL] Write Error: %d", written); } return written; diff --git a/Sming/Components/ssl/Axtls/AxConnection.h b/Sming/Components/ssl/Axtls/AxConnection.h index 1099094b80..42324c197e 100644 --- a/Sming/Components/ssl/Axtls/AxConnection.h +++ b/Sming/Components/ssl/Axtls/AxConnection.h @@ -27,6 +27,7 @@ class AxConnection : public Connection ~AxConnection() { + certificate.reset(); // Typically sends out closing message ssl_free(ssl); } diff --git a/Sming/Components/ssl/Axtls/AxContext.cpp b/Sming/Components/ssl/Axtls/AxContext.cpp index 1961f2a41d..7283d3d910 100644 --- a/Sming/Components/ssl/Axtls/AxContext.cpp +++ b/Sming/Components/ssl/Axtls/AxContext.cpp @@ -44,19 +44,19 @@ bool AxContext::init() #if DEBUG_VERBOSE_LEVEL == DBG options |= SSL_DISPLAY_BYTES; #endif - debug_d("SSL: Show debug data ..."); + debug_d("[SSL] Show debug data ..."); #endif context = ssl_ctx_new(options, session.cacheSize); if(context == nullptr) { - debug_e("SSL: Unable to allocate context"); + debug_e("[SSL] Unable to allocate context"); return false; } auto keyCert = session.keyCert; if(!keyCert.isValid()) { - debug_w("Ignoring invalid keyCert"); + debug_w("[SSL] Ignoring invalid keyCert"); return true; } @@ -66,12 +66,12 @@ bool AxContext::init() }; if(!load(SSL_OBJ_RSA_KEY, keyCert.getKey(), keyCert.getKeyLength(), keyCert.getKeyPassword())) { - debug_e("SSL: Error loading key"); + debug_e("[SSL] Error %d loading key", lastError); return false; } if(!load(SSL_OBJ_X509_CERT, keyCert.getCertificate(), keyCert.getCertificateLength(), nullptr)) { - debug_e("SSL: Error loading certificate"); + debug_e("[SSL] Error %d loading certificate", lastError); return false; } diff --git a/Sming/Components/ssl/BearSsl/BrClientConnection.cpp b/Sming/Components/ssl/BearSsl/BrClientConnection.cpp index 35906f9172..3febd9231c 100644 --- a/Sming/Components/ssl/BearSsl/BrClientConnection.cpp +++ b/Sming/Components/ssl/BearSsl/BrClientConnection.cpp @@ -107,7 +107,11 @@ void BrClientConnection::endCert() bool BrClientConnection::endChain() { - return context.session.validateCertificate(); + auto& session = context.session; + if(!session.options.verifyLater && session.validators.isEmpty()) { + return false; + } + return session.validateCertificate(); } } // namespace Ssl diff --git a/Sming/Components/ssl/BearSsl/BrConnection.cpp b/Sming/Components/ssl/BearSsl/BrConnection.cpp index fc37057eef..2dea34644a 100644 --- a/Sming/Components/ssl/BearSsl/BrConnection.cpp +++ b/Sming/Components/ssl/BearSsl/BrConnection.cpp @@ -119,12 +119,12 @@ int BrConnection::init(size_t bufferSize, bool bidi) void BrConnection::setCipherSuites(const CipherSuites::Array* cipherSuites) { if(cipherSuites == nullptr) { - debug_w("Cipher suites not configured, defaulting to basic"); + debug_w("[SSL] Cipher suites not configured, defaulting to basic"); cipherSuites = &CipherSuites::basic; } auto count = cipherSuites->length(); if(count > BR_MAX_CIPHER_SUITES) { - debug_w("Too many cipher suites, truncating %u -> %u entries", count, BR_MAX_CIPHER_SUITES); + debug_w("[SSL] Too many cipher suites, truncating %u -> %u entries", count, BR_MAX_CIPHER_SUITES); count = BR_MAX_CIPHER_SUITES; } LOAD_FSTR_ARRAY(suites, *cipherSuites); @@ -146,7 +146,7 @@ int BrConnection::read(InputBuffer& input, uint8_t*& output) size_t len = 0; output = br_ssl_engine_recvapp_buf(engine, &len); - debug_hex(DBG, "READ", output, len, 0); + debug_hex(DBG, "[SSL] READ", output, len, 0); br_ssl_engine_recvapp_ack(engine, len); return len; } @@ -168,12 +168,12 @@ int BrConnection::write(const uint8_t* data, size_t length) size_t available; auto buf = br_ssl_engine_sendapp_buf(engine, &available); if(available == 0) { - debug_w("SSL: Send buffer full"); + debug_w("[SSL] Send buffer full"); return 0; } if(available < length) { - debug_i("SSL: Required: %d, Available: %u", length, available); + debug_i("[SSL] Required: %d, Available: %u", length, available); length = available; } @@ -200,7 +200,7 @@ int BrConnection::runUntil(InputBuffer& input, unsigned target) if(state & BR_SSL_CLOSED) { int err = getLastError(); - debug_w("SSL CLOSED, last error = %d (%s), heap free = %u", err, getErrorString(err).c_str(), + debug_w("[SSL] CLOSED, last error = %d (%s), heap free = %u", err, getErrorString(err).c_str(), system_get_free_heap_size()); return err; } @@ -208,7 +208,7 @@ int BrConnection::runUntil(InputBuffer& input, unsigned target) if(!handshakeDone && (state & BR_SSL_SENDAPP)) { handshakeDone = true; context.session.handshakeComplete(true); - debug_i("Negotiated MFLN: %u", br_ssl_engine_get_mfln_negotiated(engine)); + debug_i("[SSL] Negotiated MFLN: %u", br_ssl_engine_get_mfln_negotiated(engine)); continue; } @@ -224,7 +224,7 @@ int BrConnection::runUntil(InputBuffer& input, unsigned target) return 0; } if(wlen < 0) { - debug_w("SSL SHUTDOWN"); + debug_w("[SSL] SHUTDOWN"); /* * If we received a close_notify and we * still send something, then we have our @@ -251,7 +251,7 @@ int BrConnection::runUntil(InputBuffer& input, unsigned target) // Conflict: Application data hasn't been read if(state & BR_SSL_RECVAPP) { - debug_e("SSL: Protocol Error"); + debug_e("[SSL] Protocol Error"); return BR_ERR_BAD_STATE; } @@ -263,7 +263,7 @@ int BrConnection::runUntil(InputBuffer& input, unsigned target) return state; } - debug_hex(DBG, "READ", buf, len, 0); + debug_hex(DBG, "[SSL] READ", buf, len, 0); br_ssl_engine_recvrec_ack(engine, len); continue; diff --git a/Sming/Components/ssl/BearSsl/BrContext.cpp b/Sming/Components/ssl/BearSsl/BrContext.cpp index a51ad21869..e79e1c8800 100644 --- a/Sming/Components/ssl/BearSsl/BrContext.cpp +++ b/Sming/Components/ssl/BearSsl/BrContext.cpp @@ -23,7 +23,7 @@ Connection* BrContext::createClient(tcp_pcb* tcp) if(connection != nullptr) { int res = connection->init(); if(res < 0) { - debug_e("Connection init failed: %s", connection->getErrorString(res).c_str()); + debug_e("[SSL] Connection init failed: %s", connection->getErrorString(res).c_str()); delete connection; connection = nullptr; } @@ -37,7 +37,7 @@ Connection* BrContext::createServer(tcp_pcb* tcp) if(connection != nullptr) { int res = connection->init(); if(res < 0) { - debug_e("Connection init failed: %s", connection->getErrorString(res).c_str()); + debug_e("[SSL] Connection init failed: %s", connection->getErrorString(res).c_str()); delete connection; connection = nullptr; } diff --git a/Sming/Components/ssl/BearSsl/BrPrivateKey.cpp b/Sming/Components/ssl/BearSsl/BrPrivateKey.cpp index 31ff6997f9..5d88084824 100644 --- a/Sming/Components/ssl/BearSsl/BrPrivateKey.cpp +++ b/Sming/Components/ssl/BearSsl/BrPrivateKey.cpp @@ -37,7 +37,7 @@ bool BrPrivateKey::decode(const uint8_t* buf, size_t len) return copy(*br_skey_decoder_get_ec(&dc)); default: - debug_e("Unknown key type: %d", type); + debug_e("[SSL] Unknown key type: %d", type); return false; } } diff --git a/Sming/Components/ssl/BearSsl/BrPublicKey.cpp b/Sming/Components/ssl/BearSsl/BrPublicKey.cpp index ea7ff33636..a2c89fddda 100644 --- a/Sming/Components/ssl/BearSsl/BrPublicKey.cpp +++ b/Sming/Components/ssl/BearSsl/BrPublicKey.cpp @@ -37,7 +37,7 @@ bool BrPublicKey::decode(const uint8_t* buf, size_t len) return copy(*br_pkey_decoder_get_ec(&dc)); default: - debug_e("Unknown key type: %d", type); + debug_e("[SSL] Unknown key type: %d", type); return false; } } diff --git a/Sming/Components/ssl/BearSsl/BrServerConnection.cpp b/Sming/Components/ssl/BearSsl/BrServerConnection.cpp index f109cf0289..3dbda3f157 100644 --- a/Sming/Components/ssl/BearSsl/BrServerConnection.cpp +++ b/Sming/Components/ssl/BearSsl/BrServerConnection.cpp @@ -43,14 +43,14 @@ int BrServerConnection::init() cert.data = const_cast(keyCert.getCertificate()); cert.data_len = keyCert.getCertificateLength(); if(!key.decode(keyCert.getKey(), keyCert.getKeyLength())) { - debug_e("Failed to decode keyCert"); + debug_e("[SSL] Failed to decode keyCert"); return -BR_ERR_BAD_PARAM; } br_ssl_server_set_single_rsa(&serverContext, &cert, 1, key, BR_KEYTYPE_RSA | BR_KEYTYPE_KEYX | BR_KEYTYPE_SIGN, br_rsa_private_get_default(), br_rsa_pkcs1_sign_get_default()); // Warning: Inconsistent return type: not an error code if(!br_ssl_server_reset(&serverContext)) { - debug_e("br_ssl_client_reset failed"); + debug_e("[SSL] br_ssl_client_reset failed"); return getLastError(); } diff --git a/Sming/Components/ssl/BearSsl/X509Context.h b/Sming/Components/ssl/BearSsl/X509Context.h index 0118336bb1..1f176856f9 100644 --- a/Sming/Components/ssl/BearSsl/X509Context.h +++ b/Sming/Components/ssl/BearSsl/X509Context.h @@ -59,7 +59,7 @@ class X509Context // Callback on the first byte of any certificate static void start_chain(const br_x509_class** ctx, const char* server_name) { - debug_i("start_chain: %s", server_name); + debug_i("[SSL] start_chain: %s", server_name); GET_SELF(); self->certificateCount = 0; self->handler.startChain(server_name); @@ -68,7 +68,7 @@ class X509Context // Callback for each certificate present in the chain static void start_cert(const br_x509_class** ctx, uint32_t length) { - debug_i("start_cert: %u", length); + debug_i("[SSL] start_cert: %u", length); GET_SELF(); self->startCert(length); } @@ -81,15 +81,15 @@ class X509Context // Callback for each byte stream in the chain static void append(const br_x509_class** ctx, const unsigned char* buf, size_t len) { - debug_i("append: %u", len); + debug_i("[SSL] X509 append: %u", len); GET_SELF(); self->handler.appendCertData(buf, len); - debug_hex(DBG, "CERT", buf, len, 0); + debug_hex(DBG, "[SSL] CERT", buf, len, 0); } static void end_cert(const br_x509_class** ctx) { - debug_i("end_cert"); + debug_i("[SSL] end_cert"); GET_SELF(); self->handler.endCert(); ++self->certificateCount; @@ -98,7 +98,7 @@ class X509Context // Complete chain has been parsed, return 0 on validation success static unsigned end_chain(const br_x509_class** ctx) { - debug_i("end_chain"); + debug_i("[SSL] end_chain"); GET_SELF(); return self->endChain(); } @@ -106,7 +106,7 @@ class X509Context unsigned endChain() { if(certificateCount == 0) { - debug_w("No certificate processed"); + debug_w("[SSL] No certificate processed"); return BR_ERR_X509_EMPTY_CHAIN; } diff --git a/Sming/Components/ssl/README.rst b/Sming/Components/ssl/README.rst index de0340a589..f42f38c41c 100644 --- a/Sming/Components/ssl/README.rst +++ b/Sming/Components/ssl/README.rst @@ -12,6 +12,105 @@ If you want to use SSL then take a look at the :sample:`Basic_Ssl` sample for cr and :sample:`HttpServer_ConfigNetwork` for SSL servers. +Certificates +------------ + +For server applications you'll require an X509 certificate and private key. +This is typically generated using openssl, then the resulting binary files added to your project. +The :sample:`Basic_AWS` demonstrates this approach. + +.. important:: + + Clearly private key information must be guarded so take care not to publish this in a public repository! + +Sming also has a convenience script you can use:: + + make generate-cert + +This generates binary certificate and key information in ``out/ssl``, +and creates ``include/ssl/cert.h`` and ``include/ssl/private_key.h``. +See :sample:`MqttClient_Hello` for example code. + + +Enabling SSL in HttpServer +-------------------------- + +.. highlight:: c++ + +The :cpp:func:`TcpServer::listen` method, and the child :cpp:class:`HttpServer` class, +accepts a second optional ``useSsl`` parameter. +If you look at the ``startWebServer`` function in :source:`samples/HttpServer_WebSockets/app/application.cpp`, +it can be changed to something like:: + + void startWebServer() + { + // TODO: Make sure to set a server certificate and key + server.listen(443, true); + +And what is left is the actual setting of the server certificate:: + + void startWebServer() + { + // Assign the certificate + server.setSslInitHandler([](Ssl::Session& session) { + session.keyCert.assign(serverKey, serverCert); + }); + server.listen(443, true); + +The final code can be something like:: + + void startWebServer() + { + #ifdef ENABLE_SSL + server.setSslInitHandler([](Ssl::Session& session) { + session.keyCert.assign(serverKey, serverCert); + }); + server.listen(443, true); + #else + server.listen(80); + #endif + server.paths.set("/", onIndex); + //... + +This is also demonstrated for secure MQTT in the :sample:`MqttClient_Hello` sample. + + +Security Considerations +======================= + +Does it really make sense to use SSL for an HttpServer on an ESP8266 device? + +The certificate/private key pair should make it impossible for an +external user to decrypt your traffic so that the things that you sent +are kept private, but there are some complications with this: + +- The private key will not stay private for long. The private key should be + kept encrypted on the flash memory, to prevent casual reading. + But even with decryption there is a high probability that someone + will be able to disassemble your application and figure out how to + decrypt the key. + +- Costs for certificate. Let’s imagine that you have overcome the first + issue. Then comes the second issue - if you want your users to accept + the certificate it has to be signed by one of the trusted certificate + authorities. And that costs money. And if you want to use a unique + certificate/private key pair for every device than it will make + things worse, moneywise. Note: Free SSL certificates are now available, + for example https://letsencrypt.org/. These will expire if not kept + up to date so adds additional complexity to your application. + +- You can handle up to 2 or maximum 3 connections. SSL needs 16K of memory to + make the initial handshake. The memory consumption after a successful + handshake can decrease to 4K, just for the SSL, per request. But + realistically this means that you will end up with a server that can + handle maximum 2 or 3 simultaneous connections before the heap memory is + consumed and has to be released. + +Therefore, in our humble opinion, it would be better to rely on the WIFI security that your Access +Point (AP) provides and make this AP accessible only for your IoT devices. + + + Configuration Variables ----------------------- diff --git a/Sming/Components/ssl/Tools/make_certs.sh b/Sming/Components/ssl/Tools/make_certs.sh index b5d8d060dc..3e364870b2 100755 --- a/Sming/Components/ssl/Tools/make_certs.sh +++ b/Sming/Components/ssl/Tools/make_certs.sh @@ -144,7 +144,7 @@ date -s "$DATE_NOW" touch x509_bad_before.pem fi openssl x509 -req -in x509_512.req -out x509_bad_after.pem \ - -sha1 -CAcreateserial -days -365 \ + -sha1 -CAcreateserial -days -1 \ -CA ca_x509.pem -CAkey ca_key.pem # some cleanup @@ -176,7 +176,5 @@ openssl pkcs12 -export -in x509_1024.pem -inkey key_1024.pem -keypbe PBE-SHA1-RC cat ca_x509.pem >> x509_device.pem # set default key/cert for use in the server -xxd -i x509_1024.cer | sed -e \ - "s/x509_1024_cer/default_certificate/" > "$SSL_INCLUDE_DIR/cert.h" -xxd -i key_1024 | sed -e \ - "s/key_1024/default_private_key/" > "$SSL_INCLUDE_DIR/private_key.h" +xxd -n default_certificate -i x509_1024.cer | sed -e "s/\[\]/\[\] PROGMEM/" > "$SSL_INCLUDE_DIR/cert.h" +xxd -n default_private_key -i key_1024 | sed -e "s/\[\]/\[\] PROGMEM/" > "$SSL_INCLUDE_DIR/private_key.h" diff --git a/Sming/Components/ssl/component.mk b/Sming/Components/ssl/component.mk index 41ba7ae644..27b46ed9df 100644 --- a/Sming/Components/ssl/component.mk +++ b/Sming/Components/ssl/component.mk @@ -41,12 +41,14 @@ ifeq ($(ENABLE_SSL),0) else $(info Using $(ENABLE_SSL) SSL implementation) -# Application -CUSTOM_TARGETS += include/ssl/private_key.h +##@Tools + +.PHONY: generate-cert +generate-cert: include/ssl/private_key.h ##Generate X509 certificate and private key files in include/ssl SSL_TOOLS_PATH := $(COMPONENT_PATH)/Tools SSL_INCLUDE_DIR := $(PROJECT_DIR)/include/ssl -OUT_SSL := out/ssl/ +OUT_SSL := out/ssl/ SSL_CERT_DIR := $(OUT_SSL)/cert include/ssl/private_key.h: diff --git a/Sming/Components/ssl/src/KeyCertPair.cpp b/Sming/Components/ssl/src/KeyCertPair.cpp index 0de627b986..ca00b662de 100644 --- a/Sming/Components/ssl/src/KeyCertPair.cpp +++ b/Sming/Components/ssl/src/KeyCertPair.cpp @@ -21,14 +21,14 @@ bool KeyCertPair::assign(const uint8_t* newKey, unsigned newKeyLength, const uin if(!key.setLength(newKeyLength)) { return false; } - memcpy(key.begin(), newKey, newKeyLength); + memcpy_P(key.begin(), newKey, newKeyLength); } if(newCertificateLength != 0 && newCertificate != nullptr) { if(!certificate.setLength(newCertificateLength)) { return false; } - memcpy(certificate.begin(), newCertificate, newCertificateLength); + memcpy_P(certificate.begin(), newCertificate, newCertificateLength); } return setPassword(newKeyPassword); @@ -36,13 +36,13 @@ bool KeyCertPair::assign(const uint8_t* newKey, unsigned newKeyLength, const uin bool KeyCertPair::setPassword(const char* newKeyPassword) { - unsigned passwordLength = (newKeyPassword == nullptr) ? 0 : strlen(newKeyPassword); + unsigned passwordLength = (newKeyPassword == nullptr) ? 0 : strlen_P(newKeyPassword); if(passwordLength == 0) { keyPassword = nullptr; return true; } - keyPassword.setString(newKeyPassword, passwordLength); + keyPassword.setString(flash_string_t(newKeyPassword), passwordLength); return keyPassword; } diff --git a/docs/source/experimental/httpserver-ssl.rst b/docs/source/experimental/httpserver-ssl.rst deleted file mode 100644 index b4cf95f491..0000000000 --- a/docs/source/experimental/httpserver-ssl.rst +++ /dev/null @@ -1,83 +0,0 @@ -**************************** -Enabling SSL in HttpServer -**************************** - -.. highlight:: c++ - -* At the moment any TCP based server in Sming can use TLS/SSL. -* That applies to HttpServer (also with Websockets). -* But make sure to read the security considerations and limitations. - -Enabling SSL in HttpServer -========================== - -The ``listen`` method in the TcpServer, and the child HttpServer class, accepts a second optional -parameter. If you look at the original code: -:source:`samples/HttpServer_WebSockets/app/application.cpp#L95-L99`. - -That can be changed to something like:: - - void startWebServer() - { - // TODO: Make sure to set a server certificate and key - server.listen(443, true); - -And what is left is the actual setting of the server certificate:: - - void startWebServer() - { - // Assign the certificate - server.setSslInitHandler([](Ssl::Session& session) { - session.keyCert.assign(serverKey, serverCert); - }); - server.listen(443, true); - -The final code can be something like:: - - void startWebServer() - { - #ifdef ENABLE_SSL - server.setSslInitHandler([](Ssl::Session& session) { - session.keyCert.assign(serverKey, serverCert); - }); - server.listen(443, true); - #else - server.listen(80); - #endif - server.paths.set("/", onIndex); - //... - - -Security Considerations -======================= - -Does it really make sense to use SSL for an HttpServer on an ESP8266 device? - -The certificate/private key pair should make it impossible for an -external user to decrypt your traffic so that the things that you sent -are kept private, but there are some complications with this: - -- The private key will not stay private for long. The private key should be - kept encrypted on the flash memory, to prevent casual reading. - But even with decryption there is a high probability that someone - will be able to disassemble your application and figure out how to - decrypt the key. - -- Costs for certificate. Let’s imagine that you have overcome the first - issue. Then comes the second issue - if you want your users to accept - the certificate it has to be signed by one of the trusted certificate - authorities. And that costs money. And if you want to use a unique - certificate/private key pair for every device than it will make - things worse, moneywise. Note: Free SSL certificates are now available, - for example https://letsencrypt.org/. These will expire if not kept - up to date so adds additional complexity to your application. - -- You can handle up to 2 or maximum 3 connections. SSL needs 16K of memory to - make the initial handshake. The memory consumption after a successful - handshake can decrease to 4K, just for the SSL, per request. But - realistically this means that you will end up with a server that can - handle maximum 2 or 3 simultaneous connections before the heap memory is - consumed and has to be released. - -Therefore, in our humble opinion, it would be better to rely on the WIFI security that your Access -Point (AP) provides and make this AP accessible only for your IoT devices. diff --git a/docs/source/experimental/index.rst b/docs/source/experimental/index.rst index 0a5859ac45..701914ad3b 100644 --- a/docs/source/experimental/index.rst +++ b/docs/source/experimental/index.rst @@ -5,6 +5,5 @@ Experimental Stuff .. toctree:: :maxdepth: 1 - httpserver-ssl signed-ota wokwi diff --git a/docs/source/upgrading/5.1-5.2.rst b/docs/source/upgrading/5.1-5.2.rst index 6eb1099064..0d10a27c14 100644 --- a/docs/source/upgrading/5.1-5.2.rst +++ b/docs/source/upgrading/5.1-5.2.rst @@ -63,3 +63,15 @@ Esp32 IDF RP2040 The installer has been updated to use the latest toolchain (Oct 23), gcc 13.2. + + +**Bearssl client certificate validation** + +Using ENABLE_SSL=Bearssl in a client application, no verification on the server certificate is performed. +This is a potential security issue. + +Attempting the same thing with Axtls results in an ``X509_VFY_ERROR_NO_TRUSTED_CERT`` error. +Applications must explicitly call :cpp:func:`HttpRequest::onSslInit` and set the ``verifyLater`` flag. +This extra step ensures that security checks are not unintentionally bypassed. + +The same behaviour is now presented when using Bearssl, and will now fail with ``X509_NOT_TRUSTED``. diff --git a/samples/Basic_AWS/component.mk b/samples/Basic_AWS/component.mk index 6e25c28d7d..88a0932e81 100644 --- a/samples/Basic_AWS/component.mk +++ b/samples/Basic_AWS/component.mk @@ -1,3 +1,3 @@ -ENABLE_SSL := 1 +ENABLE_SSL ?= 1 MQTT_NO_COMPAT := 1 ENABLE_CUSTOM_HEAP := 1 diff --git a/samples/Basic_AWS/include/ssl/cert.h b/samples/Basic_AWS/include/ssl/cert.h deleted file mode 100644 index b0569a1e1c..0000000000 --- a/samples/Basic_AWS/include/ssl/cert.h +++ /dev/null @@ -1,27 +0,0 @@ -unsigned char default_certificate[] = { - 0x30, 0x82, 0x01, 0xd7, 0x30, 0x82, 0x01, 0x40, 0x02, 0x09, 0x00, 0xf2, 0x26, 0x4c, 0x02, 0x27, 0x42, 0x08, 0x09, - 0x30, 0x0d, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01, 0x05, 0x05, 0x00, 0x30, 0x34, 0x31, 0x32, - 0x30, 0x30, 0x06, 0x03, 0x55, 0x04, 0x0a, 0x13, 0x29, 0x61, 0x78, 0x54, 0x4c, 0x53, 0x20, 0x50, 0x72, 0x6f, 0x6a, - 0x65, 0x63, 0x74, 0x20, 0x44, 0x6f, 0x64, 0x67, 0x79, 0x20, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, - 0x74, 0x65, 0x20, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x30, 0x1e, 0x17, 0x0d, 0x31, 0x39, 0x30, - 0x39, 0x31, 0x34, 0x32, 0x30, 0x35, 0x32, 0x33, 0x36, 0x5a, 0x17, 0x0d, 0x33, 0x33, 0x30, 0x35, 0x32, 0x33, 0x32, - 0x30, 0x35, 0x32, 0x33, 0x36, 0x5a, 0x30, 0x2c, 0x31, 0x16, 0x30, 0x14, 0x06, 0x03, 0x55, 0x04, 0x0a, 0x13, 0x0d, - 0x61, 0x78, 0x54, 0x4c, 0x53, 0x20, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x31, 0x12, 0x30, 0x10, 0x06, 0x03, - 0x55, 0x04, 0x03, 0x13, 0x09, 0x31, 0x32, 0x37, 0x2e, 0x30, 0x2e, 0x30, 0x2e, 0x31, 0x30, 0x81, 0x9f, 0x30, 0x0d, - 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01, 0x01, 0x05, 0x00, 0x03, 0x81, 0x8d, 0x00, 0x30, 0x81, - 0x89, 0x02, 0x81, 0x81, 0x00, 0xb8, 0x03, 0x9f, 0xa7, 0x44, 0x83, 0xc9, 0x3d, 0x6d, 0xd3, 0x77, 0x93, 0x83, 0x54, - 0xed, 0x2e, 0xd6, 0xc3, 0xfb, 0xdf, 0xe3, 0x4d, 0x53, 0x0f, 0x26, 0x06, 0xb0, 0xb9, 0xc8, 0x8e, 0x7a, 0x38, 0x18, - 0x89, 0x2e, 0xe3, 0xa3, 0x53, 0xc2, 0xba, 0xe5, 0x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b, 0xa7, 0x31, 0x76, 0x8c, 0xf3, 0xfc, 0xf8, 0x91, 0x91, 0x3d, 0x6b, 0x15, 0xec, 0xdd, 0x04, 0xb4, - 0x67, 0x81, 0xee, 0xd8, 0x31, 0xaf, 0xfc, 0xf2, 0x6a, 0x36, 0x87, 0xc1, 0x03, 0x49, 0xc4, 0x64, 0x17, 0x29, 0x8b, - 0x44, 0x50, 0x78, 0x3a, 0x2a, 0x0b, 0x6b, 0xf5, 0xf5, 0x38, 0x87, 0x4e, 0x86, 0x68, 0x3b, 0x7d, 0xae, 0x1f, 0xd7}; -unsigned int default_certificate_len = 475; diff --git a/samples/Basic_AWS/include/ssl/private_key.h b/samples/Basic_AWS/include/ssl/private_key.h deleted file mode 100644 index 1e8c08d258..0000000000 --- a/samples/Basic_AWS/include/ssl/private_key.h +++ /dev/null @@ -1,34 +0,0 @@ -unsigned char default_private_key[] = { - 0x30, 0x82, 0x02, 0x5c, 0x02, 0x01, 0x00, 0x02, 0x81, 0x81, 0x00, 0xb8, 0x03, 0x9f, 0xa7, 0x44, 0x83, 0xc9, 0x3d, - 0x6d, 0xd3, 0x77, 0x93, 0x83, 0x54, 0xed, 0x2e, 0xd6, 0xc3, 0xfb, 0xdf, 0xe3, 0x4d, 0x53, 0x0f, 0x26, 0x06, 0xb0, - 0xb9, 0xc8, 0x8e, 0x7a, 0x38, 0x18, 0x89, 0x2e, 0xe3, 0xa3, 0x53, 0xc2, 0xba, 0xe5, 0x3f, 0xa5, 0x25, 0x54, 0x8a, - 0x67, 0x09, 0xf1, 0x9f, 0xf2, 0xad, 0x2e, 0x42, 0xb7, 0x8d, 0x2c, 0x0b, 0x73, 0xf6, 0x5a, 0x89, 0x51, 0xac, 0xf0, - 0x97, 0x77, 0x17, 0x4d, 0x66, 0xca, 0x20, 0xc9, 0x17, 0xbf, 0x97, 0xd3, 0xfd, 0xf0, 0xf7, 0x4b, 0xad, 0x30, 0xa9, - 0x09, 0x3c, 0x62, 0x85, 0xde, 0x47, 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0xe0, 0x3e, 0x25, 0xc9, 0xb9, 0xa9, 0x65, - 0x02, 0x41, 0x00, 0xce, 0x9b, 0x72, 0x03, 0x6b, 0x21, 0x18, 0x73, 0x7d, 0xe5, 0x40, 0xca, 0xb3, 0xbd, 0x74, 0xa8, - 0x43, 0x58, 0x6d, 0x3c, 0x60, 0xdc, 0xa0, 0x18, 0x01, 0xd3, 0xf9, 0x1f, 0x6b, 0x6c, 0xcb, 0x49, 0x22, 0x08, 0x02, - 0xfe, 0xe7, 0x58, 0x22, 0xe1, 0x3c, 0x56, 0x5a, 0x73, 0x85, 0x41, 0x66, 0x54, 0xee, 0xf1, 0x49, 0xb5, 0xda, 0x3d, - 0x38, 0x9b, 0x68, 0x15, 0x1c, 0x70, 0x26, 0x4f, 0x67, 0x11, 0x02, 0x40, 0x02, 0x54, 0x5d, 0x63, 0x2c, 0x2c, 0x7c, - 0x4c, 0x09, 0x18, 0x38, 0xac, 0x0a, 0xec, 0xb7, 0x33, 0x86, 0x15, 0x23, 0x39, 0xab, 0x50, 0x22, 0x6f, 0x7a, 0x71, - 0xa8, 0x46, 0x13, 0x0f, 0xae, 0xb4, 0xa4, 0xc4, 0x63, 0x03, 0x35, 0x05, 0x51, 0x0b, 0x59, 0x8b, 0xcf, 0x60, 0xf2, - 0xa2, 0x15, 0xaf, 0x7e, 0x07, 0xb2, 0xb5, 0xc6, 0x08, 0x75, 0x84, 0xed, 0x58, 0xf0, 0xb7, 0x37, 0xa0, 0xcd, 0x21}; -unsigned int default_private_key_len = 608; diff --git a/samples/Basic_Ssl/component.mk b/samples/Basic_Ssl/component.mk index 59fa1e1767..e068be8488 100644 --- a/samples/Basic_Ssl/component.mk +++ b/samples/Basic_Ssl/component.mk @@ -4,4 +4,4 @@ COMPONENT_DEPENDS += malloc_count COMPONENT_CXXFLAGS += -DENABLE_MALLOC_COUNT=1 endif -ENABLE_SSL = Bearssl +ENABLE_SSL ?= Bearssl diff --git a/samples/Basic_Ssl/include/ssl/cert.h b/samples/Basic_Ssl/include/ssl/cert.h deleted file mode 100644 index 61ca8a654e..0000000000 --- a/samples/Basic_Ssl/include/ssl/cert.h +++ /dev/null @@ -1,27 +0,0 @@ -unsigned char default_certificate[] = { - 0x30, 0x82, 0x01, 0xd7, 0x30, 0x82, 0x01, 0x40, 0x02, 0x09, 0x00, 0xab, 0x08, 0x18, 0xa7, 0x03, 0x07, 0x27, 0xfd, - 0x30, 0x0d, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01, 0x05, 0x05, 0x00, 0x30, 0x34, 0x31, 0x32, - 0x30, 0x30, 0x06, 0x03, 0x55, 0x04, 0x0a, 0x13, 0x29, 0x61, 0x78, 0x54, 0x4c, 0x53, 0x20, 0x50, 0x72, 0x6f, 0x6a, - 0x65, 0x63, 0x74, 0x20, 0x44, 0x6f, 0x64, 0x67, 0x79, 0x20, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, - 0x74, 0x65, 0x20, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x30, 0x1e, 0x17, 0x0d, 0x31, 0x30, 0x31, - 0x32, 0x32, 0x36, 0x32, 0x32, 0x33, 0x33, 0x33, 0x39, 0x5a, 0x17, 0x0d, 0x32, 0x34, 0x30, 0x39, 0x30, 0x33, 0x32, - 0x32, 0x33, 0x33, 0x33, 0x39, 0x5a, 0x30, 0x2c, 0x31, 0x16, 0x30, 0x14, 0x06, 0x03, 0x55, 0x04, 0x0a, 0x13, 0x0d, - 0x61, 0x78, 0x54, 0x4c, 0x53, 0x20, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x31, 0x12, 0x30, 0x10, 0x06, 0x03, - 0x55, 0x04, 0x03, 0x13, 0x09, 0x31, 0x32, 0x37, 0x2e, 0x30, 0x2e, 0x30, 0x2e, 0x31, 0x30, 0x81, 0x9f, 0x30, 0x0d, - 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01, 0x01, 0x05, 0x00, 0x03, 0x81, 0x8d, 0x00, 0x30, 0x81, - 0x89, 0x02, 0x81, 0x81, 0x00, 0xcd, 0xfd, 0x89, 0x48, 0xbe, 0x36, 0xb9, 0x95, 0x76, 0xd4, 0x13, 0x30, 0x0e, 0xbf, - 0xb2, 0xed, 0x67, 0x0a, 0xc0, 0x16, 0x3f, 0x51, 0x09, 0x9d, 0x29, 0x2f, 0xb2, 0x6d, 0x3f, 0x3e, 0x6c, 0x2f, 0x90, - 0x80, 0xa1, 0x71, 0xdf, 0xbe, 0x38, 0xc5, 0xcb, 0xa9, 0x9a, 0x40, 0x14, 0x90, 0x0a, 0xf9, 0xb7, 0x07, 0x0b, 0xe1, - 0xda, 0xe7, 0x09, 0xbf, 0x0d, 0x57, 0x41, 0x86, 0x60, 0xa1, 0xc1, 0x27, 0x91, 0x5b, 0x0a, 0x98, 0x46, 0x1b, 0xf6, - 0xa2, 0x84, 0xf8, 0x65, 0xc7, 0xce, 0x2d, 0x96, 0x17, 0xaa, 0x91, 0xf8, 0x61, 0x04, 0x50, 0x70, 0xeb, 0xb4, 0x43, - 0xb7, 0xdc, 0x9a, 0xcc, 0x31, 0x01, 0x14, 0xd4, 0xcd, 0xcc, 0xc2, 0x37, 0x6d, 0x69, 0x82, 0xd6, 0xc6, 0xc4, 0xbe, - 0xf2, 0x34, 0xa5, 0xc9, 0xa6, 0x19, 0x53, 0x32, 0x7a, 0x86, 0x0e, 0x91, 0x82, 0x0f, 0xa1, 0x42, 0x54, 0xaa, 0x01, - 0x02, 0x03, 0x01, 0x00, 0x01, 0x30, 0x0d, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01, 0x05, 0x05, - 0x00, 0x03, 0x81, 0x81, 0x00, 0x40, 0xb4, 0x94, 0x9a, 0xa8, 0x89, 0x72, 0x1d, 0x07, 0xe5, 0xb3, 0x6b, 0x88, 0x21, - 0xc2, 0x38, 0x36, 0x9e, 0x7a, 0x8c, 0x49, 0x48, 0x68, 0x0c, 0x06, 0xe8, 0xdb, 0x1f, 0x4e, 0x05, 0xe6, 0x31, 0xe3, - 0xfd, 0xe6, 0x0d, 0x6b, 0xd8, 0x13, 0x17, 0xe0, 0x2d, 0x0d, 0xb8, 0x7e, 0xcb, 0x20, 0x6c, 0xa8, 0x73, 0xa7, 0xfd, - 0xe3, 0xa7, 0xfa, 0xf3, 0x02, 0x60, 0x78, 0x1f, 0x13, 0x40, 0x45, 0xee, 0x75, 0xf5, 0x10, 0xfd, 0x8f, 0x68, 0x74, - 0xd4, 0xac, 0xae, 0x04, 0x09, 0x55, 0x2c, 0xdb, 0xd8, 0x07, 0x07, 0x65, 0x69, 0x27, 0x6e, 0xbf, 0x5e, 0x61, 0x40, - 0x56, 0x8b, 0xd7, 0x33, 0x3b, 0xff, 0x6e, 0x53, 0x7e, 0x9d, 0x3f, 0xc0, 0x40, 0x3a, 0xab, 0xa0, 0x50, 0x4e, 0x80, - 0x47, 0x46, 0x0d, 0x1e, 0xdb, 0x4c, 0xf1, 0x1b, 0x5d, 0x3c, 0x2a, 0x54, 0xa7, 0x4d, 0xfa, 0x7b, 0x72, 0x66, 0xc5}; -unsigned int default_certificate_len = 475; diff --git a/samples/Basic_Ssl/include/ssl/private_key.h b/samples/Basic_Ssl/include/ssl/private_key.h deleted file mode 100644 index 31de50cb53..0000000000 --- a/samples/Basic_Ssl/include/ssl/private_key.h +++ /dev/null @@ -1,35 +0,0 @@ -unsigned char default_private_key[] = { - 0x30, 0x82, 0x02, 0x5d, 0x02, 0x01, 0x00, 0x02, 0x81, 0x81, 0x00, 0xcd, 0xfd, 0x89, 0x48, 0xbe, 0x36, 0xb9, 0x95, - 0x76, 0xd4, 0x13, 0x30, 0x0e, 0xbf, 0xb2, 0xed, 0x67, 0x0a, 0xc0, 0x16, 0x3f, 0x51, 0x09, 0x9d, 0x29, 0x2f, 0xb2, - 0x6d, 0x3f,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 0xcb, 0xf0, 0x77, 0x79, 0x9b, 0xf1, 0xfa, 0x3f, 0x81, 0xdc, 0xf3, 0x21, 0x02, 0x6d, 0xb7, 0x95, 0xc3, 0x2e, 0xce, - 0xd5}; -unsigned int default_private_key_len = 609; diff --git a/samples/Echo_Ssl/component.mk b/samples/Echo_Ssl/component.mk index ae82bad52a..a252892ef8 100644 --- a/samples/Echo_Ssl/component.mk +++ b/samples/Echo_Ssl/component.mk @@ -1 +1 @@ -ENABLE_SSL = 1 +ENABLE_SSL ?= 1 diff --git a/samples/Echo_Ssl/include/ssl/cert.h b/samples/Echo_Ssl/include/ssl/cert.h deleted file mode 100644 index 61ca8a654e..0000000000 --- a/samples/Echo_Ssl/include/ssl/cert.h +++ /dev/null @@ -1,27 +0,0 @@ -unsigned char default_certificate[] = { - 0x30, 0x82, 0x01, 0xd7, 0x30, 0x82, 0x01, 0x40, 0x02, 0x09, 0x00, 0xab, 0x08, 0x18, 0xa7, 0x03, 0x07, 0x27, 0xfd, - 0x30, 0x0d, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01, 0x05, 0x05, 0x00, 0x30, 0x34, 0x31, 0x32, - 0x30, 0x30, 0x06, 0x03, 0x55, 0x04, 0x0a, 0x13, 0x29, 0x61, 0x78, 0x54, 0x4c, 0x53, 0x20, 0x50, 0x72, 0x6f, 0x6a, - 0x65, 0x63, 0x74, 0x20, 0x44, 0x6f, 0x64, 0x67, 0x79, 0x20, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, - 0x74, 0x65, 0x20, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x30, 0x1e, 0x17, 0x0d, 0x31, 0x30, 0x31, - 0x32, 0x32, 0x36, 0x32, 0x32, 0x33, 0x33, 0x33, 0x39, 0x5a, 0x17, 0x0d, 0x32, 0x34, 0x30, 0x39, 0x30, 0x33, 0x32, - 0x32, 0x33, 0x33, 0x33, 0x39, 0x5a, 0x30, 0x2c, 0x31, 0x16, 0x30, 0x14, 0x06, 0x03, 0x55, 0x04, 0x0a, 0x13, 0x0d, - 0x61, 0x78, 0x54, 0x4c, 0x53, 0x20, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x31, 0x12, 0x30, 0x10, 0x06, 0x03, - 0x55, 0x04, 0x03, 0x13, 0x09, 0x31, 0x32, 0x37, 0x2e, 0x30, 0x2e, 0x30, 0x2e, 0x31, 0x30, 0x81, 0x9f, 0x30, 0x0d, - 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01, 0x01, 0x05, 0x00, 0x03, 0x81, 0x8d, 0x00, 0x30, 0x81, - 0x89, 0x02, 0x81, 0x81, 0x00, 0xcd, 0xfd, 0x89, 0x48, 0xbe, 0x36, 0xb9, 0x95, 0x76, 0xd4, 0x13, 0x30, 0x0e, 0xbf, - 0xb2, 0xed, 0x67, 0x0a, 0xc0, 0x16, 0x3f, 0x51, 0x09, 0x9d, 0x29, 0x2f, 0xb2, 0x6d, 0x3f, 0x3e, 0x6c, 0x2f, 0x90, - 0x80, 0xa1, 0x71, 0xdf, 0xbe, 0x38, 0xc5, 0xcb, 0xa9, 0x9a, 0x40, 0x14, 0x90, 0x0a, 0xf9, 0xb7, 0x07, 0x0b, 0xe1, - 0xda, 0xe7, 0x09, 0xbf, 0x0d, 0x57, 0x41, 0x86, 0x60, 0xa1, 0xc1, 0x27, 0x91, 0x5b, 0x0a, 0x98, 0x46, 0x1b, 0xf6, - 0xa2, 0x84, 0xf8, 0x65, 0xc7, 0xce, 0x2d, 0x96, 0x17, 0xaa, 0x91, 0xf8, 0x61, 0x04, 0x50, 0x70, 0xeb, 0xb4, 0x43, - 0xb7, 0xdc, 0x9a, 0xcc, 0x31, 0x01, 0x14, 0xd4, 0xcd, 0xcc, 0xc2, 0x37, 0x6d, 0x69, 0x82, 0xd6, 0xc6, 0xc4, 0xbe, - 0xf2, 0x34, 0xa5, 0xc9, 0xa6, 0x19, 0x53, 0x32, 0x7a, 0x86, 0x0e, 0x91, 0x82, 0x0f, 0xa1, 0x42, 0x54, 0xaa, 0x01, - 0x02, 0x03, 0x01, 0x00, 0x01, 0x30, 0x0d, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01, 0x05, 0x05, - 0x00, 0x03, 0x81, 0x81, 0x00, 0x40, 0xb4, 0x94, 0x9a, 0xa8, 0x89, 0x72, 0x1d, 0x07, 0xe5, 0xb3, 0x6b, 0x88, 0x21, - 0xc2, 0x38, 0x36, 0x9e, 0x7a, 0x8c, 0x49, 0x48, 0x68, 0x0c, 0x06, 0xe8, 0xdb, 0x1f, 0x4e, 0x05, 0xe6, 0x31, 0xe3, - 0xfd, 0xe6, 0x0d, 0x6b, 0xd8, 0x13, 0x17, 0xe0, 0x2d, 0x0d, 0xb8, 0x7e, 0xcb, 0x20, 0x6c, 0xa8, 0x73, 0xa7, 0xfd, - 0xe3, 0xa7, 0xfa, 0xf3, 0x02, 0x60, 0x78, 0x1f, 0x13, 0x40, 0x45, 0xee, 0x75, 0xf5, 0x10, 0xfd, 0x8f, 0x68, 0x74, - 0xd4, 0xac, 0xae, 0x04, 0x09, 0x55, 0x2c, 0xdb, 0xd8, 0x07, 0x07, 0x65, 0x69, 0x27, 0x6e, 0xbf, 0x5e, 0x61, 0x40, - 0x56, 0x8b, 0xd7, 0x33, 0x3b, 0xff, 0x6e, 0x53, 0x7e, 0x9d, 0x3f, 0xc0, 0x40, 0x3a, 0xab, 0xa0, 0x50, 0x4e, 0x80, - 0x47, 0x46, 0x0d, 0x1e, 0xdb, 0x4c, 0xf1, 0x1b, 0x5d, 0x3c, 0x2a, 0x54, 0xa7, 0x4d, 0xfa, 0x7b, 0x72, 0x66, 0xc5}; -unsigned int default_certificate_len = 475; diff --git a/samples/Echo_Ssl/include/ssl/private_key.h b/samples/Echo_Ssl/include/ssl/private_key.h deleted file mode 100644 index 31de50cb53..0000000000 --- a/samples/Echo_Ssl/include/ssl/private_key.h +++ /dev/null @@ -1,35 +0,0 @@ -unsigned char default_private_key[] = { - 0x30, 0x82, 0x02, 0x5d, 0x02, 0x01, 0x00, 0x02, 0x81, 0x81, 0x00, 0xcd, 0xfd, 0x89, 0x48, 0xbe, 0x36, 0xb9, 0x95, - 0x76, 0xd4, 0x13, 0x30, 0x0e, 0xbf, 0xb2, 0xed, 0x67, 0x0a, 0xc0, 0x16, 0x3f, 0x51, 0x09, 0x9d, 0x29, 0x2f, 0xb2, - 0x6d, 0x3f, 0x3e, 0x6c, 0x2f, 0x90, 0x80, 0xa1, 0x71, 0xdf, 0xbe, 0x38, 0xc5, 0xcb, 0xa9, 0x9a, 0x40, 0x14, 0x90, - 0x0a, 0xf9, 0xb7, 0x07, 0x0b, 0xe1, 0xda, 0xe7, 0x09, 0xbf, 0x0d, 0x57, 0x41, 0x86, 0x60, 0xa1, 0xc1, 0x27, 0x91, - 0x5b, 0x0a, 0x98, 0x46, 0x1b, 0xf6, 0xa2, 0x84, 0xf8, 0x65, 0xc7, 0xce, 0x2d, 0x96, 0x17, 0xaa, 0x91, 0xf8, 0x61, - 0x04, 0x50, 0x70, 0xeb, 0xb4, 0x43, 0xb7, 0xdc, 0x9a, 0xcc, 0x31, 0x01, 0x14, 0xd4, 0xcd, 0xcc, 0xc2, 0x37, 0x6d, - 0x69, 0x82, 0xd6, 0xc6, 0xc4, 0xbe, 0xf2, 0x34, 0xa5, 0xc9, 0xa6, 0x19, 0x53, 0x32, 0x7a, 0x86, 0x0e, 0x91, 0x82, - 0x0f, 0xa1, 0x42, 0x54, 0xaa, 0x01, 0x02, 0x03, 0x01, 0x00, 0x01, 0x02, 0x81, 0x81, 0x00, 0x95, 0xaa, 0x6e, 0x11, - 0xf5, 0x6a, 0x8b, 0xa2, 0xc6, 0x48, 0xc6, 0x7c, 0x37, 0x6b, 0x1f, 0x55, 0x10, 0x76, 0x26, 0x24, 0xc3, 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, 0x49, 0x10, 0x44, 0x9d, 0x67, 0x5a, 0x91, 0x86, 0x39, 0x02, 0x40, 0x41, 0x2c, 0x4e, 0xfe, 0xd9, 0x90, - 0x89, 0x00, 0x5c, 0x94, 0x0a, 0x4a, 0x7e, 0x1b, 0x1a, 0x80, 0x06, 0x01, 0x37, 0xda, 0x50, 0x61, 0x9d, 0x9c, 0xfe, - 0x25, 0x7f, 0xd8, 0xd4, 0xc4, 0x9e, 0x81, 0xf2, 0x0c, 0x1e, 0x38, 0x21, 0x1e, 0x90, 0x3f, 0xd4, 0xba, 0x6c, 0x53, - 0xcb, 0xf0, 0x77, 0x79, 0x9b, 0xf1, 0xfa, 0x3f, 0x81, 0xdc, 0xf3, 0x21, 0x02, 0x6d, 0xb7, 0x95, 0xc3, 0x2e, 0xce, - 0xd5}; -unsigned int default_private_key_len = 609; diff --git a/samples/HttpClient/include/ssl/cert.h b/samples/HttpClient/include/ssl/cert.h deleted file mode 100644 index 61ca8a654e..0000000000 --- a/samples/HttpClient/include/ssl/cert.h +++ /dev/null @@ -1,27 +0,0 @@ -unsigned char default_certificate[] = { - 0x30, 0x82, 0x01, 0xd7, 0x30, 0x82, 0x01, 0x40, 0x02, 0x09, 0x00, 0xab, 0x08, 0x18, 0xa7, 0x03, 0x07, 0x27, 0xfd, - 0x30, 0x0d, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01, 0x05, 0x05, 0x00, 0x30, 0x34, 0x31, 0x32, - 0x30, 0x30, 0x06, 0x03, 0x55, 0x04, 0x0a, 0x13, 0x29, 0x61, 0x78, 0x54, 0x4c, 0x53, 0x20, 0x50, 0x72, 0x6f, 0x6a, - 0x65, 0x63, 0x74, 0x20, 0x44, 0x6f, 0x64, 0x67, 0x79, 0x20, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, - 0x74, 0x65, 0x20, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x30, 0x1e, 0x17, 0x0d, 0x31, 0x30, 0x31, - 0x32, 0x32, 0x36, 0x32, 0x32, 0x33, 0x33, 0x33, 0x39, 0x5a, 0x17, 0x0d, 0x32, 0x34, 0x30, 0x39, 0x30, 0x33, 0x32, - 0x32, 0x33, 0x33, 0x33, 0x39, 0x5a, 0x30, 0x2c, 0x31, 0x16, 0x30, 0x14, 0x06, 0x03, 0x55, 0x04, 0x0a, 0x13, 0x0d, - 0x61, 0x78, 0x54, 0x4c, 0x53, 0x20, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x31, 0x12, 0x30, 0x10, 0x06, 0x03, - 0x55, 0x04, 0x03, 0x13, 0x09, 0x31, 0x32, 0x37, 0x2e, 0x30, 0x2e, 0x30, 0x2e, 0x31, 0x30, 0x81, 0x9f, 0x30, 0x0d, - 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01, 0x01, 0x05, 0x00, 0x03, 0x81, 0x8d, 0x00, 0x30, 0x81, - 0x89, 0x02, 0x81, 0x81, 0x00, 0xcd, 0xfd, 0x89, 0x48, 0xbe, 0x36, 0xb9, 0x95, 0x76, 0xd4, 0x13, 0x30, 0x0e, 0xbf, - 0xb2, 0xed, 0x67, 0x0a, 0xc0, 0x16, 0x3f, 0x51, 0x09, 0x9d, 0x29, 0x2f, 0xb2, 0x6d, 0x3f, 0x3e, 0x6c, 0x2f, 0x90, - 0x80, 0xa1, 0x71, 0xdf, 0xbe, 0x38, 0xc5, 0xcb, 0xa9, 0x9a, 0x40, 0x14, 0x90, 0x0a, 0xf9, 0xb7, 0x07, 0x0b, 0xe1, - 0xda, 0xe7, 0x09, 0xbf, 0x0d, 0x57, 0x41, 0x86, 0x60, 0xa1, 0xc1, 0x27, 0x91, 0x5b, 0x0a, 0x98, 0x46, 0x1b, 0xf6, - 0xa2, 0x84, 0xf8, 0x65, 0xc7, 0xce, 0x2d, 0x96, 0x17, 0xaa, 0x91, 0xf8, 0x61, 0x04, 0x50, 0x70, 0xeb, 0xb4, 0x43, - 0xb7, 0xdc, 0x9a, 0xcc, 0x31, 0x01, 0x14, 0xd4, 0xcd, 0xcc, 0xc2, 0x37, 0x6d, 0x69, 0x82, 0xd6, 0xc6, 0xc4, 0xbe, - 0xf2, 0x34, 0xa5, 0xc9, 0xa6, 0x19, 0x53, 0x32, 0x7a, 0x86, 0x0e, 0x91, 0x82, 0x0f, 0xa1, 0x42, 0x54, 0xaa, 0x01, - 0x02, 0x03, 0x01, 0x00, 0x01, 0x30, 0x0d, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01, 0x05, 0x05, - 0x00, 0x03, 0x81, 0x81, 0x00, 0x40, 0xb4, 0x94, 0x9a, 0xa8, 0x89, 0x72, 0x1d, 0x07, 0xe5, 0xb3, 0x6b, 0x88, 0x21, - 0xc2, 0x38, 0x36, 0x9e, 0x7a, 0x8c, 0x49, 0x48, 0x68, 0x0c, 0x06, 0xe8, 0xdb, 0x1f, 0x4e, 0x05, 0xe6, 0x31, 0xe3, - 0xfd, 0xe6, 0x0d, 0x6b, 0xd8, 0x13, 0x17, 0xe0, 0x2d, 0x0d, 0xb8, 0x7e, 0xcb, 0x20, 0x6c, 0xa8, 0x73, 0xa7, 0xfd, - 0xe3, 0xa7, 0xfa, 0xf3, 0x02, 0x60, 0x78, 0x1f, 0x13, 0x40, 0x45, 0xee, 0x75, 0xf5, 0x10, 0xfd, 0x8f, 0x68, 0x74, - 0xd4, 0xac, 0xae, 0x04, 0x09, 0x55, 0x2c, 0xdb, 0xd8, 0x07, 0x07, 0x65, 0x69, 0x27, 0x6e, 0xbf, 0x5e, 0x61, 0x40, - 0x56, 0x8b, 0xd7, 0x33, 0x3b, 0xff, 0x6e, 0x53, 0x7e, 0x9d, 0x3f, 0xc0, 0x40, 0x3a, 0xab, 0xa0, 0x50, 0x4e, 0x80, - 0x47, 0x46, 0x0d, 0x1e, 0xdb, 0x4c, 0xf1, 0x1b, 0x5d, 0x3c, 0x2a, 0x54, 0xa7, 0x4d, 0xfa, 0x7b, 0x72, 0x66, 0xc5}; -unsigned int default_certificate_len = 475; diff --git a/samples/HttpClient/include/ssl/private_key.h b/samples/HttpClient/include/ssl/private_key.h deleted file mode 100644 index 31de50cb53..0000000000 --- a/samples/HttpClient/include/ssl/private_key.h +++ /dev/null @@ -1,35 +0,0 @@ -unsigned char default_private_key[] = { - 0x30, 0x82, 0x02, 0x5d, 0x02, 0x01, 0x00, 0x02, 0x81, 0x81, 0x00, 0xcd, 0xfd, 0x89, 0x48, 0xbe, 0x36, 0xb9, 0x95, - 0x76, 0xd4, 0x13, 0x30, 0x0e, 0xbf, 0xb2, 0xed, 0x67, 0x0a, 0xc0, 0x16, 0x3f, 0x51, 0x09, 0x9d, 0x29, 0x2f, 0xb2, - 0x6d, 0x3f, 0x3e, 0x6c, 0x2f, 0x90, 0x80, 0xa1, 0x71, 0xdf, 0xbe, 0x38, 0xc5, 0xcb, 0xa9, 0x9a, 0x40, 0x14, 0x90, - 0x0a, 0xf9, 0xb7, 0x07, 0x0b, 0xe1, 0xda, 0xe7, 0x09, 0xbf, 0x0d, 0x57, 0x41, 0x86, 0x60, 0xa1, 0xc1, 0x27, 0x91, - 0x5b, 0x0a, 0x98, 0x46, 0x1b, 0xf6, 0xa2, 0x84, 0xf8, 0x65, 0xc7, 0xce, 0x2d, 0x96, 0x17, 0xaa, 0x91, 0xf8, 0x61, - 0x04, 0x50, 0x70, 0xeb, 0xb4, 0x43, 0xb7, 0xdc, 0x9a, 0xcc, 0x31, 0x01, 0x14, 0xd4, 0xcd, 0xcc, 0xc2, 0x37, 0x6d, - 0x69, 0x82, 0xd6, 0xc6, 0xc4, 0xbe, 0xf2, 0x34, 0xa5, 0xc9, 0xa6, 0x19, 0x53, 0x32, 0x7a, 0x86, 0x0e, 0x91, 0x82, - 0x0f, 0xa1, 0x42, 0x54, 0xaa, 0x01, 0x02, 0x03, 0x01, 0x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x9b, 0x9c, 0x7f, 0x69, 0x1f, - 0x4e, 0x1d, 0xa5, 0x90, 0x06, 0x44, 0x1b, 0x7d, 0xfc, 0x69, 0x40, 0x21, 0xbc, 0xf7, 0x46, 0xa4, 0xdc, 0x39, 0x7b, - 0xe8, 0x8b, 0x49, 0x10, 0x44, 0x9d, 0x67, 0x5a, 0x91, 0x86, 0x39, 0x02, 0x40, 0x41, 0x2c, 0x4e, 0xfe, 0xd9, 0x90, - 0x89, 0x00, 0x5c, 0x94, 0x0a, 0x4a, 0x7e, 0x1b, 0x1a, 0x80, 0x06, 0x01, 0x37, 0xda, 0x50, 0x61, 0x9d, 0x9c, 0xfe, - 0x25, 0x7f, 0xd8, 0xd4, 0xc4, 0x9e, 0x81, 0xf2, 0x0c, 0x1e, 0x38, 0x21, 0x1e, 0x90, 0x3f, 0xd4, 0xba, 0x6c, 0x53, - 0xcb, 0xf0, 0x77, 0x79, 0x9b, 0xf1, 0xfa, 0x3f, 0x81, 0xdc, 0xf3, 0x21, 0x02, 0x6d, 0xb7, 0x95, 0xc3, 0x2e, 0xce, - 0xd5}; -unsigned int default_private_key_len = 609; diff --git a/samples/HttpServer_ConfigNetwork/include/ssl/cert.h b/samples/HttpServer_ConfigNetwork/include/ssl/cert.h deleted file mode 100644 index 8515409e43..0000000000 --- a/samples/HttpServer_ConfigNetwork/include/ssl/cert.h +++ /dev/null @@ -1,27 +0,0 @@ -unsigned char x509_1024_cer[] = { - 0x30, 0x82, 0x01, 0xd7, 0x30, 0x82, 0x01, 0x40, 0x02, 0x09, 0x00, 0xaa, 0x8d, 0xd9, 0xdc, 0x30, 0x3f, 0xda, 0x4d, - 0x30, 0x0d, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01, 0x05, 0x05, 0x00, 0x30, 0x34, 0x31, 0x32, - 0x30, 0x30, 0x06, 0x03, 0x55, 0x04, 0x0a, 0x13, 0x29, 0x53, 0x6d, 0x69, 0x6e, 0x67, 0x20, 0x50, 0x72, 0x6f, 0x6a, - 0x65, 0x63, 0x74, 0x20, 0x44, 0x6f, 0x64, 0x67, 0x79, 0x20, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, - 0x74, 0x65, 0x20, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x30, 0x1e, 0x17, 0x0d, 0x31, 0x39, 0x31, - 0x32, 0x32, 0x38, 0x32, 0x33, 0x31, 0x36, 0x31, 0x35, 0x5a, 0x17, 0x0d, 0x33, 0x33, 0x30, 0x39, 0x30, 0x35, 0x32, - 0x33, 0x31, 0x36, 0x31, 0x35, 0x5a, 0x30, 0x2c, 0x31, 0x16, 0x30, 0x14, 0x06, 0x03, 0x55, 0x04, 0x0a, 0x13, 0x0d, - 0x53, 0x6d, 0x69, 0x6e, 0x67, 0x20, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x31, 0x12, 0x30, 0x10, 0x06, 0x03, - 0x55, 0x04, 0x03, 0x13, 0x09, 0x31, 0x32, 0x37, 0x2e, 0x30, 0x2e, 0x30, 0x2e, 0x31, 0x30, 0x81, 0x9f, 0x30, 0x0d, - 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01, 0x01, 0x05, 0x00, 0x03, 0x81, 0x8d, 0x00, 0x30, 0x81, - 0x89, 0x02, 0x81, 0x81, 0x00, 0xcf, 0xe2, 0x20, 0xf1, 0xd8, 0x18, 0x5f, 0x22, 0x09, 0xa8, 0x34, 0x00, 0xca, 0x15, - 0x39, 0xfc, 0x7b, 0xf3, 0x68, 0xd5, 0xb7, 0xd3, 0xbc, 0xb6, 0xa7, 0xb6, 0xbe, 0x0c, 0x4f, 0xfa, 0x98, 0x77, 0xe9, - 0x3f, 0x2c, 0x33, 0x0b, 0x5f, 0xb4, 0x3b, 0xc3, 0xc1, 0x7f, 0x91, 0x45, 0x46, 0xd7, 0x22, 0x9e, 0x81, 0x45, 0x80, - 0xb5, 0x71, 0x0c, 0xb0, 0xd7, 0x47, 0x48, 0xad, 0xe2, 0x9f, 0x6c, 0x55, 0x3c, 0x1c, 0xe9, 0x4a, 0x39, 0x78, 0xc6, - 0xa2, 0x0a, 0x46, 0xa2, 0xb8, 0x51, 0xaa, 0xa5, 0x88, 0xac, 0x8e, 0x1e, 0x90, 0x16, 0x4c, 0xac, 0x23, 0x2c, 0xfa, - 0x25, 0x62, 0x88, 0xb0, 0xa7, 0x6b, 0x83, 0x6a, 0x68, 0xed, 0x9c, 0xc5, 0xf6, 0xd0, 0x69, 0x1d, 0x49, 0x04, 0xe1, - 0x0e, 0xf8, 0x25, 0xfe, 0xa6, 0x53, 0x5b, 0x00, 0x09, 0x59, 0xaa, 0x2d, 0x71, 0x28, 0x68, 0x1a, 0x63, 0x0a, 0x93, - 0x02, 0x03, 0x01, 0x00, 0x01, 0x30, 0x0d, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01, 0x05, 0x05, - 0x00, 0x03, 0x81, 0x81, 0x00, 0x57, 0x3a, 0xc7, 0xc5, 0x7a, 0x3d, 0x9b, 0x45, 0x6c, 0xcc, 0x18, 0x29, 0xa7, 0x54, - 0x10, 0x51, 0xd4, 0x1e, 0xe0, 0xf6, 0x18, 0xee, 0x93, 0xa5, 0xfc, 0x12, 0xf7, 0x5e, 0x93, 0x16, 0xed, 0x7d, 0xc3, - 0x2a, 0x2d, 0x0e, 0xc6, 0x3a, 0x03, 0x05, 0x85, 0x13, 0xc8, 0xfb, 0x50, 0xf4, 0x91, 0x23, 0xb2, 0x93, 0x6a, 0x45, - 0x9d, 0x15, 0x72, 0x8a, 0x09, 0x15, 0xae, 0x39, 0x71, 0xa6, 0xe7, 0x4c, 0xe7, 0xf5, 0x3a, 0x8a, 0xdc, 0xb7, 0xfd, - 0x20, 0x86, 0x94, 0x9e, 0x52, 0x3a, 0x44, 0x03, 0xd4, 0xdc, 0x9c, 0xbd, 0xbc, 0xcc, 0x3b, 0x03, 0x55, 0xed, 0x96, - 0x68, 0x35, 0x93, 0x3e, 0xbf, 0x74, 0x38, 0x87, 0x9b, 0x61, 0xb7, 0xf5, 0x0e, 0x16, 0x98, 0xbe, 0x14, 0x49, 0x73, - 0x15, 0xf2, 0x70, 0xf5, 0x48, 0xb6, 0x05, 0x8b, 0xbf, 0x89, 0x69, 0x73, 0x18, 0x8f, 0x85, 0xee, 0xca, 0x80, 0x4d}; -unsigned int x509_1024_cer_len = 475; diff --git a/samples/HttpServer_ConfigNetwork/include/ssl/private_key.h b/samples/HttpServer_ConfigNetwork/include/ssl/private_key.h deleted file mode 100644 index da28f9a732..0000000000 --- a/samples/HttpServer_ConfigNetwork/include/ssl/private_key.h +++ /dev/null @@ -1,35 +0,0 @@ -unsigned char key_1024[] = { - 0x30, 0x82, 0x02, 0x5d, 0x02, 0x01, 0x00, 0x02, 0x81, 0x81, 0x00, 0xcf, 0xe2, 0x20, 0xf1, 0xd8, 0x18, 0x5f, 0x22, - 0x09, 0xa8, 0x34, 0x00, 0xca, 0x15, 0x39, 0xfc, 0x7b, 0xf3, 0x68, 0xd5, 0xb7, 0xd3, 0xbc, 0xb6, 0xa7, 0xb6, 0xbe, - 0x0c, 0x4f, 0xfa, 0x98, 0x77, 0xe9, 0x3f, 0x2c, 0x33, 0x0b, 0x5f, 0xb4, 0x3b, 0xc3, 0xc1, 0x7f, 0x91, 0x45, 0x46, - 0xd7, 0x22, 0x9e, 0x81, 0x45, 0x80, 0xb5, 0x71, 0x0c, 0xb0, 0xd7, 0x47, 0x48, 0xad, 0xe2, 0x9f, 0x6c, 0x55, 0x3c, - 0x1c, 0xe9, 0x4a, 0x39, 0x78, 0xc6, 0xa2, 0x0a, 0x46, 0xa2, 0xb8, 0x51, 0xaa, 0xa5, 0x88, 0xac, 0x8e, 0x1e, 0x90, - 0x16, 0x4c, 0xac, 0x23, 0x2c, 0xfa, 0x25, 0x62, 0x88, 0xb0, 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44, 0x46, 0x10, - 0x3d, 0x02, 0x40, 0x7d, 0x18, 0x18, 0x37, 0x1d, 0x74, 0x0f, 0x53, 0xb6, 0x6c, 0xb8, 0xb5, 0x8a, 0x81, 0xc0, 0xb5, - 0x6b, 0xca, 0x42, 0xf4, 0x36, 0x24, 0x46, 0xae, 0x27, 0xbc, 0xf4, 0x72, 0x74, 0xff, 0xec, 0x5a, 0xf6, 0x07, 0x86, - 0x27, 0x51, 0xdd, 0xb5, 0xe6, 0xf1, 0xcd, 0xab, 0xa7, 0xcd, 0xb4, 0x34, 0xde, 0x3f, 0x7c, 0x64, 0x8f, 0xef, 0xdd, - 0x9c, 0x05, 0x17, 0x82, 0x5c, 0x9e, 0x0b, 0x3c, 0xe6, 0x3f, 0x02, 0x41, 0x00, 0xcf, 0xb5, 0x87, 0xfa, 0xc3, 0x82, - 0x7b, 0x18, 0x01, 0x8f, 0x88, 0xa4, 0xd4, 0xd9, 0xaa, 0x45, 0x74, 0x83, 0x80, 0x2b, 0xa7, 0x36, 0x2d, 0x91, 0x11, - 0x81, 0x67, 0x44, 0xeb, 0x49, 0xc5, 0x18, 0xbe, 0xff, 0x9a, 0x5b, 0x33, 0x19, 0xf4, 0x40, 0x6e, 0x4d, 0xb9, 0x1b, - 0xc2, 0xda, 0xf8, 0xd3, 0x92, 0x4c, 0x22, 0x6f, 0x25, 0xc6, 0x68, 0x7a, 0x7e, 0x18, 0x99, 0x05, 0x04, 0x91, 0x26, - 0xbf}; -unsigned int key_1024_len = 609; diff --git a/samples/MqttClient_Hello/include/ssl/cert.h b/samples/MqttClient_Hello/include/ssl/cert.h index 61ca8a654e..656efaadbd 100644 --- a/samples/MqttClient_Hello/include/ssl/cert.h +++ b/samples/MqttClient_Hello/include/ssl/cert.h @@ -1,4 +1,4 @@ -unsigned char default_certificate[] = { +unsigned char default_certificate[] PROGMEM = { 0x30, 0x82, 0x01, 0xd7, 0x30, 0x82, 0x01, 0x40, 0x02, 0x09, 0x00, 0xab, 0x08, 0x18, 0xa7, 0x03, 0x07, 0x27, 0xfd, 0x30, 0x0d, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01, 0x05, 0x05, 0x00, 0x30, 0x34, 0x31, 0x32, 0x30, 0x30, 0x06, 0x03, 0x55, 0x04, 0x0a, 0x13, 0x29, 0x61, 0x78, 0x54, 0x4c, 0x53, 0x20, 0x50, 0x72, 0x6f, 0x6a, diff --git a/samples/MqttClient_Hello/include/ssl/private_key.h b/samples/MqttClient_Hello/include/ssl/private_key.h index 31de50cb53..e4d72a0bfc 100644 --- a/samples/MqttClient_Hello/include/ssl/private_key.h +++ b/samples/MqttClient_Hello/include/ssl/private_key.h @@ -1,4 +1,4 @@ -unsigned char default_private_key[] = { +unsigned char default_private_key[] PROGMEM = { 0x30, 0x82, 0x02, 0x5d, 0x02, 0x01, 0x00, 0x02, 0x81, 0x81, 0x00, 0xcd, 0xfd, 0x89, 0x48, 0xbe, 0x36, 0xb9, 0x95, 0x76, 0xd4, 0x13, 0x30, 0x0e, 0xbf, 0xb2, 0xed, 0x67, 0x0a, 0xc0, 0x16, 0x3f, 0x51, 0x09, 0x9d, 0x29, 0x2f, 0xb2, 0x6d, 0x3f, 0x3e, 0x6c, 0x2f, 0x90, 0x80, 0xa1, 0x71, 0xdf, 0xbe, 0x38, 0xc5, 0xcb, 0xa9, 0x9a, 0x40, 0x14, 0x90, diff --git a/samples/SmtpClient/component.mk b/samples/SmtpClient/component.mk index 7f43d35855..4113e94c06 100644 --- a/samples/SmtpClient/component.mk +++ b/samples/SmtpClient/component.mk @@ -1,2 +1,2 @@ HWCONFIG := spiffs-2m -ENABLE_SSL ?= 1 +ENABLE_SSL ?= 1 diff --git a/samples/SmtpClient/include/ssl/cert.h b/samples/SmtpClient/include/ssl/cert.h deleted file mode 100644 index 0f5317732d..0000000000 --- a/samples/SmtpClient/include/ssl/cert.h +++ /dev/null @@ -1,27 +0,0 @@ -unsigned char default_certificate[] = { - 0x30, 0x82, 0x01, 0xd7, 0x30, 0x82, 0x01, 0x40, 0x02, 0x09, 0x00, 0xa6, 0xf3, 0xaa, 0xf6, 0xaf, 0xcd, 0x0b, 0x3a, - 0x30, 0x0d, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01, 0x05, 0x05, 0x00, 0x30, 0x34, 0x31, 0x32, - 0x30, 0x30, 0x06, 0x03, 0x55, 0x04, 0x0a, 0x0c, 0x29, 0x61, 0x78, 0x54, 0x4c, 0x53, 0x20, 0x50, 0x72, 0x6f, 0x6a, - 0x65, 0x63, 0x74, 0x20, 0x44, 0x6f, 0x64, 0x67, 0x79, 0x20, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, - 0x74, 0x65, 0x20, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x30, 0x1e, 0x17, 0x0d, 0x31, 0x38, 0x30, - 0x34, 0x32, 0x34, 0x30, 0x39, 0x34, 0x38, 0x32, 0x39, 0x5a, 0x17, 0x0d, 0x33, 0x32, 0x30, 0x31, 0x30, 0x31, 0x30, - 0x39, 0x34, 0x38, 0x32, 0x39, 0x5a, 0x30, 0x2c, 0x31, 0x16, 0x30, 0x14, 0x06, 0x03, 0x55, 0x04, 0x0a, 0x0c, 0x0d, - 0x61, 0x78, 0x54, 0x4c, 0x53, 0x20, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x31, 0x12, 0x30, 0x10, 0x06, 0x03, - 0x55, 0x04, 0x03, 0x0c, 0x09, 0x31, 0x32, 0x37, 0x2e, 0x30, 0x2e, 0x30, 0x2e, 0x31, 0x30, 0x81, 0x9f, 0x30, 0x0d, - 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01, 0x01, 0x05, 0x00, 0x03, 0x81, 0x8d, 0x00, 0x30, 0x81, - 0x89, 0x02, 0x81, 0x81, 0x00, 0x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xeb, 0x95, - 0xdb, 0xd3, 0x2f, 0x70, 0xd9, 0xa5, 0x4e, 0x01, 0xd4, 0x2a, 0xb1, 0xa1, 0x79, 0x71, 0xb5, 0xe8, 0xf1, 0x0d, 0xb0, - 0x95, 0x98, 0xb5, 0xc8, 0x7d, 0x1d, 0x10, 0x64, 0x54, 0x16, 0x9f, 0x1e, 0x92, 0xc6, 0x26, 0xe6, 0xc5, 0xa7, 0xb0, - 0x1d, 0x3c, 0xd5, 0x92, 0xbf, 0xf3, 0xcf, 0xfe, 0x67, 0x03, 0x9d, 0x57, 0x76, 0x9a, 0xa2, 0x4e, 0x55, 0xad, 0xc2, - 0xcb, 0xbe, 0x7e, 0x83, 0xb1, 0xd8, 0x02, 0x59, 0x49, 0x7b, 0x48, 0x70, 0xec, 0xe1, 0x17, 0x76, 0x8e, 0x00, 0x3e, - 0x28, 0xd6, 0x79, 0x84, 0x65, 0x7e, 0x77, 0x8b, 0x0b, 0x3a, 0x19, 0xbb, 0x25, 0xec, 0x0a, 0xdd, 0x9a, 0xfe, 0x96}; -unsigned int default_certificate_len = 475; diff --git a/samples/SmtpClient/include/ssl/private_key.h b/samples/SmtpClient/include/ssl/private_key.h deleted file mode 100644 index e4a0f9130a..0000000000 --- a/samples/SmtpClient/include/ssl/private_key.h +++ /dev/null @@ -1,34 +0,0 @@ -unsigned char default_private_key[] = { - 0x30, 0x82, 0x02, 0x5c, 0x02, 0x01, 0x00, 0x02, 0x81, 0x81, 0x00, 0xa0, 0xbd, 0x8d, 0xf6, 0x21, 0x4b, 0x76, 0x92, - 0xa8, 0x13, 0xe8, 0x74, 0x90, 0x79, 0x05, 0x04, 0xfb, 0xf1, 0x4f, 0x4b, 0x02, 0xc2, 0xd9, 0x6f, 0xc1, 0x82, 0xa7, - 0xf2, 0x8b, 0x03, 0x15, 0xe3, 0x56, 0xce, 0x37, 0x4a, 0x2d, 0xcb, 0x80, 0xd1, 0xc0, 0xa0, 0x84, 0x3d, 0x1b, 0xd9, - 0x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, 0x96}; -unsigned int default_private_key_len = 608; diff --git a/samples/Websocket_Client/include/ssl/cert.h b/samples/Websocket_Client/include/ssl/cert.h deleted file mode 100644 index c16737b162..0000000000 --- a/samples/Websocket_Client/include/ssl/cert.h +++ /dev/null @@ -1,27 +0,0 @@ -unsigned char default_certificate[] = { - 0x30, 0x82, 0x01, 0xd7, 0x30, 0x82, 0x01, 0x40, 0x02, 0x09, 0x00, 0xe1, 0x1b, 0x5e, 0x9f, 0xbd, 0x6a, 0x8f, 0xd9, - 0x30, 0x0d, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01, 0x05, 0x05, 0x00, 0x30, 0x34, 0x31, 0x32, - 0x30, 0x30, 0x06, 0x03, 0x55, 0x04, 0x0a, 0x13, 0x29, 0x61, 0x78, 0x54, 0x4c, 0x53, 0x20, 0x50, 0x72, 0x6f, 0x6a, - 0x65, 0x63, 0x74, 0x20, 0x44, 0x6f, 0x64, 0x67, 0x79, 0x20, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, - 0x74, 0x65, 0x20, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x30, 0x1e, 0x17, 0x0d, 0x31, 0x36, 0x31, - 0x31, 0x32, 0x38, 0x31, 0x35, 0x32, 0x30, 0x33, 0x39, 0x5a, 0x17, 0x0d, 0x33, 0x30, 0x30, 0x38, 0x30, 0x37, 0x31, - 0x35, 0x32, 0x30, 0x33, 0x39, 0x5a, 0x30, 0x2c, 0x31, 0x16, 0x30, 0x14, 0x06, 0x03, 0x55, 0x04, 0x0a, 0x13, 0x0d, - 0x61, 0x78, 0x54, 0x4c, 0x53, 0x20, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x31, 0x12, 0x30, 0x10, 0x06, 0x03, - 0x55, 0x04, 0x03, 0x13, 0x09, 0x31, 0x32, 0x37, 0x2e, 0x30, 0x2e, 0x30, 0x2e, 0x31, 0x30, 0x81, 0x9f, 0x30, 0x0d, - 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01, 0x01, 0x05, 0x00, 0x03, 0x81, 0x8d, 0x00, 0x30, 0x81, - 0x89, 0x02, 0x81, 0x81, 0x00, 0xda, 0x2c, 0x2b, 0xed, 0x4a, 0x24, 0xa5, 0x02, 0x6a, 0x39, 0x31, 0x4e, 0xf2, 0x0d, - 0x07, 0x6b, 0x4b, 0xc2, 0xa9, 0x95, 0x06, 0xa3, 0x6e, 0xe1, 0x15, 0x7c, 0x12, 0xcc, 0xe4, 0xf7, 0xa7, 0xf8, 0x09, - 0x7f, 0x50, 0xa5, 0x97, 0xf1, 0x6f, 0x8f, 0x80, 0xa3, 0x1e, 0x88, 0x9f, 0x8e, 0xbd, 0x3b, 0x33, 0x5c, 0xfc, 0x2f, - 0xb3, 0x3e, 0x97, 0xf5, 0xbe, 0xe5, 0xe6, 0x23, 0xf1, 0x16, 0xf3, 0xc4, 0xc9, 0xa4, 0xa4, 0xf9, 0xc0, 0x96, 0xdc, - 0x11, 0x4e, 0x8a, 0xf9, 0x83, 0xde, 0xa2, 0x67, 0xe5, 0xa2, 0x07, 0x63, 0x67, 0x08, 0xc3, 0x4f, 0x5f, 0xac, 0xc2, - 0x8e, 0xc0, 0x9a, 0x17, 0x19, 0xc4, 0xa7, 0x82, 0x22, 0xa6, 0x36, 0x34, 0x38, 0x18, 0x0c, 0x1a, 0x86, 0x6c, 0x70, - 0x1d, 0x70, 0x9c, 0x71, 0x12, 0xec, 0xcb, 0x15, 0xda, 0x97, 0xfe, 0xe5, 0x54, 0xf2, 0x98, 0xfa, 0x28, 0x2d, 0x97, - 0x02, 0x03, 0x01, 0x00, 0x01, 0x30, 0x0d, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01, 0x05, 0x05, - 0x00, 0x03, 0x81, 0x81, 0x00, 0x2c, 0x35, 0xcb, 0x03, 0x38, 0xa9, 0x25, 0x40, 0x20, 0x9c, 0x4a, 0x7a, 0x15, 0x1a, - 0x4e, 0x1f, 0xec, 0x34, 0xd3, 0x43, 0x76, 0xb8, 0x90, 0xcf, 0x9f, 0x3b, 0x1c, 0x6d, 0x15, 0xfd, 0xd3, 0x21, 0xfe, - 0x1d, 0x07, 0x84, 0x1f, 0x8a, 0x0e, 0xcf, 0x93, 0x19, 0xdc, 0x16, 0xcf, 0x1e, 0xac, 0x9c, 0xf6, 0x37, 0x97, 0xfb, - 0x7d, 0xef, 0x2b, 0xfa, 0x7c, 0x94, 0x59, 0x4b, 0x6c, 0x04, 0xad, 0xe7, 0x99, 0xfa, 0x0a, 0x25, 0x8b, 0xcd, 0x8e, - 0x0e, 0x9f, 0x63, 0x80, 0x71, 0x4f, 0xf5, 0x5e, 0x0f, 0xf4, 0xdb, 0xe2, 0x17, 0x13, 0x48, 0x68, 0x1b, 0xdd, 0x85, - 0xd8, 0xba, 0xe2, 0xbb, 0xfc, 0x07, 0xf0, 0x3a, 0x29, 0xd1, 0x71, 0xf8, 0xe3, 0x69, 0x4f, 0xb6, 0xc2, 0x26, 0xfc, - 0x94, 0x67, 0xfb, 0xbb, 0x7e, 0x30, 0x8a, 0x55, 0x28, 0x09, 0x35, 0xf1, 0x37, 0x62, 0x19, 0x42, 0x0e, 0x98, 0x55}; -unsigned int default_certificate_len = 475; diff --git a/samples/Websocket_Client/include/ssl/private_key.h b/samples/Websocket_Client/include/ssl/private_key.h deleted file mode 100644 index eb0d88821b..0000000000 --- a/samples/Websocket_Client/include/ssl/private_key.h +++ /dev/null @@ -1,35 +0,0 @@ -unsigned char default_private_key[] = { - 0x30, 0x82, 0x02, 0x5e, 0x02, 0x01, 0x00, 0x02, 0x81, 0x81, 0x00, 0xda, 0x2c, 0x2b, 0xed, 0x4a, 0x24, 0xa5, 0x02, - 0x6a, 0x39, 0x31, 0x4e, 0xf2, 0x0d, 0x07, 0x6b, 0x4b, 0xc2, 0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, 0x53, 0x31, 0xa4, 0x1e, 0x57, 0xab, - 0x27, 0x2c, 0x21, 0x46, 0xb0, 0x03, 0xad, 0x22, 0xe9, 0x7f, 0xef, 0x02, 0x41, 0x00, 0xb8, 0xa0, 0x78, 0xfc, 0x7f, - 0x15, 0x5b, 0xf5, 0x43, 0x58, 0x1f, 0xbf, 0x33, 0x3a, 0x5c, 0xb3, 0xe2, 0x59, 0xb1, 0x6b, 0xe0, 0x4b, 0xab, 0x4b, - 0x5b, 0x71, 0x79, 0x88, 0x23, 0x0f, 0x30, 0xf4, 0x22, 0x90, 0xb2, 0x0e, 0xb6, 0xa9, 0x49, 0x8b, 0xfa, 0x22, 0x70, - 0xa5, 0xce, 0xb2, 0x49, 0xdf, 0x05, 0x98, 0x4b, 0x21, 0x79, 0x4d, 0x49, 0x54, 0xf6, 0x49, 0x2a, 0x79, 0x45, 0xe5, - 0x83, 0xb9, 0x02, 0x41, 0x00, 0x88, 0x37, 0x50, 0xc3, 0x02, 0x6a, 0xd0, 0x84, 0xf6, 0x41, 0x46, 0xa0, 0x4f, 0xf2, - 0x6d, 0x28, 0x6b, 0x39, 0x76, 0xda, 0x06, 0xef, 0xd5, 0xe6, 0x1e, 0x4e, 0xda, 0x89, 0xfb, 0x77, 0x6e, 0x1e, 0xe1, - 0x15, 0x71, 0x6e, 0x27, 0x21, 0x21, 0xe4, 0x81, 0xdb, 0x93, 0xe5, 0xe9, 0xe7, 0x29, 0xad, 0x4e, 0xeb, 0xe6, 0x50, - 0x34, 0xbe, 0x76, 0x9a, 0xd7, 0xd2, 0x3a, 0x8e, 0x09, 0xbe, 0x97, 0x29, 0x02, 0x40, 0x4a, 0x3c, 0x78, 0x22, 0x42, - 0x5b, 0xce, 0x60, 0xa0, 0x48, 0x70, 0x16, 0x7c, 0x92, 0xc2, 0xe1, 0xe3, 0x24, 0xed, 0x58, 0xce, 0xea, 0x91, 0x80, - 0x2d, 0x7c, 0x59, 0xcb, 0xb7, 0x47, 0xa7, 0xc5, 0xab, 0xc6, 0xf6, 0x25, 0x35, 0xd9, 0xbc, 0xd2, 0x11, 0x6e, 0xc2, - 0xfc, 0x97, 0xa9, 0x03, 0xba, 0x5c, 0x8e, 0x92, 0xff, 0x2c, 0xab, 0xab, 0x95, 0x02, 0x1a, 0x9a, 0xd3, 0xb0, 0x4c, - 0x79, 0xfd}; -unsigned int default_private_key_len = 610; diff --git a/tests/HostTests/modules/DateTime.cpp b/tests/HostTests/modules/DateTime.cpp index 5f262a8c0d..544789b0c9 100644 --- a/tests/HostTests/modules/DateTime.cpp +++ b/tests/HostTests/modules/DateTime.cpp @@ -90,6 +90,34 @@ class DateTimeTest : public TestGroup << DateTime::getLocaleMonthName(month) << endl; } } + + TEST_CASE("time() sync") + { + auto curTime = SystemClock.now(eTZ_UTC); + DateTime dt; + dt.fromISO8601(F("2024-01-01T13:57Z")); + time_t newTime = dt; + Serial << _F("curTime ") << curTime << _F(", newTime ") << newTime << _F(" ...") << endl; + SystemClock.setTime(newTime, eTZ_UTC); + auto timer = new AutoDeleteTimer; + const auto delay = 2000; + timer->initializeMs([newTime, this]() { + auto sysClockTime = SystemClock.now(eTZ_UTC); + auto ctime = ::time(nullptr); + auto diff = sysClockTime - ctime; + auto timeDelay = sysClockTime - newTime; + Serial << _F("sysClockTime ") << sysClockTime << _F(", delay ") << timeDelay << endl; + Serial << _F("time() ") << ctime << _F(", diff ") << diff << endl; + REQUIRE(abs(1000 * timeDelay - delay) <= 1000); +#ifndef ARCH_HOST + // Can't check time() on host + REQUIRE(abs(diff) < 2); +#endif + complete(); + }); + timer->startOnce(); + pending(); + } } void checkHttpDates(const FSTR::Array& dates)