diff --git a/src/Networking/ESP8266WiFi/WiFiInterface.cpp b/src/Networking/ESP8266WiFi/WiFiInterface.cpp index 6e17b991a..dc7fee471 100644 --- a/src/Networking/ESP8266WiFi/WiFiInterface.cpp +++ b/src/Networking/ESP8266WiFi/WiFiInterface.cpp @@ -1136,6 +1136,7 @@ bool WiFiInterface::ImportTlsFromSd(const StringRef& reply) noexcept supportsTls = true; +#if HAS_MASS_STORAGE || HAS_SBC_INTERFACE // Securely delete the SD copies - they now live in ESP flash String path; path.copy(TlsCertFile); @@ -1144,6 +1145,10 @@ bool WiFiInterface::ImportTlsFromSd(const StringRef& reply) noexcept (void)MassStorage::SecureDelete(path.GetRef(), ErrorMessageMode::messageAlways); reply.copy("TLS cert/key imported to WiFi module flash; SD copies wiped and deleted"); +#else + // The source is a read-only embedded filesystem, so there is nothing to delete afterwards. + reply.copy("TLS cert/key imported to WiFi module flash"); +#endif return true; } diff --git a/src/Networking/LwipEthernet/LwipEthernetInterface.cpp b/src/Networking/LwipEthernet/LwipEthernetInterface.cpp index db965f892..954da84f6 100644 --- a/src/Networking/LwipEthernet/LwipEthernetInterface.cpp +++ b/src/Networking/LwipEthernet/LwipEthernetInterface.cpp @@ -856,6 +856,7 @@ GCodeResult LwipEthernetInterface::EnableInterface(int mode, const StringRef& ss // Only honoured while the interface is down, matching the documented rule if (tlsParam < 0 && !activated) { +#if HAS_MASS_STORAGE || HAS_SBC_INTERFACE bool wiped = false; String path; path.copy(TlsCertFile); @@ -872,6 +873,10 @@ GCodeResult LwipEthernetInterface::EnableInterface(int mode, const StringRef& ss { platform.Message(NetworkInfoMessage, "TLS: stored cert/key wiped and deleted from /sys/\n"); } +#else + // Nothing to wipe: with an embedded filesystem there is no writable storage to have kept them on. + platform.Message(NetworkInfoMessage, "TLS: no writable storage, nothing to wipe\n"); +#endif } const bool tlsAllowedParam = (tlsParam > 0); #else