diff --git a/LICENSE b/LICENSE index c22fc230..820cb05e 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2023 mobizt +Copyright (c) 2024 mobizt Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/README.md b/README.md index 1a333ac0..411a2027 100644 --- a/README.md +++ b/README.md @@ -1095,7 +1095,7 @@ Thanks for Edward Chuang (莊坪達) from Google for selecting this project. The MIT License (MIT) -Copyright (c) 2023 K. Suwatchai (Mobizt) +Copyright (c) 2024 K. Suwatchai (Mobizt) Permission is hereby granted, free of charge, to any person returning a copy of diff --git a/examples/SMTP/Set_Time/Set_Time.ino b/examples/SMTP/Set_Time/Set_Time.ino index bda29585..fc2e1142 100644 --- a/examples/SMTP/Set_Time/Set_Time.ino +++ b/examples/SMTP/Set_Time/Set_Time.ino @@ -160,6 +160,8 @@ void setup() smtp.callback(smtpCallback); + smtp.setTCPTimeout(10); + Session_Config config; config.server.host_name = SMTP_HOST; diff --git a/library.json b/library.json index 92168dd5..8f9d1ced 100644 --- a/library.json +++ b/library.json @@ -1,6 +1,6 @@ { "name": "ESP Mail Client", - "version": "3.4.15", + "version": "3.4.16", "keywords": "communication, email, imap, smtp, esp32, esp8266, samd, arduino", "description": "Arduino E-Mail Client Library to send, read and get incoming email notification for ESP32, ESP8266 and SAMD21 devices. The library also supported other Arduino Devices using Clients interfaces e.g. WiFiClient, EthernetClient, and GSMClient.", "repository": { diff --git a/library.properties b/library.properties index 56b5ac43..4df18914 100644 --- a/library.properties +++ b/library.properties @@ -1,6 +1,6 @@ name=ESP Mail Client -version=3.4.15 +version=3.4.16 author=Mobizt diff --git a/src/ESP_Mail_Client.cpp b/src/ESP_Mail_Client.cpp index 216328f3..8898af3b 100644 --- a/src/ESP_Mail_Client.cpp +++ b/src/ESP_Mail_Client.cpp @@ -3,10 +3,6 @@ #pragma GCC diagnostic ignored "-Wunused-but-set-variable" -#include "ESP_Mail_Client_Version.h" -#if !VALID_VERSION_CHECK(30415) -#error "Mixed versions compilation." -#endif /** * Mail Client Arduino Library for Arduino devices. diff --git a/src/ESP_Mail_Client.h b/src/ESP_Mail_Client.h index d289c312..dec0059f 100644 --- a/src/ESP_Mail_Client.h +++ b/src/ESP_Mail_Client.h @@ -1,10 +1,6 @@ #ifndef ESP_MAIL_CLIENT_H #define ESP_MAIL_CLIENT_H -#include "ESP_Mail_Client_Version.h" -#if !VALID_VERSION_CHECK(30415) -#error "Mixed versions compilation." -#endif /** * Mail Client Arduino Library for Arduino devices. @@ -98,7 +94,7 @@ extern char *__brkval; #endif -#include "ESP_Mail_TCPClient.h" +#include "./client/ESP_Mail_TCPClient.h" using namespace mb_string; diff --git a/src/ESP_Mail_Client_Version.h b/src/ESP_Mail_Client_Version.h index 2a780247..1fe4df6b 100644 --- a/src/ESP_Mail_Client_Version.h +++ b/src/ESP_Mail_Client_Version.h @@ -3,10 +3,10 @@ #ifndef ESP_MAIL_VERSION -#define ESP_MAIL_VERSION "3.4.15" -#define ESP_MAIL_VERSION_NUM 30415 +#define ESP_MAIL_VERSION "3.4.16" +#define ESP_MAIL_VERSION_NUM 30416 /* The inconsistent file version checking to prevent mixed versions compilation. */ -#define VALID_VERSION_CHECK(ver) (ver == ESP_MAIL_VERSION_NUM) +//#define VALID_VERSION_CHECK(ver) (ver == ESP_MAIL_VERSION_NUM) #endif \ No newline at end of file diff --git a/src/ESP_Mail_Const.h b/src/ESP_Mail_Const.h index c7237f09..72715d37 100644 --- a/src/ESP_Mail_Const.h +++ b/src/ESP_Mail_Const.h @@ -5,10 +5,6 @@ #ifndef ESP_MAIL_CONST_H #define ESP_MAIL_CONST_H -#include "ESP_Mail_Client_Version.h" -#if !VALID_VERSION_CHECK(30415) -#error "Mixed versions compilation." -#endif #include #include "ESP_Mail_FS.h" diff --git a/src/ESP_Mail_Error.h b/src/ESP_Mail_Error.h index 8cc8eac9..34daed1b 100644 --- a/src/ESP_Mail_Error.h +++ b/src/ESP_Mail_Error.h @@ -6,11 +6,6 @@ #ifndef ESP_MAIL_ERROR_H #define ESP_MAIL_ERROR_H -#include "ESP_Mail_Client_Version.h" -#if !VALID_VERSION_CHECK(30415) -#error "Mixed versions compilation." -#endif - #define TCP_CLIENT_ERROR_CONNECTION_REFUSED -1 #define TCP_CLIENT_ERROR_SEND_DATA_FAILED -2 #define TCP_CLIENT_ERROR_NOT_INITIALIZED -3 diff --git a/src/ESP_Mail_FS.h b/src/ESP_Mail_FS.h index 159eefe6..6188e35f 100644 --- a/src/ESP_Mail_FS.h +++ b/src/ESP_Mail_FS.h @@ -5,10 +5,6 @@ #ifndef ESP_MAIL_CONFIG_H #define ESP_MAIL_CONFIG_H -#include "ESP_Mail_Client_Version.h" -#if !VALID_VERSION_CHECK(30415) -#error "Mixed versions compilation." -#endif #include #include "extras/MB_MCU.h" diff --git a/src/ESP_Mail_IMAP.h b/src/ESP_Mail_IMAP.h index eb27fd3c..7e1d6d6a 100644 --- a/src/ESP_Mail_IMAP.h +++ b/src/ESP_Mail_IMAP.h @@ -2,11 +2,6 @@ #ifndef ESP_MAIL_IMAP_H #define ESP_MAIL_IMAP_H -#include "ESP_Mail_Client_Version.h" -#if !VALID_VERSION_CHECK(30415) -#error "Mixed versions compilation." -#endif - /** * Mail Client Arduino Library for Espressif's ESP32 and ESP8266, Raspberry Pi RP2040 Pico, and SAMD21 with u-blox NINA-W102 WiFi/Bluetooth module * diff --git a/src/ESP_Mail_SMTP.h b/src/ESP_Mail_SMTP.h index 1759927d..79c5d889 100644 --- a/src/ESP_Mail_SMTP.h +++ b/src/ESP_Mail_SMTP.h @@ -2,11 +2,6 @@ #ifndef ESP_MAIL_SMTP_H #define ESP_MAIL_SMTP_H -#include "ESP_Mail_Client_Version.h" -#if !VALID_VERSION_CHECK(30415) -#error "Mixed versions compilation." -#endif - /** * Mail Client Arduino Library for Espressif's ESP32 and ESP8266, Raspberry Pi RP2040 Pico, and SAMD21 with u-blox NINA-W102 WiFi/Bluetooth module * diff --git a/src/client/ESP_Mail_TCPClient.h b/src/client/ESP_Mail_TCPClient.h new file mode 100644 index 00000000..70b48e99 --- /dev/null +++ b/src/client/ESP_Mail_TCPClient.h @@ -0,0 +1,1220 @@ +/** + * + * The Network Upgradable Arduino Secure TCP Client Class, ESP_Mail_TCPClient.h v3.4.15 + * + * Created November 15, 2023 + * + * The MIT License (MIT) + * Copyright (c) 2023 K. Suwatchai (Mobizt) + * + * + * Permission is hereby granted, free of charge, to any person returning a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + +#ifndef ESP_MAIL_TCPCLIENT_H +#define ESP_MAIL_TCPCLIENT_H + +#pragma GCC diagnostic ignored "-Wunused-variable" +#pragma GCC diagnostic ignored "-Wdelete-non-virtual-dtor" + +#include "ESP_Mail_Const.h" + +#if defined(ESP32) && (defined(ENABLE_SMTP) || defined(ENABLE_IMAP)) +#include "IPAddress.h" +#include "lwip/sockets.h" +#endif + +#if defined(ESP32) + +#if defined(ESP_MAIL_WIFI_IS_AVAILABLE) +#define WIFI_HAS_HOST_BY_NAME +#endif +#include "WiFiClientImpl.h" +#define BASE_WIFICLIENT WiFiClientImpl + +#elif defined(ESP_MAIL_WIFI_IS_AVAILABLE) +#include "WiFiClient.h" +#define BASE_WIFICLIENT WiFiClient +#endif + +#if __has_include() +#include +#else +#include "./client/SSLClient/ESP_SSLClient.h" +#endif + +class ESP_Mail_TCPClient +{ +public: + ESP_Mail_TCPClient() + { +#if !defined(ESP_MAIL_DISABLE_SSL) + _tcp_client = new ESP_SSLClient(); +#endif + } + + ~ESP_Mail_TCPClient() + { + clear(); +#if !defined(ESP_MAIL_DISABLE_SSL) + if (_tcp_client) + delete _tcp_client; + _tcp_client = nullptr; +#endif + } + + /** + * Set the client. + * @param client The Client interface. + */ + void setClient(Client *client) + { + clear(); + _basic_client = client; + _client_type = esp_mail_client_type_external_generic_client; + } + + /** Assign TinyGsm Clients. + * + * @param client The pointer to TinyGsmClient. + * @param modem The pointer to TinyGsm modem object. Modem should be initialized and/or set mode before transfering data + * @param pin The SIM pin. + * @param apn The GPRS APN (Access Point Name). + * @param user The GPRS user. + * @param password The GPRS password. + */ + void setGSMClient(Client *client, void *modem = nullptr, const char *pin = nullptr, const char *apn = nullptr, const char *user = nullptr, const char *password = nullptr) + { +#if defined(ESP_MAIL_GSM_MODEM_IS_AVAILABLE) + _client_type = esp_mail_client_type_external_gsm_client; + _basic_client = client; + _modem = modem; + _pin = pin; + _apn = apn; + _user = user; + _password = password; +#endif + } + + /** Assign external Ethernet Client. + * + * @param client The pointer to Ethernet client object. + * @param macAddress The Ethernet MAC address. + * @param csPin The Ethernet module SPI chip select pin. + * @param resetPin The Ethernet module reset pin. + * @param staticIP (Optional) The pointer to ESP_Mail_StaticIP object which has these IPAddress in its constructor i.e. + * ipAddress, netMask, defaultGateway, dnsServer and optional. + */ + void setEthernetClient(Client *client, uint8_t macAddress[6], int csPin, int resetPin, ESP_Mail_StaticIP *staticIP = nullptr) + { + _client_type = esp_mail_client_type_external_ethernet_client; + _basic_client = client; + _ethernet_mac = macAddress; + _ethernet_cs_pin = csPin; + _ethernet_reset_pin = resetPin; + _static_ip = staticIP; + }; + + /** + * Set Root CA certificate to verify. + * @param caCert The certificate. + */ + void setCACert(const char *caCert) + { +#if !defined(ESP_MAIL_DISABLE_SSL) + if (caCert) + { + if (_x509) + delete _x509; + + _x509 = new X509List(caCert); + _tcp_client->setTrustAnchors(_x509); + + setCertType(esp_mail_cert_type_data); + setTA(true); + } + else + { + setCertType(esp_mail_cert_type_none); + setInSecure(); + } +#endif + } + + /** + * Set Root CA certificate to verify. + * @param certFile The certificate file path. + * @param storageType The storage type mb_fs_mem_storage_type_flash or mb_fs_mem_storage_type_sd. + * @return true when certificate loaded successfully. + */ + bool setCertFile(const char *certFile, mb_fs_mem_storage_type storageType) + { +#if !defined(ESP_MAIL_DISABLE_SSL) + if (!_mbfs) + return false; + + if (_clock_ready && strlen(certFile) > 0) + { + MB_String filename = certFile; + if (filename.length() > 0) + { + if (filename[0] != '/') + filename.prepend('/'); + } + + int len = _mbfs->open(filename, storageType, mb_fs_open_mode_read); + if (len > -1) + { + uint8_t *der = (uint8_t *)_mbfs->newP(len); + if (_mbfs->available(storageType)) + _mbfs->read(storageType, der, len); + _mbfs->close(storageType); + + if (_x509) + delete _x509; + + _x509 = new X509List(der, len); + _tcp_client->setTrustAnchors(_x509); + setTA(true); + _mbfs->delP(&der); + + setCertType(esp_mail_cert_type_file); + } + } +#endif + + return getCertType() == esp_mail_cert_type_file; + } + + /** + * Set TCP connection time out in seconds. + * @param timeoutSec The time out in seconds. + */ + void setTimeout(uint32_t timeoutSec) + { + _tcp_client->setTimeout(timeoutSec); + } + + /** Set the BearSSL IO buffer size. + * + * @param rx The BearSSL receive buffer size in bytes. + * @param tx The BearSSL trasmit buffer size in bytes. + */ + void setIOBufferSize(int rx, int tx) + { + _rx_size = rx; + _tx_size = tx; + } + + /** + * Get the ethernet link status. + * @return true for link up or false for link down. + */ + bool ethLinkUp() + { + bool ret = false; + +#if !defined(ESP_MAIL_DISABLE_NATIVE_ETHERNET) && (defined(ENABLE_IMAP) || defined(ENABLE_SMTP)) + +#if defined(ESP_MAIL_ETH_IS_AVAILABLE) + +#if defined(ESP32) + if (validIP(ETH.localIP())) + { + ETH.linkUp(); + ret = true; + } +#elif defined(ESP8266) + +#if defined(ENABLE_SMTP) || defined(ENABLE_IMAP) + if (!_session_config) + return false; +#endif + +#if defined(ESP8266) && defined(ESP8266_CORE_SDK_V3_X_X) + +#if defined(INC_ENC28J60_LWIP) + if (_session_config->spi_ethernet_module.enc28j60) + { + ret = _session_config->spi_ethernet_module.enc28j60->status() == WL_CONNECTED; + goto ex; + } +#endif +#if defined(INC_W5100_LWIP) + if (_session_config->spi_ethernet_module.w5100) + { + ret = _session_config->spi_ethernet_module.w5100->status() == WL_CONNECTED; + goto ex; + } +#endif +#if defined(INC_W5500_LWIP) + if (_session_config->spi_ethernet_module.w5500) + { + ret = _session_config->spi_ethernet_module.w5500->status() == WL_CONNECTED; + goto ex; + } +#endif +#elif defined(MB_ARDUINO_PICO) + +#endif + + return ret; + +#if defined(INC_ENC28J60_LWIP) || defined(INC_W5100_LWIP) || defined(INC_W5500_LWIP) + ex: +#endif + // workaround for ESP8266 Ethernet + delayMicroseconds(0); +#endif + +#endif + +#endif + + return ret; + } + + /** + * Checking for valid IP. + * @return true for valid. + */ + bool validIP(IPAddress ip) + { + char buf[16]; + sprintf(buf, "%u.%u.%u.%u", ip[0], ip[1], ip[2], ip[3]); + return strcmp(buf, "0.0.0.0") != 0; + } + + /** + * Ethernet DNS workaround. + */ + void ethDNSWorkAround() + { + +#if !defined(ESP_MAIL_DISABLE_NATIVE_ETHERNET) && (defined(ENABLE_SMTP) || defined(ENABLE_IMAP)) + if (!_session_config) + return; + +#if defined(ESP8266_CORE_SDK_V3_X_X) + +#if defined(INC_ENC28J60_LWIP) + if (_session_config->spi_ethernet_module.enc28j60) + goto ex; +#endif +#if defined(INC_W5100_LWIP) + if (_session_config->spi_ethernet_module.w5100) + goto ex; +#endif +#if defined(INC_W5500_LWIP) + if (_session_config->spi_ethernet_module.w5500) + goto ex; +#endif + +#elif defined(MB_ARDUINO_PICO) + +#endif + + return; + +#if defined(INC_ENC28J60_LWIP) || defined(INC_W5100_LWIP) || defined(INC_W5500_LWIP) + ex: +#if defined(ESP_MAIL_WIFI_IS_AVAILABLE) + BASE_WIFICLIENT client; + client.connect(_session_config->server.host_name.c_str(), _session_config->server.port); + client.stop(); +#endif +#endif + +#endif + } + + /** + * Get the network status. + * @return true for connected or false for not connected. + */ + bool networkReady() + { + + // We will not invoke the network status request when device has built-in WiFi or Ethernet and it is connected. + if (_client_type == esp_mail_client_type_external_gsm_client) + { + _network_status = gprsConnected(); + if (!_network_status) + gprsConnect(); + } + else if (_client_type == esp_mail_client_type_external_ethernet_client) + { + if (!ethernetConnected()) + ethernetConnect(); + } + // also check the native network before calling external cb + else if (_client_type == esp_mail_client_type_internal_basic_client || WiFI_CONNECTED || ethLinkUp()) + _network_status = WiFI_CONNECTED || ethLinkUp(); + else if (_client_type == esp_mail_client_type_external_generic_client) + { + if (!_network_status_cb) + _last_error = 1; + else + _network_status_cb(); + } + else + _network_status = false; + + return _network_status; + } + + /** + * Reconnect the network. + */ + void networkReconnect() + { + + if (_client_type == esp_mail_client_type_external_generic_client) + { +#if defined(ESP_MAIL_HAS_WIFI_DISCONNECT) + // We can reconnect WiFi when device connected via built-in WiFi that supports reconnect + if (WiFI_CONNECTED) + { + WiFi.reconnect(); + return; + } + +#endif + + if (_network_connection_cb) + _network_connection_cb(); + } + else if (_client_type == esp_mail_client_type_external_gsm_client) + { + gprsDisconnect(); + gprsConnect(); + } + else if (_client_type == esp_mail_client_type_external_ethernet_client) + { + ethernetConnect(); + } + else if (_client_type == esp_mail_client_type_internal_basic_client) + { + +#if defined(ESP_MAIL_WIFI_IS_AVAILABLE) +#if defined(ESP32) || defined(ESP8266) + WiFi.reconnect(); +#else + if (_wifi_multi && _wifi_multi->credentials.size()) + _wifi_multi->reconnect(); +#endif +#endif + } + } + + /** + * Disconnect the network. + */ + void networkDisconnect() {} + + /** + * Get the Client type. + * @return The esp_mail_client_type enum value. + */ + esp_mail_client_type type() { return _client_type; } + + /** + * Get the Client initialization status. + * @return The initialization status. + */ + bool isInitialized() + { + bool rdy = true; +#if !defined(ESP_MAIL_WIFI_IS_AVAILABLE) + if (_client_type == esp_mail_client_type_external_generic_client && + (!_network_connection_cb || !_network_status_cb)) + rdy = false; + else if (_client_type != esp_mail_client_type_external_generic_client && + _client_type != esp_mail_client_type_external_gsm_client) + rdy = false; +#else + // assume external client is WiFiClient and network status request callback is not required + // when device was connected to network using on board WiFi + if (_client_type == esp_mail_client_type_external_generic_client && + (!_network_connection_cb || (!_network_status_cb && !WiFI_CONNECTED && !ethLinkUp()))) + { + rdy = false; + } + +#endif + + if (!rdy) + { +#if !defined(SILENT_MODE) && (defined(ENABLE_SMTP) || defined(ENABLE_IMAP)) + if (_debug_level > 0) + { + if (!_network_connection_cb) + esp_mail_debug_print_tag(esp_mail_error_client_str_2 /* "network connection callback is required" */, esp_mail_debug_tag_type_error, true); + if (!WiFI_CONNECTED && !ethLinkUp()) + { + if (!_network_status_cb) + esp_mail_debug_print_tag(esp_mail_error_client_str_3 /* "network connection status callback is required" */, esp_mail_debug_tag_type_error, true); + } + } +#endif + } + + return rdy; + } + + /** + * Set Root CA certificate to verify. + * @param name The host name. + * @param ip The ip address result. + * @return 1 for success or 0 for failed. + */ + int hostByName(const char *name, IPAddress &ip) + { +#if defined(ESP_MAIL_WIFI_IS_AVAILABLE) + return WiFi.hostByName(name, ip); +#else + return 1; +#endif + } + + /** + * Store the host name and port. + * @param host The host name to connect. + * @param port The port to connect. + * @return true. + */ + bool begin(const char *host, uint16_t port) + { + _host = host; + _port = port; +#if !defined(ESP_MAIL_DISABLE_SSL) + _tcp_client->setBufferSizes(_rx_size >= _minRXTXBufSize && _rx_size <= _maxRXBufSize ? _rx_size : _maxRXBufSize / rxBufDivider, + _tx_size >= _minRXTXBufSize && _tx_size <= _maxTXBufSize ? _tx_size : _maxTXBufSize / txBufDivider); +#endif + _last_error = 0; + return true; + } + + void setBSSLSession(BearSSL_Session *session) + { +#if !defined(ESP_MAIL_DISABLE_SSL) + if (_tcp_client) + _tcp_client->setSession(session); +#endif + } + + /** + * Start TCP connection using stored host name and port. + * @param secure The secure mode option. + * @param verify The Root CA certificate verification option. + * @return true for success or false for error. + */ + + bool connect(bool secured, bool verify) + { + bool ret = false; + +#if defined(ENABLE_SMTP) || defined(ENABLE_IMAP) + _last_error = 0; + +#if !defined(ESP_MAIL_DISABLE_SSL) + _tcp_client->enableSSL(secured); + setSecure(secured); + setVerify(verify); +#endif + + if (connected()) + { + flush(); + return true; + } + + if (!_basic_client) + { + if (_client_type == esp_mail_client_type_external_generic_client) + { + _last_error = 1; + return false; + } + else if (_client_type != esp_mail_client_type_external_gsm_client) + { +// Device has no built-in WiFi, external client required. +#if defined(ESP_MAIL_WIFI_IS_AVAILABLE) + _basic_client = new BASE_WIFICLIENT(); + _client_type = esp_mail_client_type_internal_basic_client; +#else + _last_error = 1; + return false; +#endif + } + } + +#if defined(ESP_MAIL_DISABLE_SSL) + _tcp_client = _basic_client; +#else + _tcp_client->setClient(_basic_client); +#endif + + if (!_tcp_client->connect(_host.c_str(), _port)) + return false; + +#if defined(ESP_MAIL_WIFI_IS_AVAILABLE) && (defined(ESP32) || defined(ESP8266) || defined(MB_ARDUINO_PICO)) + if (_client_type == esp_mail_client_type_internal_basic_client) + reinterpret_cast(_basic_client)->setNoDelay(true); +#endif + + // For TCP keepalive should work in ESP8266 core > 3.1.2. + // https://github.com/esp8266/Arduino/pull/8940 + + // Not currently supported by WiFiClientSecure in Arduino Pico core + + if (_client_type == esp_mail_client_type_internal_basic_client) + { + if (isKeepAliveSet()) + { +#if defined(ESP_MAIL_WIFI_IS_AVAILABLE) + +#if defined(ESP8266) + if (_tcpKeepIdleSeconds == 0 || _tcpKeepIntervalSeconds == 0 || _tcpKeepCount == 0) + reinterpret_cast(_basic_client)->disableKeepAlive(); + else + reinterpret_cast(_basic_client)->keepAlive(_tcpKeepIdleSeconds, _tcpKeepIntervalSeconds, _tcpKeepCount); + +#elif defined(ESP32) + + if (_tcpKeepIdleSeconds == 0 || _tcpKeepIntervalSeconds == 0 || _tcpKeepCount == 0) + { + _tcpKeepIdleSeconds = 0; + _tcpKeepIntervalSeconds = 0; + _tcpKeepCount = 0; + } + + bool success = setOption(TCP_KEEPIDLE, &_tcpKeepIdleSeconds) > -1 && + setOption(TCP_KEEPINTVL, &_tcpKeepIntervalSeconds) > -1 && + setOption(TCP_KEEPCNT, &_tcpKeepCount) > -1; + if (!success) + _isKeepAlive = false; +#endif + +#endif + } + } + + ret = connected(); + if (!ret) + stop(); +#endif + return ret; + } + + /** + * Upgrade the current connection by setting up the SSL and perform the SSL handshake. + * + * @param verify The Root CA certificate verification option + * @return operating result. + */ + + bool connectSSL(bool verify) + { +#if !defined(ESP_MAIL_DISABLE_SSL) + _tcp_client->setDebugLevel(2); + + bool ret = _tcp_client->connected(); + + if (ret) + { + setVerify(verify); + ret = _tcp_client->connectSSL(_host.c_str(), _port); + if (ret) + _secured = true; + } + + if (!ret) + stop(); + + return ret; +#endif + return false; + } + + /** + * Stop TCP connection. + */ + void stop() + { + if (_tcp_client) + _tcp_client->stop(); + } + + /** + * Get the TCP connection status. + * @return true for connected or false for not connected. + */ + bool connected() { return _tcp_client && _tcp_client->connected(); }; + + /** + * The TCP data write function. + * @param data The data to write. + * @param len The length of data to write. + * @return The size of data that was successfully written or 0 for error. + */ + int write(uint8_t *data, int len) + { + if (!_tcp_client) + return TCP_CLIENT_ERROR_NOT_INITIALIZED; + + if (!data) + return TCP_CLIENT_ERROR_SEND_DATA_FAILED; + + if (len == 0) + return TCP_CLIENT_ERROR_SEND_DATA_FAILED; + + if (!networkReady()) + return TCP_CLIENT_ERROR_NOT_CONNECTED; + + if (!connect(isSecure(), isVerify())) + return TCP_CLIENT_ERROR_CONNECTION_REFUSED; + + int toSend = _chunkSize; + int sent = 0; + while (sent < len) + { + if (sent + toSend > len) + toSend = len - sent; + + if ((int)_tcp_client->write(data + sent, toSend) != toSend) + return TCP_CLIENT_ERROR_SEND_DATA_FAILED; + + sent += toSend; + } + + return len; + } + + /** + * The TCP data send function. + * @param data The data to send. + * @return The size of data that was successfully sent or 0 for error. + */ + int send(const char *data) { return write((uint8_t *)data, strlen(data)); } + + /** + * The TCP data print function. + * @param data The data to print. + * @return The size of data that was successfully print or 0 for error. + */ + int print(const char *data) { return send(data); } + + /** + * The TCP data print function. + * @param data The data to print. + * @return The size of data that was successfully print or 0 for error. + */ + int print(int data) + { + char buf[64]; + memset(buf, 0, 64); + sprintf(buf, (const char *)FPSTR("%d"), data); + int ret = send(buf); + return ret; + } + + /** + * The TCP data print with new line function. + * @param data The data to print. + * @return The size of data that was successfully print or 0 for error. + */ + int println(const char *data) + { + int len = send(data); + if (len < 0) + return len; + int sz = send((const char *)FPSTR("\r\n")); + if (sz < 0) + return sz; + return len + sz; + } + + /** + * The TCP data print with new line function. + * @param data The data to print. + * @return The size of data that was successfully print or 0 for error. + */ + int println(int data) + { + char buf[64]; + memset(buf, 0, 64); + sprintf(buf, (const char *)FPSTR("%d\r\n"), data); + int ret = send(buf); + return ret; + } + + /** + * Get available data size to read. + * @return The avaiable data size. + */ + int available() + { + if (!_basic_client) + return TCP_CLIENT_ERROR_NOT_INITIALIZED; + + return _tcp_client->available(); + } + + /** + * The TCP data read function. + * @return The read value or -1 for error. + */ + int read() + { + if (!_basic_client) + return TCP_CLIENT_ERROR_NOT_INITIALIZED; + + return _tcp_client->read(); + } + + /** + * The TCP data read function. + * @param buf The data buffer. + * @param len The length of data that read. + * @return The size of data that was successfully read or negative value for error. + */ + int readBytes(uint8_t *buf, int len) + { + if (!_basic_client) + return TCP_CLIENT_ERROR_NOT_INITIALIZED; + + return _tcp_client->read(buf, len); + } + + /** + * The TCP data read function. + * @param buf The data buffer. + * @param len The length of data that read. + * @return The size of data that was successfully read or negative value for error. + */ + int readBytes(char *buf, int len) + { + return readBytes((uint8_t *)buf, len); + } + + /** + * Wait for all receive buffer data read. + */ + void flush() + { + if (_tcp_client) + _tcp_client->flush(); + } + + /** + * Set the network connection request callback. + * @param networkConnectionCB The callback function that handles the network connection. + */ + void networkConnectionRequestCallback(NetworkConnectionRequestCallback networkConnectionCB) + { + _network_connection_cb = networkConnectionCB; + } + + /** + * Set the network status request callback. + * @param networkStatusCB The callback function that calls the setNetworkStatus function to set the network status. + */ + void networkStatusRequestCallback(NetworkStatusRequestCallback networkStatusCB) + { + _network_status_cb = networkStatusCB; + } + + /** + * Set the network status which should call in side the networkStatusRequestCallback function. + * @param status The status of network. + */ + void setNetworkStatus(bool status) + { + _network_status = status; + } + + void setMBFS(MB_FS *mbfs) { _mbfs = mbfs; } + +#if defined(ENABLE_SMTP) || defined(ENABLE_IMAP) + void setSession(Session_Config *session_config) + { + _session_config = session_config; + } +#endif + + void setClockReady(bool rdy) + { + _clock_ready = rdy; + } + + void setCertType(esp_mail_cert_type type) { _cert_type = type; } + + esp_mail_cert_type getCertType() { return _cert_type; } + + void setDebugLevel(int debug) { _debug_level = debug; } + + unsigned long tcpTimeout() + { + if (_tcp_client) + return 1000 * _tcp_client->getTimeout(); + return 0; + } + + void disconnect(){}; + + void keepAlive(int tcpKeepIdleSeconds, int tcpKeepIntervalSeconds, int tcpKeepCount) + { + _tcpKeepIdleSeconds = tcpKeepIdleSeconds; + _tcpKeepIntervalSeconds = tcpKeepIntervalSeconds; + _tcpKeepCount = tcpKeepCount; + _isKeepAlive = tcpKeepIdleSeconds > 0 && tcpKeepIntervalSeconds > 0 && tcpKeepCount > 0; + } + + bool isKeepAliveSet() { return _tcpKeepIdleSeconds > -1 && _tcpKeepIntervalSeconds > -1 && _tcpKeepCount > -1; }; + + bool isKeepAlive() { return _isKeepAlive; }; + + void clear() + { +#if !defined(ESP_MAIL_DISABLE_SSL) + if (_basic_client && _client_type == esp_mail_client_type_internal_basic_client) + { +#if defined(ESP_MAIL_WIFI_IS_AVAILABLE) + delete (BASE_WIFICLIENT *)_basic_client; +#else + delete _basic_client; +#endif + _basic_client = nullptr; + } +#else + _basic_client = nullptr; +#endif + _client_type = esp_mail_client_type_undefined; + } + + void setWiFi(esp_mail_wifi_credentials_t *wifi) { _wifi_multi = wifi; } + + bool gprsConnect() + { +#if defined(ESP_MAIL_GSM_MODEM_IS_AVAILABLE) + TinyGsm *gsmModem = (TinyGsm *)_modem; + if (gsmModem) + { + // Unlock your SIM card with a PIN if needed + if (_pin.length() && gsmModem->getSimStatus() != 3) + gsmModem->simUnlock(_pin.c_str()); + +#if defined(TINY_GSM_MODEM_XBEE) + // The XBee must run the gprsConnect function BEFORE waiting for network! + gsmModem->gprsConnect(_apn.c_str(), _user.c_str(), _password.c_str()); +#endif + +#if !defined(SILENT_MODE) && (defined(ENABLE_IMAP) || defined(ENABLE_SMTP)) + if (_debug_level > 0 && _last_error == 0) + esp_mail_debug_print_tag((const char *)MBSTRING_FLASH_MCR("Waiting for network..."), esp_mail_debug_tag_type_info, false); +#endif + if (!gsmModem->waitForNetwork()) + { +#if !defined(SILENT_MODE) && (defined(ENABLE_IMAP) || defined(ENABLE_SMTP)) + if (_debug_level > 0 && _last_error == 0) + esp_mail_debug_print_tag((const char *)MBSTRING_FLASH_MCR(" fail"), esp_mail_debug_tag_type_info, true, false); +#endif + _last_error = 1; + _network_status = false; + return false; + } + +#if !defined(SILENT_MODE) && (defined(ENABLE_IMAP) || defined(ENABLE_SMTP)) + if (_debug_level > 0 && _last_error == 0) + esp_mail_debug_print_tag((const char *)MBSTRING_FLASH_MCR(" success"), esp_mail_debug_tag_type_info, true, false); +#endif + + if (gsmModem->isNetworkConnected()) + { +#if !defined(SILENT_MODE) && (defined(ENABLE_IMAP) || defined(ENABLE_SMTP)) + if (_debug_level > 0 && _last_error == 0) + { + esp_mail_debug_print_tag((const char *)MBSTRING_FLASH_MCR("Connecting to "), esp_mail_debug_tag_type_info, false); + esp_mail_debug_print_tag(_apn.c_str(), esp_mail_debug_tag_type_info, false, false); + } +#endif + _network_status = gsmModem->gprsConnect(_apn.c_str(), _user.c_str(), _password.c_str()) && + gsmModem->isGprsConnected(); + +#if !defined(SILENT_MODE) && (defined(ENABLE_IMAP) || defined(ENABLE_SMTP)) + if (_debug_level > 0 && _last_error == 0) + { + if (_network_status) + esp_mail_debug_print_tag((const char *)MBSTRING_FLASH_MCR(" success"), esp_mail_debug_tag_type_info, true, false); + else + esp_mail_debug_print_tag((const char *)MBSTRING_FLASH_MCR(" fail"), esp_mail_debug_tag_type_info, true, false); + } +#endif + } + + if (!_network_status) + _last_error = 1; + + return _network_status; + } + +#endif + return false; + } + + bool gprsConnected() + { +#if defined(ESP_MAIL_GSM_MODEM_IS_AVAILABLE) + TinyGsm *gsmModem = (TinyGsm *)_modem; + _network_status = gsmModem && gsmModem->isGprsConnected(); +#endif + return _network_status; + } + + bool gprsDisconnect() + { +#if defined(ESP_MAIL_GSM_MODEM_IS_AVAILABLE) + TinyGsm *gsmModem = (TinyGsm *)_modem; + _network_status = gsmModem && gsmModem->gprsDisconnect(); +#endif + return !_network_status; + } + + bool gprsGetTime(int &year, int &month, int &day, int &hour, int &min, int &sec, float &timezone) + { +#if defined(ESP_MAIL_GSM_MODEM_IS_AVAILABLE) && defined(TINY_GSM_MODEM_HAS_TIME) + + if (!gprsConnected()) + return 0; + + TinyGsm *gsmModem = (TinyGsm *)_modem; + year = 0; + month = 0; + day = 0; + hour = 0; + min = 0; + sec = 0; + timezone = 0; + for (int8_t i = 5; i; i--) + { + if (gsmModem->getNetworkTime(&year, &month, &day, &hour, &min, &sec, &timezone)) + { + return true; + } + } +#endif + return false; + } + + bool ethernetConnect() + { + bool ret = false; + +#if defined(ESP_MAIL_ETHERNET_MODULE_IS_AVAILABLE) + + if (_ethernet_cs_pin > -1) + ETH_MODULE_CLASS.init(_ethernet_cs_pin); + + if (_ethernet_reset_pin > -1) + { + +#if !defined(SILENT_MODE) && (defined(ENABLE_IMAP) || defined(ENABLE_SMTP)) + if (_debug_level > 0) + esp_mail_debug_print_tag((const char *)MBSTRING_FLASH_MCR("Resetting Ethernet Board..."), esp_mail_debug_tag_type_info, true); +#endif + + pinMode(_ethernet_reset_pin, OUTPUT); + digitalWrite(_ethernet_reset_pin, HIGH); + delay(200); + digitalWrite(_ethernet_reset_pin, LOW); + delay(50); + digitalWrite(_ethernet_reset_pin, HIGH); + delay(200); + } + +#if !defined(SILENT_MODE) && (defined(ENABLE_IMAP) || defined(ENABLE_SMTP)) + if (_debug_level > 0) + esp_mail_debug_print_tag((const char *)MBSTRING_FLASH_MCR("Starting Ethernet connection..."), esp_mail_debug_tag_type_info, true); +#endif + if (_static_ip) + { + + if (_static_ip->optional == false) + ETH_MODULE_CLASS.begin(_ethernet_mac, _static_ip->ipAddress, _static_ip->dnsServer, _static_ip->defaultGateway, _static_ip->netMask); + else if (!ETH_MODULE_CLASS.begin(_ethernet_mac)) + { + ETH_MODULE_CLASS.begin(_ethernet_mac, _static_ip->ipAddress, _static_ip->dnsServer, _static_ip->defaultGateway, _static_ip->netMask); + } + } + else + ETH_MODULE_CLASS.begin(_ethernet_mac); + + unsigned long to = millis(); + + while (ETH_MODULE_CLASS.linkStatus() == LinkOFF && millis() - to < ESP_MAIL_ETHERNET_MODULE_TIMEOUT) + { + delay(100); + } + + ret = ethernetConnected(); + +#if !defined(SILENT_MODE) && (defined(ENABLE_IMAP) || defined(ENABLE_SMTP)) + if (_debug_level > 0) + { + if (ret) + { + esp_mail_debug_print_tag((const char *)MBSTRING_FLASH_MCR("Connected with IP "), esp_mail_debug_tag_type_info, false); + ESP_MAIL_DEFAULT_DEBUG_PORT.println(ETH_MODULE_CLASS.localIP()); + } + else + esp_mail_debug_print_tag((const char *)MBSTRING_FLASH_MCR("Can't connect"), esp_mail_debug_tag_type_error, true); + } +#endif + +#endif + + return ret; + } + + bool ethernetConnected() + { +#if defined(ESP_MAIL_ETHERNET_MODULE_IS_AVAILABLE) + _network_status = ETH_MODULE_CLASS.linkStatus() == LinkON && validIP(ETH_MODULE_CLASS.localIP()); + + if (!_network_status) + { + delay(ESP_MAIL_ETHERNET_MODULE_TIMEOUT); + _network_status = ETH_MODULE_CLASS.linkStatus() == LinkON && validIP(ETH_MODULE_CLASS.localIP()); + } + +#endif + return _network_status; + } + + int setOption(int option, int *value) + { +#if defined(ESP32) && defined(ESP_MAIL_WIFI_IS_AVAILABLE) + // Actually we wish to use setSocketOption directly but it is ambiguous in old ESP32 core v1.0.x.; + // Use setOption instead for old core support. + return reinterpret_cast(_basic_client)->setOption(option, value); +#endif + return 0; + } + + void setTA(bool hasTA) + { + _has_ta = hasTA; + } + + void setSecure(bool secure) + { + _secured = secure; + } + + void setInSecure() + { +#if !defined(ESP_MAIL_DISABLE_SSL) + _use_insecure = true; + setTA(false); +#endif + } + + void setVerify(bool verify) + { +#if !defined(ESP_MAIL_DISABLE_SSL) + if (_has_ta) + _use_insecure = !verify; + + if (_use_insecure) + _tcp_client->setInsecure(); +#endif + } + + bool isSecure() + { + return _secured; + } + + bool isVerify() + { + return !_use_insecure; + } + + int rxBufDivider = 16; + int txBufDivider = 32; + +private: + // lwIP TCP Keepalive idle in seconds. + int _tcpKeepIdleSeconds = -1; + // lwIP TCP Keepalive interval in seconds. + int _tcpKeepIntervalSeconds = -1; + // lwIP TCP Keepalive count. + int _tcpKeepCount = -1; + bool _isKeepAlive = false; + + uint16_t _bsslRxSize = 1024; + uint16_t _bsslTxSize = 1024; + const int _maxRXBufSize = 16384; // SSL full supported 16 kB + const int _maxTXBufSize = 16384; + const int _minRXTXBufSize = 512; +#if defined(ESP_MAIL_DISABLE_SSL) + Client *_tcp_client = nullptr; +#else + ESP_SSLClient *_tcp_client = nullptr; + X509List *_x509 = nullptr; +#endif + + MB_String _host; + uint16_t _port = 443; + + MB_FS *_mbfs = nullptr; + Client *_basic_client = nullptr; + esp_mail_wifi_credentials_t *_wifi_multi = nullptr; + int _ethernet_reset_pin = -1; + int _ethernet_cs_pin = -1; + uint8_t *_ethernet_mac = nullptr; + ESP_Mail_StaticIP *_static_ip = nullptr; +#if defined(ENABLE_SMTP) || defined(ENABLE_IMAP) + Session_Config *_session_config = nullptr; +#endif + NetworkConnectionRequestCallback _network_connection_cb = NULL; + NetworkStatusRequestCallback _network_status_cb = NULL; +#if defined(ESP_MAIL_HAS_WIFIMULTI) + WiFiMulti *_multi = nullptr; +#endif +#if defined(ESP_MAIL_GSM_MODEM_IS_AVAILABLE) + MB_String _pin, _apn, _user, _password; + void *_modem = nullptr; +#endif + + bool _has_ta = false; + bool _secured = false; + bool _use_insecure = false; + int _debug_level = 0; + int _chunkSize = 1024; + bool _clock_ready = false; + int _last_error = 0; + volatile bool _network_status = false; + int _rx_size = -1, _tx_size = -1; + + esp_mail_cert_type _cert_type = esp_mail_cert_type_undefined; + esp_mail_client_type _client_type = esp_mail_client_type_undefined; +}; + +#endif \ No newline at end of file diff --git a/src/SSLClient/Custom_ESP_SSLClient_FS.h b/src/client/SSLClient/Custom_ESP_SSLClient_FS.h similarity index 100% rename from src/SSLClient/Custom_ESP_SSLClient_FS.h rename to src/client/SSLClient/Custom_ESP_SSLClient_FS.h diff --git a/src/SSLClient/ESP_SSLClient.h b/src/client/SSLClient/ESP_SSLClient.h similarity index 100% rename from src/SSLClient/ESP_SSLClient.h rename to src/client/SSLClient/ESP_SSLClient.h diff --git a/src/SSLClient/ESP_SSLClient_Const.h b/src/client/SSLClient/ESP_SSLClient_Const.h similarity index 100% rename from src/SSLClient/ESP_SSLClient_Const.h rename to src/client/SSLClient/ESP_SSLClient_Const.h diff --git a/src/SSLClient/ESP_SSLClient_FS.h b/src/client/SSLClient/ESP_SSLClient_FS.h similarity index 100% rename from src/SSLClient/ESP_SSLClient_FS.h rename to src/client/SSLClient/ESP_SSLClient_FS.h diff --git a/src/SSLClient/bssl/aes_big_cbcdec.c b/src/client/SSLClient/bssl/aes_big_cbcdec.c similarity index 100% rename from src/SSLClient/bssl/aes_big_cbcdec.c rename to src/client/SSLClient/bssl/aes_big_cbcdec.c diff --git a/src/SSLClient/bssl/aes_big_cbcenc.c b/src/client/SSLClient/bssl/aes_big_cbcenc.c similarity index 100% rename from src/SSLClient/bssl/aes_big_cbcenc.c rename to src/client/SSLClient/bssl/aes_big_cbcenc.c diff --git a/src/SSLClient/bssl/aes_big_ctr.c b/src/client/SSLClient/bssl/aes_big_ctr.c similarity index 100% rename from src/SSLClient/bssl/aes_big_ctr.c rename to src/client/SSLClient/bssl/aes_big_ctr.c diff --git a/src/SSLClient/bssl/aes_big_ctrcbc.c b/src/client/SSLClient/bssl/aes_big_ctrcbc.c similarity index 100% rename from src/SSLClient/bssl/aes_big_ctrcbc.c rename to src/client/SSLClient/bssl/aes_big_ctrcbc.c diff --git a/src/SSLClient/bssl/aes_big_dec.c b/src/client/SSLClient/bssl/aes_big_dec.c similarity index 100% rename from src/SSLClient/bssl/aes_big_dec.c rename to src/client/SSLClient/bssl/aes_big_dec.c diff --git a/src/SSLClient/bssl/aes_big_enc.c b/src/client/SSLClient/bssl/aes_big_enc.c similarity index 100% rename from src/SSLClient/bssl/aes_big_enc.c rename to src/client/SSLClient/bssl/aes_big_enc.c diff --git a/src/SSLClient/bssl/aes_common.c b/src/client/SSLClient/bssl/aes_common.c similarity index 100% rename from src/SSLClient/bssl/aes_common.c rename to src/client/SSLClient/bssl/aes_common.c diff --git a/src/SSLClient/bssl/aes_ct.c b/src/client/SSLClient/bssl/aes_ct.c similarity index 100% rename from src/SSLClient/bssl/aes_ct.c rename to src/client/SSLClient/bssl/aes_ct.c diff --git a/src/SSLClient/bssl/aes_ct64.c b/src/client/SSLClient/bssl/aes_ct64.c similarity index 100% rename from src/SSLClient/bssl/aes_ct64.c rename to src/client/SSLClient/bssl/aes_ct64.c diff --git a/src/SSLClient/bssl/aes_ct64_cbcdec.c b/src/client/SSLClient/bssl/aes_ct64_cbcdec.c similarity index 100% rename from src/SSLClient/bssl/aes_ct64_cbcdec.c rename to src/client/SSLClient/bssl/aes_ct64_cbcdec.c diff --git a/src/SSLClient/bssl/aes_ct64_cbcenc.c b/src/client/SSLClient/bssl/aes_ct64_cbcenc.c similarity index 100% rename from src/SSLClient/bssl/aes_ct64_cbcenc.c rename to src/client/SSLClient/bssl/aes_ct64_cbcenc.c diff --git a/src/SSLClient/bssl/aes_ct64_ctr.c b/src/client/SSLClient/bssl/aes_ct64_ctr.c similarity index 100% rename from src/SSLClient/bssl/aes_ct64_ctr.c rename to src/client/SSLClient/bssl/aes_ct64_ctr.c diff --git a/src/SSLClient/bssl/aes_ct64_ctrcbc.c b/src/client/SSLClient/bssl/aes_ct64_ctrcbc.c similarity index 100% rename from src/SSLClient/bssl/aes_ct64_ctrcbc.c rename to src/client/SSLClient/bssl/aes_ct64_ctrcbc.c diff --git a/src/SSLClient/bssl/aes_ct64_dec.c b/src/client/SSLClient/bssl/aes_ct64_dec.c similarity index 100% rename from src/SSLClient/bssl/aes_ct64_dec.c rename to src/client/SSLClient/bssl/aes_ct64_dec.c diff --git a/src/SSLClient/bssl/aes_ct64_enc.c b/src/client/SSLClient/bssl/aes_ct64_enc.c similarity index 100% rename from src/SSLClient/bssl/aes_ct64_enc.c rename to src/client/SSLClient/bssl/aes_ct64_enc.c diff --git a/src/SSLClient/bssl/aes_ct_cbcdec.c b/src/client/SSLClient/bssl/aes_ct_cbcdec.c similarity index 100% rename from src/SSLClient/bssl/aes_ct_cbcdec.c rename to src/client/SSLClient/bssl/aes_ct_cbcdec.c diff --git a/src/SSLClient/bssl/aes_ct_cbcenc.c b/src/client/SSLClient/bssl/aes_ct_cbcenc.c similarity index 100% rename from src/SSLClient/bssl/aes_ct_cbcenc.c rename to src/client/SSLClient/bssl/aes_ct_cbcenc.c diff --git a/src/SSLClient/bssl/aes_ct_ctr.c b/src/client/SSLClient/bssl/aes_ct_ctr.c similarity index 100% rename from src/SSLClient/bssl/aes_ct_ctr.c rename to src/client/SSLClient/bssl/aes_ct_ctr.c diff --git a/src/SSLClient/bssl/aes_ct_ctrcbc.c b/src/client/SSLClient/bssl/aes_ct_ctrcbc.c similarity index 100% rename from src/SSLClient/bssl/aes_ct_ctrcbc.c rename to src/client/SSLClient/bssl/aes_ct_ctrcbc.c diff --git a/src/SSLClient/bssl/aes_ct_dec.c b/src/client/SSLClient/bssl/aes_ct_dec.c similarity index 100% rename from src/SSLClient/bssl/aes_ct_dec.c rename to src/client/SSLClient/bssl/aes_ct_dec.c diff --git a/src/SSLClient/bssl/aes_ct_enc.c b/src/client/SSLClient/bssl/aes_ct_enc.c similarity index 100% rename from src/SSLClient/bssl/aes_ct_enc.c rename to src/client/SSLClient/bssl/aes_ct_enc.c diff --git a/src/SSLClient/bssl/aes_pwr8.c b/src/client/SSLClient/bssl/aes_pwr8.c similarity index 100% rename from src/SSLClient/bssl/aes_pwr8.c rename to src/client/SSLClient/bssl/aes_pwr8.c diff --git a/src/SSLClient/bssl/aes_pwr8_cbcdec.c b/src/client/SSLClient/bssl/aes_pwr8_cbcdec.c similarity index 100% rename from src/SSLClient/bssl/aes_pwr8_cbcdec.c rename to src/client/SSLClient/bssl/aes_pwr8_cbcdec.c diff --git a/src/SSLClient/bssl/aes_pwr8_cbcenc.c b/src/client/SSLClient/bssl/aes_pwr8_cbcenc.c similarity index 100% rename from src/SSLClient/bssl/aes_pwr8_cbcenc.c rename to src/client/SSLClient/bssl/aes_pwr8_cbcenc.c diff --git a/src/SSLClient/bssl/aes_pwr8_ctr.c b/src/client/SSLClient/bssl/aes_pwr8_ctr.c similarity index 100% rename from src/SSLClient/bssl/aes_pwr8_ctr.c rename to src/client/SSLClient/bssl/aes_pwr8_ctr.c diff --git a/src/SSLClient/bssl/aes_pwr8_ctrcbc.c b/src/client/SSLClient/bssl/aes_pwr8_ctrcbc.c similarity index 100% rename from src/SSLClient/bssl/aes_pwr8_ctrcbc.c rename to src/client/SSLClient/bssl/aes_pwr8_ctrcbc.c diff --git a/src/SSLClient/bssl/aes_small_cbcdec.c b/src/client/SSLClient/bssl/aes_small_cbcdec.c similarity index 100% rename from src/SSLClient/bssl/aes_small_cbcdec.c rename to src/client/SSLClient/bssl/aes_small_cbcdec.c diff --git a/src/SSLClient/bssl/aes_small_cbcenc.c b/src/client/SSLClient/bssl/aes_small_cbcenc.c similarity index 100% rename from src/SSLClient/bssl/aes_small_cbcenc.c rename to src/client/SSLClient/bssl/aes_small_cbcenc.c diff --git a/src/SSLClient/bssl/aes_small_ctr.c b/src/client/SSLClient/bssl/aes_small_ctr.c similarity index 100% rename from src/SSLClient/bssl/aes_small_ctr.c rename to src/client/SSLClient/bssl/aes_small_ctr.c diff --git a/src/SSLClient/bssl/aes_small_ctrcbc.c b/src/client/SSLClient/bssl/aes_small_ctrcbc.c similarity index 100% rename from src/SSLClient/bssl/aes_small_ctrcbc.c rename to src/client/SSLClient/bssl/aes_small_ctrcbc.c diff --git a/src/SSLClient/bssl/aes_small_dec.c b/src/client/SSLClient/bssl/aes_small_dec.c similarity index 100% rename from src/SSLClient/bssl/aes_small_dec.c rename to src/client/SSLClient/bssl/aes_small_dec.c diff --git a/src/SSLClient/bssl/aes_small_enc.c b/src/client/SSLClient/bssl/aes_small_enc.c similarity index 100% rename from src/SSLClient/bssl/aes_small_enc.c rename to src/client/SSLClient/bssl/aes_small_enc.c diff --git a/src/SSLClient/bssl/aes_x86ni.c b/src/client/SSLClient/bssl/aes_x86ni.c similarity index 100% rename from src/SSLClient/bssl/aes_x86ni.c rename to src/client/SSLClient/bssl/aes_x86ni.c diff --git a/src/SSLClient/bssl/aes_x86ni_cbcdec.c b/src/client/SSLClient/bssl/aes_x86ni_cbcdec.c similarity index 100% rename from src/SSLClient/bssl/aes_x86ni_cbcdec.c rename to src/client/SSLClient/bssl/aes_x86ni_cbcdec.c diff --git a/src/SSLClient/bssl/aes_x86ni_cbcenc.c b/src/client/SSLClient/bssl/aes_x86ni_cbcenc.c similarity index 100% rename from src/SSLClient/bssl/aes_x86ni_cbcenc.c rename to src/client/SSLClient/bssl/aes_x86ni_cbcenc.c diff --git a/src/SSLClient/bssl/aes_x86ni_ctr.c b/src/client/SSLClient/bssl/aes_x86ni_ctr.c similarity index 100% rename from src/SSLClient/bssl/aes_x86ni_ctr.c rename to src/client/SSLClient/bssl/aes_x86ni_ctr.c diff --git a/src/SSLClient/bssl/aes_x86ni_ctrcbc.c b/src/client/SSLClient/bssl/aes_x86ni_ctrcbc.c similarity index 100% rename from src/SSLClient/bssl/aes_x86ni_ctrcbc.c rename to src/client/SSLClient/bssl/aes_x86ni_ctrcbc.c diff --git a/src/SSLClient/bssl/aesctr_drbg.c b/src/client/SSLClient/bssl/aesctr_drbg.c similarity index 100% rename from src/SSLClient/bssl/aesctr_drbg.c rename to src/client/SSLClient/bssl/aesctr_drbg.c diff --git a/src/SSLClient/bssl/asn1.t0 b/src/client/SSLClient/bssl/asn1.t0 similarity index 100% rename from src/SSLClient/bssl/asn1.t0 rename to src/client/SSLClient/bssl/asn1.t0 diff --git a/src/SSLClient/bssl/asn1enc.c b/src/client/SSLClient/bssl/asn1enc.c similarity index 100% rename from src/SSLClient/bssl/asn1enc.c rename to src/client/SSLClient/bssl/asn1enc.c diff --git a/src/SSLClient/bssl/bearssl.h b/src/client/SSLClient/bssl/bearssl.h similarity index 100% rename from src/SSLClient/bssl/bearssl.h rename to src/client/SSLClient/bssl/bearssl.h diff --git a/src/SSLClient/bssl/bearssl_aead.h b/src/client/SSLClient/bssl/bearssl_aead.h similarity index 100% rename from src/SSLClient/bssl/bearssl_aead.h rename to src/client/SSLClient/bssl/bearssl_aead.h diff --git a/src/SSLClient/bssl/bearssl_block.h b/src/client/SSLClient/bssl/bearssl_block.h similarity index 100% rename from src/SSLClient/bssl/bearssl_block.h rename to src/client/SSLClient/bssl/bearssl_block.h diff --git a/src/SSLClient/bssl/bearssl_ec.h b/src/client/SSLClient/bssl/bearssl_ec.h similarity index 100% rename from src/SSLClient/bssl/bearssl_ec.h rename to src/client/SSLClient/bssl/bearssl_ec.h diff --git a/src/SSLClient/bssl/bearssl_hash.h b/src/client/SSLClient/bssl/bearssl_hash.h similarity index 100% rename from src/SSLClient/bssl/bearssl_hash.h rename to src/client/SSLClient/bssl/bearssl_hash.h diff --git a/src/SSLClient/bssl/bearssl_hmac.h b/src/client/SSLClient/bssl/bearssl_hmac.h similarity index 100% rename from src/SSLClient/bssl/bearssl_hmac.h rename to src/client/SSLClient/bssl/bearssl_hmac.h diff --git a/src/SSLClient/bssl/bearssl_kdf.h b/src/client/SSLClient/bssl/bearssl_kdf.h similarity index 100% rename from src/SSLClient/bssl/bearssl_kdf.h rename to src/client/SSLClient/bssl/bearssl_kdf.h diff --git a/src/SSLClient/bssl/bearssl_pem.h b/src/client/SSLClient/bssl/bearssl_pem.h similarity index 100% rename from src/SSLClient/bssl/bearssl_pem.h rename to src/client/SSLClient/bssl/bearssl_pem.h diff --git a/src/SSLClient/bssl/bearssl_prf.h b/src/client/SSLClient/bssl/bearssl_prf.h similarity index 100% rename from src/SSLClient/bssl/bearssl_prf.h rename to src/client/SSLClient/bssl/bearssl_prf.h diff --git a/src/SSLClient/bssl/bearssl_rand.h b/src/client/SSLClient/bssl/bearssl_rand.h similarity index 100% rename from src/SSLClient/bssl/bearssl_rand.h rename to src/client/SSLClient/bssl/bearssl_rand.h diff --git a/src/SSLClient/bssl/bearssl_rsa.h b/src/client/SSLClient/bssl/bearssl_rsa.h similarity index 100% rename from src/SSLClient/bssl/bearssl_rsa.h rename to src/client/SSLClient/bssl/bearssl_rsa.h diff --git a/src/SSLClient/bssl/bearssl_ssl.h b/src/client/SSLClient/bssl/bearssl_ssl.h similarity index 100% rename from src/SSLClient/bssl/bearssl_ssl.h rename to src/client/SSLClient/bssl/bearssl_ssl.h diff --git a/src/SSLClient/bssl/bearssl_x509.h b/src/client/SSLClient/bssl/bearssl_x509.h similarity index 100% rename from src/SSLClient/bssl/bearssl_x509.h rename to src/client/SSLClient/bssl/bearssl_x509.h diff --git a/src/SSLClient/bssl/ccm.c b/src/client/SSLClient/bssl/ccm.c similarity index 100% rename from src/SSLClient/bssl/ccm.c rename to src/client/SSLClient/bssl/ccm.c diff --git a/src/SSLClient/bssl/ccopy.c b/src/client/SSLClient/bssl/ccopy.c similarity index 100% rename from src/SSLClient/bssl/ccopy.c rename to src/client/SSLClient/bssl/ccopy.c diff --git a/src/SSLClient/bssl/chacha20_ct.c b/src/client/SSLClient/bssl/chacha20_ct.c similarity index 100% rename from src/SSLClient/bssl/chacha20_ct.c rename to src/client/SSLClient/bssl/chacha20_ct.c diff --git a/src/SSLClient/bssl/chacha20_sse2.c b/src/client/SSLClient/bssl/chacha20_sse2.c similarity index 100% rename from src/SSLClient/bssl/chacha20_sse2.c rename to src/client/SSLClient/bssl/chacha20_sse2.c diff --git a/src/SSLClient/bssl/config.h b/src/client/SSLClient/bssl/config.h similarity index 100% rename from src/SSLClient/bssl/config.h rename to src/client/SSLClient/bssl/config.h diff --git a/src/SSLClient/bssl/dec16be.c b/src/client/SSLClient/bssl/dec16be.c similarity index 100% rename from src/SSLClient/bssl/dec16be.c rename to src/client/SSLClient/bssl/dec16be.c diff --git a/src/SSLClient/bssl/dec16le.c b/src/client/SSLClient/bssl/dec16le.c similarity index 100% rename from src/SSLClient/bssl/dec16le.c rename to src/client/SSLClient/bssl/dec16le.c diff --git a/src/SSLClient/bssl/dec32be.c b/src/client/SSLClient/bssl/dec32be.c similarity index 100% rename from src/SSLClient/bssl/dec32be.c rename to src/client/SSLClient/bssl/dec32be.c diff --git a/src/SSLClient/bssl/dec32le.c b/src/client/SSLClient/bssl/dec32le.c similarity index 100% rename from src/SSLClient/bssl/dec32le.c rename to src/client/SSLClient/bssl/dec32le.c diff --git a/src/SSLClient/bssl/dec64be.c b/src/client/SSLClient/bssl/dec64be.c similarity index 100% rename from src/SSLClient/bssl/dec64be.c rename to src/client/SSLClient/bssl/dec64be.c diff --git a/src/SSLClient/bssl/dec64le.c b/src/client/SSLClient/bssl/dec64le.c similarity index 100% rename from src/SSLClient/bssl/dec64le.c rename to src/client/SSLClient/bssl/dec64le.c diff --git a/src/SSLClient/bssl/des_ct.c b/src/client/SSLClient/bssl/des_ct.c similarity index 100% rename from src/SSLClient/bssl/des_ct.c rename to src/client/SSLClient/bssl/des_ct.c diff --git a/src/SSLClient/bssl/des_ct_cbcdec.c b/src/client/SSLClient/bssl/des_ct_cbcdec.c similarity index 100% rename from src/SSLClient/bssl/des_ct_cbcdec.c rename to src/client/SSLClient/bssl/des_ct_cbcdec.c diff --git a/src/SSLClient/bssl/des_ct_cbcenc.c b/src/client/SSLClient/bssl/des_ct_cbcenc.c similarity index 100% rename from src/SSLClient/bssl/des_ct_cbcenc.c rename to src/client/SSLClient/bssl/des_ct_cbcenc.c diff --git a/src/SSLClient/bssl/des_support.c b/src/client/SSLClient/bssl/des_support.c similarity index 100% rename from src/SSLClient/bssl/des_support.c rename to src/client/SSLClient/bssl/des_support.c diff --git a/src/SSLClient/bssl/des_tab.c b/src/client/SSLClient/bssl/des_tab.c similarity index 100% rename from src/SSLClient/bssl/des_tab.c rename to src/client/SSLClient/bssl/des_tab.c diff --git a/src/SSLClient/bssl/des_tab_cbcdec.c b/src/client/SSLClient/bssl/des_tab_cbcdec.c similarity index 100% rename from src/SSLClient/bssl/des_tab_cbcdec.c rename to src/client/SSLClient/bssl/des_tab_cbcdec.c diff --git a/src/SSLClient/bssl/des_tab_cbcenc.c b/src/client/SSLClient/bssl/des_tab_cbcenc.c similarity index 100% rename from src/SSLClient/bssl/des_tab_cbcenc.c rename to src/client/SSLClient/bssl/des_tab_cbcenc.c diff --git a/src/SSLClient/bssl/dig_oid.c b/src/client/SSLClient/bssl/dig_oid.c similarity index 100% rename from src/SSLClient/bssl/dig_oid.c rename to src/client/SSLClient/bssl/dig_oid.c diff --git a/src/SSLClient/bssl/dig_size.c b/src/client/SSLClient/bssl/dig_size.c similarity index 100% rename from src/SSLClient/bssl/dig_size.c rename to src/client/SSLClient/bssl/dig_size.c diff --git a/src/SSLClient/bssl/eax.c b/src/client/SSLClient/bssl/eax.c similarity index 100% rename from src/SSLClient/bssl/eax.c rename to src/client/SSLClient/bssl/eax.c diff --git a/src/SSLClient/bssl/ec_all_m15.c b/src/client/SSLClient/bssl/ec_all_m15.c similarity index 100% rename from src/SSLClient/bssl/ec_all_m15.c rename to src/client/SSLClient/bssl/ec_all_m15.c diff --git a/src/SSLClient/bssl/ec_all_m31.c b/src/client/SSLClient/bssl/ec_all_m31.c similarity index 100% rename from src/SSLClient/bssl/ec_all_m31.c rename to src/client/SSLClient/bssl/ec_all_m31.c diff --git a/src/SSLClient/bssl/ec_c25519_i15.c b/src/client/SSLClient/bssl/ec_c25519_i15.c similarity index 100% rename from src/SSLClient/bssl/ec_c25519_i15.c rename to src/client/SSLClient/bssl/ec_c25519_i15.c diff --git a/src/SSLClient/bssl/ec_c25519_i31.c b/src/client/SSLClient/bssl/ec_c25519_i31.c similarity index 100% rename from src/SSLClient/bssl/ec_c25519_i31.c rename to src/client/SSLClient/bssl/ec_c25519_i31.c diff --git a/src/SSLClient/bssl/ec_c25519_m15.c b/src/client/SSLClient/bssl/ec_c25519_m15.c similarity index 100% rename from src/SSLClient/bssl/ec_c25519_m15.c rename to src/client/SSLClient/bssl/ec_c25519_m15.c diff --git a/src/SSLClient/bssl/ec_c25519_m31.c b/src/client/SSLClient/bssl/ec_c25519_m31.c similarity index 100% rename from src/SSLClient/bssl/ec_c25519_m31.c rename to src/client/SSLClient/bssl/ec_c25519_m31.c diff --git a/src/SSLClient/bssl/ec_c25519_m62.c b/src/client/SSLClient/bssl/ec_c25519_m62.c similarity index 100% rename from src/SSLClient/bssl/ec_c25519_m62.c rename to src/client/SSLClient/bssl/ec_c25519_m62.c diff --git a/src/SSLClient/bssl/ec_c25519_m64.c b/src/client/SSLClient/bssl/ec_c25519_m64.c similarity index 100% rename from src/SSLClient/bssl/ec_c25519_m64.c rename to src/client/SSLClient/bssl/ec_c25519_m64.c diff --git a/src/SSLClient/bssl/ec_curve25519.c b/src/client/SSLClient/bssl/ec_curve25519.c similarity index 100% rename from src/SSLClient/bssl/ec_curve25519.c rename to src/client/SSLClient/bssl/ec_curve25519.c diff --git a/src/SSLClient/bssl/ec_default.c b/src/client/SSLClient/bssl/ec_default.c similarity index 100% rename from src/SSLClient/bssl/ec_default.c rename to src/client/SSLClient/bssl/ec_default.c diff --git a/src/SSLClient/bssl/ec_keygen.c b/src/client/SSLClient/bssl/ec_keygen.c similarity index 100% rename from src/SSLClient/bssl/ec_keygen.c rename to src/client/SSLClient/bssl/ec_keygen.c diff --git a/src/SSLClient/bssl/ec_p256_m15.c b/src/client/SSLClient/bssl/ec_p256_m15.c similarity index 100% rename from src/SSLClient/bssl/ec_p256_m15.c rename to src/client/SSLClient/bssl/ec_p256_m15.c diff --git a/src/SSLClient/bssl/ec_p256_m31.c b/src/client/SSLClient/bssl/ec_p256_m31.c similarity index 100% rename from src/SSLClient/bssl/ec_p256_m31.c rename to src/client/SSLClient/bssl/ec_p256_m31.c diff --git a/src/SSLClient/bssl/ec_p256_m62.c b/src/client/SSLClient/bssl/ec_p256_m62.c similarity index 100% rename from src/SSLClient/bssl/ec_p256_m62.c rename to src/client/SSLClient/bssl/ec_p256_m62.c diff --git a/src/SSLClient/bssl/ec_p256_m64.c b/src/client/SSLClient/bssl/ec_p256_m64.c similarity index 100% rename from src/SSLClient/bssl/ec_p256_m64.c rename to src/client/SSLClient/bssl/ec_p256_m64.c diff --git a/src/SSLClient/bssl/ec_prime_i15.c b/src/client/SSLClient/bssl/ec_prime_i15.c similarity index 100% rename from src/SSLClient/bssl/ec_prime_i15.c rename to src/client/SSLClient/bssl/ec_prime_i15.c diff --git a/src/SSLClient/bssl/ec_prime_i31.c b/src/client/SSLClient/bssl/ec_prime_i31.c similarity index 100% rename from src/SSLClient/bssl/ec_prime_i31.c rename to src/client/SSLClient/bssl/ec_prime_i31.c diff --git a/src/SSLClient/bssl/ec_pubkey.c b/src/client/SSLClient/bssl/ec_pubkey.c similarity index 100% rename from src/SSLClient/bssl/ec_pubkey.c rename to src/client/SSLClient/bssl/ec_pubkey.c diff --git a/src/SSLClient/bssl/ec_secp256r1.c b/src/client/SSLClient/bssl/ec_secp256r1.c similarity index 100% rename from src/SSLClient/bssl/ec_secp256r1.c rename to src/client/SSLClient/bssl/ec_secp256r1.c diff --git a/src/SSLClient/bssl/ec_secp384r1.c b/src/client/SSLClient/bssl/ec_secp384r1.c similarity index 100% rename from src/SSLClient/bssl/ec_secp384r1.c rename to src/client/SSLClient/bssl/ec_secp384r1.c diff --git a/src/SSLClient/bssl/ec_secp521r1.c b/src/client/SSLClient/bssl/ec_secp521r1.c similarity index 100% rename from src/SSLClient/bssl/ec_secp521r1.c rename to src/client/SSLClient/bssl/ec_secp521r1.c diff --git a/src/SSLClient/bssl/ecdsa_atr.c b/src/client/SSLClient/bssl/ecdsa_atr.c similarity index 100% rename from src/SSLClient/bssl/ecdsa_atr.c rename to src/client/SSLClient/bssl/ecdsa_atr.c diff --git a/src/SSLClient/bssl/ecdsa_default_sign_asn1.c b/src/client/SSLClient/bssl/ecdsa_default_sign_asn1.c similarity index 100% rename from src/SSLClient/bssl/ecdsa_default_sign_asn1.c rename to src/client/SSLClient/bssl/ecdsa_default_sign_asn1.c diff --git a/src/SSLClient/bssl/ecdsa_default_sign_raw.c b/src/client/SSLClient/bssl/ecdsa_default_sign_raw.c similarity index 100% rename from src/SSLClient/bssl/ecdsa_default_sign_raw.c rename to src/client/SSLClient/bssl/ecdsa_default_sign_raw.c diff --git a/src/SSLClient/bssl/ecdsa_default_vrfy_asn1.c b/src/client/SSLClient/bssl/ecdsa_default_vrfy_asn1.c similarity index 100% rename from src/SSLClient/bssl/ecdsa_default_vrfy_asn1.c rename to src/client/SSLClient/bssl/ecdsa_default_vrfy_asn1.c diff --git a/src/SSLClient/bssl/ecdsa_default_vrfy_raw.c b/src/client/SSLClient/bssl/ecdsa_default_vrfy_raw.c similarity index 100% rename from src/SSLClient/bssl/ecdsa_default_vrfy_raw.c rename to src/client/SSLClient/bssl/ecdsa_default_vrfy_raw.c diff --git a/src/SSLClient/bssl/ecdsa_i15_bits.c b/src/client/SSLClient/bssl/ecdsa_i15_bits.c similarity index 100% rename from src/SSLClient/bssl/ecdsa_i15_bits.c rename to src/client/SSLClient/bssl/ecdsa_i15_bits.c diff --git a/src/SSLClient/bssl/ecdsa_i15_sign_asn1.c b/src/client/SSLClient/bssl/ecdsa_i15_sign_asn1.c similarity index 100% rename from src/SSLClient/bssl/ecdsa_i15_sign_asn1.c rename to src/client/SSLClient/bssl/ecdsa_i15_sign_asn1.c diff --git a/src/SSLClient/bssl/ecdsa_i15_sign_raw.c b/src/client/SSLClient/bssl/ecdsa_i15_sign_raw.c similarity index 100% rename from src/SSLClient/bssl/ecdsa_i15_sign_raw.c rename to src/client/SSLClient/bssl/ecdsa_i15_sign_raw.c diff --git a/src/SSLClient/bssl/ecdsa_i15_vrfy_asn1.c b/src/client/SSLClient/bssl/ecdsa_i15_vrfy_asn1.c similarity index 100% rename from src/SSLClient/bssl/ecdsa_i15_vrfy_asn1.c rename to src/client/SSLClient/bssl/ecdsa_i15_vrfy_asn1.c diff --git a/src/SSLClient/bssl/ecdsa_i15_vrfy_raw.c b/src/client/SSLClient/bssl/ecdsa_i15_vrfy_raw.c similarity index 100% rename from src/SSLClient/bssl/ecdsa_i15_vrfy_raw.c rename to src/client/SSLClient/bssl/ecdsa_i15_vrfy_raw.c diff --git a/src/SSLClient/bssl/ecdsa_i31_bits.c b/src/client/SSLClient/bssl/ecdsa_i31_bits.c similarity index 100% rename from src/SSLClient/bssl/ecdsa_i31_bits.c rename to src/client/SSLClient/bssl/ecdsa_i31_bits.c diff --git a/src/SSLClient/bssl/ecdsa_i31_sign_asn1.c b/src/client/SSLClient/bssl/ecdsa_i31_sign_asn1.c similarity index 100% rename from src/SSLClient/bssl/ecdsa_i31_sign_asn1.c rename to src/client/SSLClient/bssl/ecdsa_i31_sign_asn1.c diff --git a/src/SSLClient/bssl/ecdsa_i31_sign_raw.c b/src/client/SSLClient/bssl/ecdsa_i31_sign_raw.c similarity index 100% rename from src/SSLClient/bssl/ecdsa_i31_sign_raw.c rename to src/client/SSLClient/bssl/ecdsa_i31_sign_raw.c diff --git a/src/SSLClient/bssl/ecdsa_i31_vrfy_asn1.c b/src/client/SSLClient/bssl/ecdsa_i31_vrfy_asn1.c similarity index 100% rename from src/SSLClient/bssl/ecdsa_i31_vrfy_asn1.c rename to src/client/SSLClient/bssl/ecdsa_i31_vrfy_asn1.c diff --git a/src/SSLClient/bssl/ecdsa_i31_vrfy_raw.c b/src/client/SSLClient/bssl/ecdsa_i31_vrfy_raw.c similarity index 100% rename from src/SSLClient/bssl/ecdsa_i31_vrfy_raw.c rename to src/client/SSLClient/bssl/ecdsa_i31_vrfy_raw.c diff --git a/src/SSLClient/bssl/ecdsa_rta.c b/src/client/SSLClient/bssl/ecdsa_rta.c similarity index 100% rename from src/SSLClient/bssl/ecdsa_rta.c rename to src/client/SSLClient/bssl/ecdsa_rta.c diff --git a/src/SSLClient/bssl/enc16be.c b/src/client/SSLClient/bssl/enc16be.c similarity index 100% rename from src/SSLClient/bssl/enc16be.c rename to src/client/SSLClient/bssl/enc16be.c diff --git a/src/SSLClient/bssl/enc16le.c b/src/client/SSLClient/bssl/enc16le.c similarity index 100% rename from src/SSLClient/bssl/enc16le.c rename to src/client/SSLClient/bssl/enc16le.c diff --git a/src/SSLClient/bssl/enc32be.c b/src/client/SSLClient/bssl/enc32be.c similarity index 100% rename from src/SSLClient/bssl/enc32be.c rename to src/client/SSLClient/bssl/enc32be.c diff --git a/src/SSLClient/bssl/enc32le.c b/src/client/SSLClient/bssl/enc32le.c similarity index 100% rename from src/SSLClient/bssl/enc32le.c rename to src/client/SSLClient/bssl/enc32le.c diff --git a/src/SSLClient/bssl/enc64be.c b/src/client/SSLClient/bssl/enc64be.c similarity index 100% rename from src/SSLClient/bssl/enc64be.c rename to src/client/SSLClient/bssl/enc64be.c diff --git a/src/SSLClient/bssl/enc64le.c b/src/client/SSLClient/bssl/enc64le.c similarity index 100% rename from src/SSLClient/bssl/enc64le.c rename to src/client/SSLClient/bssl/enc64le.c diff --git a/src/SSLClient/bssl/encode_ec_pk8der.c b/src/client/SSLClient/bssl/encode_ec_pk8der.c similarity index 100% rename from src/SSLClient/bssl/encode_ec_pk8der.c rename to src/client/SSLClient/bssl/encode_ec_pk8der.c diff --git a/src/SSLClient/bssl/encode_ec_rawder.c b/src/client/SSLClient/bssl/encode_ec_rawder.c similarity index 100% rename from src/SSLClient/bssl/encode_ec_rawder.c rename to src/client/SSLClient/bssl/encode_ec_rawder.c diff --git a/src/SSLClient/bssl/encode_rsa_pk8der.c b/src/client/SSLClient/bssl/encode_rsa_pk8der.c similarity index 100% rename from src/SSLClient/bssl/encode_rsa_pk8der.c rename to src/client/SSLClient/bssl/encode_rsa_pk8der.c diff --git a/src/SSLClient/bssl/encode_rsa_rawder.c b/src/client/SSLClient/bssl/encode_rsa_rawder.c similarity index 100% rename from src/SSLClient/bssl/encode_rsa_rawder.c rename to src/client/SSLClient/bssl/encode_rsa_rawder.c diff --git a/src/SSLClient/bssl/gcm.c b/src/client/SSLClient/bssl/gcm.c similarity index 100% rename from src/SSLClient/bssl/gcm.c rename to src/client/SSLClient/bssl/gcm.c diff --git a/src/SSLClient/bssl/ghash_ctmul.c b/src/client/SSLClient/bssl/ghash_ctmul.c similarity index 100% rename from src/SSLClient/bssl/ghash_ctmul.c rename to src/client/SSLClient/bssl/ghash_ctmul.c diff --git a/src/SSLClient/bssl/ghash_ctmul32.c b/src/client/SSLClient/bssl/ghash_ctmul32.c similarity index 100% rename from src/SSLClient/bssl/ghash_ctmul32.c rename to src/client/SSLClient/bssl/ghash_ctmul32.c diff --git a/src/SSLClient/bssl/ghash_ctmul64.c b/src/client/SSLClient/bssl/ghash_ctmul64.c similarity index 100% rename from src/SSLClient/bssl/ghash_ctmul64.c rename to src/client/SSLClient/bssl/ghash_ctmul64.c diff --git a/src/SSLClient/bssl/ghash_pclmul.c b/src/client/SSLClient/bssl/ghash_pclmul.c similarity index 100% rename from src/SSLClient/bssl/ghash_pclmul.c rename to src/client/SSLClient/bssl/ghash_pclmul.c diff --git a/src/SSLClient/bssl/ghash_pwr8.c b/src/client/SSLClient/bssl/ghash_pwr8.c similarity index 100% rename from src/SSLClient/bssl/ghash_pwr8.c rename to src/client/SSLClient/bssl/ghash_pwr8.c diff --git a/src/SSLClient/bssl/hkdf.c b/src/client/SSLClient/bssl/hkdf.c similarity index 100% rename from src/SSLClient/bssl/hkdf.c rename to src/client/SSLClient/bssl/hkdf.c diff --git a/src/SSLClient/bssl/hmac.c b/src/client/SSLClient/bssl/hmac.c similarity index 100% rename from src/SSLClient/bssl/hmac.c rename to src/client/SSLClient/bssl/hmac.c diff --git a/src/SSLClient/bssl/hmac_ct.c b/src/client/SSLClient/bssl/hmac_ct.c similarity index 100% rename from src/SSLClient/bssl/hmac_ct.c rename to src/client/SSLClient/bssl/hmac_ct.c diff --git a/src/SSLClient/bssl/hmac_drbg.c b/src/client/SSLClient/bssl/hmac_drbg.c similarity index 100% rename from src/SSLClient/bssl/hmac_drbg.c rename to src/client/SSLClient/bssl/hmac_drbg.c diff --git a/src/SSLClient/bssl/i15_add.c b/src/client/SSLClient/bssl/i15_add.c similarity index 100% rename from src/SSLClient/bssl/i15_add.c rename to src/client/SSLClient/bssl/i15_add.c diff --git a/src/SSLClient/bssl/i15_bitlen.c b/src/client/SSLClient/bssl/i15_bitlen.c similarity index 100% rename from src/SSLClient/bssl/i15_bitlen.c rename to src/client/SSLClient/bssl/i15_bitlen.c diff --git a/src/SSLClient/bssl/i15_decmod.c b/src/client/SSLClient/bssl/i15_decmod.c similarity index 100% rename from src/SSLClient/bssl/i15_decmod.c rename to src/client/SSLClient/bssl/i15_decmod.c diff --git a/src/SSLClient/bssl/i15_decode.c b/src/client/SSLClient/bssl/i15_decode.c similarity index 100% rename from src/SSLClient/bssl/i15_decode.c rename to src/client/SSLClient/bssl/i15_decode.c diff --git a/src/SSLClient/bssl/i15_decred.c b/src/client/SSLClient/bssl/i15_decred.c similarity index 100% rename from src/SSLClient/bssl/i15_decred.c rename to src/client/SSLClient/bssl/i15_decred.c diff --git a/src/SSLClient/bssl/i15_encode.c b/src/client/SSLClient/bssl/i15_encode.c similarity index 100% rename from src/SSLClient/bssl/i15_encode.c rename to src/client/SSLClient/bssl/i15_encode.c diff --git a/src/SSLClient/bssl/i15_fmont.c b/src/client/SSLClient/bssl/i15_fmont.c similarity index 100% rename from src/SSLClient/bssl/i15_fmont.c rename to src/client/SSLClient/bssl/i15_fmont.c diff --git a/src/SSLClient/bssl/i15_iszero.c b/src/client/SSLClient/bssl/i15_iszero.c similarity index 100% rename from src/SSLClient/bssl/i15_iszero.c rename to src/client/SSLClient/bssl/i15_iszero.c diff --git a/src/SSLClient/bssl/i15_moddiv.c b/src/client/SSLClient/bssl/i15_moddiv.c similarity index 100% rename from src/SSLClient/bssl/i15_moddiv.c rename to src/client/SSLClient/bssl/i15_moddiv.c diff --git a/src/SSLClient/bssl/i15_modpow.c b/src/client/SSLClient/bssl/i15_modpow.c similarity index 100% rename from src/SSLClient/bssl/i15_modpow.c rename to src/client/SSLClient/bssl/i15_modpow.c diff --git a/src/SSLClient/bssl/i15_modpow2.c b/src/client/SSLClient/bssl/i15_modpow2.c similarity index 100% rename from src/SSLClient/bssl/i15_modpow2.c rename to src/client/SSLClient/bssl/i15_modpow2.c diff --git a/src/SSLClient/bssl/i15_montmul.c b/src/client/SSLClient/bssl/i15_montmul.c similarity index 100% rename from src/SSLClient/bssl/i15_montmul.c rename to src/client/SSLClient/bssl/i15_montmul.c diff --git a/src/SSLClient/bssl/i15_mulacc.c b/src/client/SSLClient/bssl/i15_mulacc.c similarity index 100% rename from src/SSLClient/bssl/i15_mulacc.c rename to src/client/SSLClient/bssl/i15_mulacc.c diff --git a/src/SSLClient/bssl/i15_muladd.c b/src/client/SSLClient/bssl/i15_muladd.c similarity index 100% rename from src/SSLClient/bssl/i15_muladd.c rename to src/client/SSLClient/bssl/i15_muladd.c diff --git a/src/SSLClient/bssl/i15_ninv15.c b/src/client/SSLClient/bssl/i15_ninv15.c similarity index 100% rename from src/SSLClient/bssl/i15_ninv15.c rename to src/client/SSLClient/bssl/i15_ninv15.c diff --git a/src/SSLClient/bssl/i15_reduce.c b/src/client/SSLClient/bssl/i15_reduce.c similarity index 100% rename from src/SSLClient/bssl/i15_reduce.c rename to src/client/SSLClient/bssl/i15_reduce.c diff --git a/src/SSLClient/bssl/i15_rshift.c b/src/client/SSLClient/bssl/i15_rshift.c similarity index 100% rename from src/SSLClient/bssl/i15_rshift.c rename to src/client/SSLClient/bssl/i15_rshift.c diff --git a/src/SSLClient/bssl/i15_sub.c b/src/client/SSLClient/bssl/i15_sub.c similarity index 100% rename from src/SSLClient/bssl/i15_sub.c rename to src/client/SSLClient/bssl/i15_sub.c diff --git a/src/SSLClient/bssl/i15_tmont.c b/src/client/SSLClient/bssl/i15_tmont.c similarity index 100% rename from src/SSLClient/bssl/i15_tmont.c rename to src/client/SSLClient/bssl/i15_tmont.c diff --git a/src/SSLClient/bssl/i31_add.c b/src/client/SSLClient/bssl/i31_add.c similarity index 100% rename from src/SSLClient/bssl/i31_add.c rename to src/client/SSLClient/bssl/i31_add.c diff --git a/src/SSLClient/bssl/i31_bitlen.c b/src/client/SSLClient/bssl/i31_bitlen.c similarity index 100% rename from src/SSLClient/bssl/i31_bitlen.c rename to src/client/SSLClient/bssl/i31_bitlen.c diff --git a/src/SSLClient/bssl/i31_decmod.c b/src/client/SSLClient/bssl/i31_decmod.c similarity index 100% rename from src/SSLClient/bssl/i31_decmod.c rename to src/client/SSLClient/bssl/i31_decmod.c diff --git a/src/SSLClient/bssl/i31_decode.c b/src/client/SSLClient/bssl/i31_decode.c similarity index 100% rename from src/SSLClient/bssl/i31_decode.c rename to src/client/SSLClient/bssl/i31_decode.c diff --git a/src/SSLClient/bssl/i31_decred.c b/src/client/SSLClient/bssl/i31_decred.c similarity index 100% rename from src/SSLClient/bssl/i31_decred.c rename to src/client/SSLClient/bssl/i31_decred.c diff --git a/src/SSLClient/bssl/i31_encode.c b/src/client/SSLClient/bssl/i31_encode.c similarity index 100% rename from src/SSLClient/bssl/i31_encode.c rename to src/client/SSLClient/bssl/i31_encode.c diff --git a/src/SSLClient/bssl/i31_fmont.c b/src/client/SSLClient/bssl/i31_fmont.c similarity index 100% rename from src/SSLClient/bssl/i31_fmont.c rename to src/client/SSLClient/bssl/i31_fmont.c diff --git a/src/SSLClient/bssl/i31_iszero.c b/src/client/SSLClient/bssl/i31_iszero.c similarity index 100% rename from src/SSLClient/bssl/i31_iszero.c rename to src/client/SSLClient/bssl/i31_iszero.c diff --git a/src/SSLClient/bssl/i31_moddiv.c b/src/client/SSLClient/bssl/i31_moddiv.c similarity index 100% rename from src/SSLClient/bssl/i31_moddiv.c rename to src/client/SSLClient/bssl/i31_moddiv.c diff --git a/src/SSLClient/bssl/i31_modpow.c b/src/client/SSLClient/bssl/i31_modpow.c similarity index 100% rename from src/SSLClient/bssl/i31_modpow.c rename to src/client/SSLClient/bssl/i31_modpow.c diff --git a/src/SSLClient/bssl/i31_modpow2.c b/src/client/SSLClient/bssl/i31_modpow2.c similarity index 100% rename from src/SSLClient/bssl/i31_modpow2.c rename to src/client/SSLClient/bssl/i31_modpow2.c diff --git a/src/SSLClient/bssl/i31_montmul.c b/src/client/SSLClient/bssl/i31_montmul.c similarity index 100% rename from src/SSLClient/bssl/i31_montmul.c rename to src/client/SSLClient/bssl/i31_montmul.c diff --git a/src/SSLClient/bssl/i31_mulacc.c b/src/client/SSLClient/bssl/i31_mulacc.c similarity index 100% rename from src/SSLClient/bssl/i31_mulacc.c rename to src/client/SSLClient/bssl/i31_mulacc.c diff --git a/src/SSLClient/bssl/i31_muladd.c b/src/client/SSLClient/bssl/i31_muladd.c similarity index 100% rename from src/SSLClient/bssl/i31_muladd.c rename to src/client/SSLClient/bssl/i31_muladd.c diff --git a/src/SSLClient/bssl/i31_ninv31.c b/src/client/SSLClient/bssl/i31_ninv31.c similarity index 100% rename from src/SSLClient/bssl/i31_ninv31.c rename to src/client/SSLClient/bssl/i31_ninv31.c diff --git a/src/SSLClient/bssl/i31_reduce.c b/src/client/SSLClient/bssl/i31_reduce.c similarity index 100% rename from src/SSLClient/bssl/i31_reduce.c rename to src/client/SSLClient/bssl/i31_reduce.c diff --git a/src/SSLClient/bssl/i31_rshift.c b/src/client/SSLClient/bssl/i31_rshift.c similarity index 100% rename from src/SSLClient/bssl/i31_rshift.c rename to src/client/SSLClient/bssl/i31_rshift.c diff --git a/src/SSLClient/bssl/i31_sub.c b/src/client/SSLClient/bssl/i31_sub.c similarity index 100% rename from src/SSLClient/bssl/i31_sub.c rename to src/client/SSLClient/bssl/i31_sub.c diff --git a/src/SSLClient/bssl/i31_tmont.c b/src/client/SSLClient/bssl/i31_tmont.c similarity index 100% rename from src/SSLClient/bssl/i31_tmont.c rename to src/client/SSLClient/bssl/i31_tmont.c diff --git a/src/SSLClient/bssl/i32_add.c b/src/client/SSLClient/bssl/i32_add.c similarity index 100% rename from src/SSLClient/bssl/i32_add.c rename to src/client/SSLClient/bssl/i32_add.c diff --git a/src/SSLClient/bssl/i32_bitlen.c b/src/client/SSLClient/bssl/i32_bitlen.c similarity index 100% rename from src/SSLClient/bssl/i32_bitlen.c rename to src/client/SSLClient/bssl/i32_bitlen.c diff --git a/src/SSLClient/bssl/i32_decmod.c b/src/client/SSLClient/bssl/i32_decmod.c similarity index 100% rename from src/SSLClient/bssl/i32_decmod.c rename to src/client/SSLClient/bssl/i32_decmod.c diff --git a/src/SSLClient/bssl/i32_decode.c b/src/client/SSLClient/bssl/i32_decode.c similarity index 100% rename from src/SSLClient/bssl/i32_decode.c rename to src/client/SSLClient/bssl/i32_decode.c diff --git a/src/SSLClient/bssl/i32_decred.c b/src/client/SSLClient/bssl/i32_decred.c similarity index 100% rename from src/SSLClient/bssl/i32_decred.c rename to src/client/SSLClient/bssl/i32_decred.c diff --git a/src/SSLClient/bssl/i32_div32.c b/src/client/SSLClient/bssl/i32_div32.c similarity index 100% rename from src/SSLClient/bssl/i32_div32.c rename to src/client/SSLClient/bssl/i32_div32.c diff --git a/src/SSLClient/bssl/i32_encode.c b/src/client/SSLClient/bssl/i32_encode.c similarity index 100% rename from src/SSLClient/bssl/i32_encode.c rename to src/client/SSLClient/bssl/i32_encode.c diff --git a/src/SSLClient/bssl/i32_fmont.c b/src/client/SSLClient/bssl/i32_fmont.c similarity index 100% rename from src/SSLClient/bssl/i32_fmont.c rename to src/client/SSLClient/bssl/i32_fmont.c diff --git a/src/SSLClient/bssl/i32_iszero.c b/src/client/SSLClient/bssl/i32_iszero.c similarity index 100% rename from src/SSLClient/bssl/i32_iszero.c rename to src/client/SSLClient/bssl/i32_iszero.c diff --git a/src/SSLClient/bssl/i32_modpow.c b/src/client/SSLClient/bssl/i32_modpow.c similarity index 100% rename from src/SSLClient/bssl/i32_modpow.c rename to src/client/SSLClient/bssl/i32_modpow.c diff --git a/src/SSLClient/bssl/i32_montmul.c b/src/client/SSLClient/bssl/i32_montmul.c similarity index 100% rename from src/SSLClient/bssl/i32_montmul.c rename to src/client/SSLClient/bssl/i32_montmul.c diff --git a/src/SSLClient/bssl/i32_mulacc.c b/src/client/SSLClient/bssl/i32_mulacc.c similarity index 100% rename from src/SSLClient/bssl/i32_mulacc.c rename to src/client/SSLClient/bssl/i32_mulacc.c diff --git a/src/SSLClient/bssl/i32_muladd.c b/src/client/SSLClient/bssl/i32_muladd.c similarity index 100% rename from src/SSLClient/bssl/i32_muladd.c rename to src/client/SSLClient/bssl/i32_muladd.c diff --git a/src/SSLClient/bssl/i32_ninv32.c b/src/client/SSLClient/bssl/i32_ninv32.c similarity index 100% rename from src/SSLClient/bssl/i32_ninv32.c rename to src/client/SSLClient/bssl/i32_ninv32.c diff --git a/src/SSLClient/bssl/i32_reduce.c b/src/client/SSLClient/bssl/i32_reduce.c similarity index 100% rename from src/SSLClient/bssl/i32_reduce.c rename to src/client/SSLClient/bssl/i32_reduce.c diff --git a/src/SSLClient/bssl/i32_sub.c b/src/client/SSLClient/bssl/i32_sub.c similarity index 100% rename from src/SSLClient/bssl/i32_sub.c rename to src/client/SSLClient/bssl/i32_sub.c diff --git a/src/SSLClient/bssl/i32_tmont.c b/src/client/SSLClient/bssl/i32_tmont.c similarity index 100% rename from src/SSLClient/bssl/i32_tmont.c rename to src/client/SSLClient/bssl/i32_tmont.c diff --git a/src/SSLClient/bssl/i62_modpow2.c b/src/client/SSLClient/bssl/i62_modpow2.c similarity index 100% rename from src/SSLClient/bssl/i62_modpow2.c rename to src/client/SSLClient/bssl/i62_modpow2.c diff --git a/src/SSLClient/bssl/inner.h b/src/client/SSLClient/bssl/inner.h similarity index 100% rename from src/SSLClient/bssl/inner.h rename to src/client/SSLClient/bssl/inner.h diff --git a/src/SSLClient/bssl/md5.c b/src/client/SSLClient/bssl/md5.c similarity index 100% rename from src/SSLClient/bssl/md5.c rename to src/client/SSLClient/bssl/md5.c diff --git a/src/SSLClient/bssl/md5sha1.c b/src/client/SSLClient/bssl/md5sha1.c similarity index 100% rename from src/SSLClient/bssl/md5sha1.c rename to src/client/SSLClient/bssl/md5sha1.c diff --git a/src/SSLClient/bssl/mgf1.c b/src/client/SSLClient/bssl/mgf1.c similarity index 100% rename from src/SSLClient/bssl/mgf1.c rename to src/client/SSLClient/bssl/mgf1.c diff --git a/src/SSLClient/bssl/multihash.c b/src/client/SSLClient/bssl/multihash.c similarity index 100% rename from src/SSLClient/bssl/multihash.c rename to src/client/SSLClient/bssl/multihash.c diff --git a/src/SSLClient/bssl/pemdec.c b/src/client/SSLClient/bssl/pemdec.c similarity index 100% rename from src/SSLClient/bssl/pemdec.c rename to src/client/SSLClient/bssl/pemdec.c diff --git a/src/SSLClient/bssl/pemdec.t0 b/src/client/SSLClient/bssl/pemdec.t0 similarity index 100% rename from src/SSLClient/bssl/pemdec.t0 rename to src/client/SSLClient/bssl/pemdec.t0 diff --git a/src/SSLClient/bssl/pemenc.c b/src/client/SSLClient/bssl/pemenc.c similarity index 100% rename from src/SSLClient/bssl/pemenc.c rename to src/client/SSLClient/bssl/pemenc.c diff --git a/src/SSLClient/bssl/pkey_decoder.c b/src/client/SSLClient/bssl/pkey_decoder.c similarity index 100% rename from src/SSLClient/bssl/pkey_decoder.c rename to src/client/SSLClient/bssl/pkey_decoder.c diff --git a/src/SSLClient/bssl/poly1305_ctmul.c b/src/client/SSLClient/bssl/poly1305_ctmul.c similarity index 100% rename from src/SSLClient/bssl/poly1305_ctmul.c rename to src/client/SSLClient/bssl/poly1305_ctmul.c diff --git a/src/SSLClient/bssl/poly1305_ctmul32.c b/src/client/SSLClient/bssl/poly1305_ctmul32.c similarity index 100% rename from src/SSLClient/bssl/poly1305_ctmul32.c rename to src/client/SSLClient/bssl/poly1305_ctmul32.c diff --git a/src/SSLClient/bssl/poly1305_ctmulq.c b/src/client/SSLClient/bssl/poly1305_ctmulq.c similarity index 100% rename from src/SSLClient/bssl/poly1305_ctmulq.c rename to src/client/SSLClient/bssl/poly1305_ctmulq.c diff --git a/src/SSLClient/bssl/poly1305_i15.c b/src/client/SSLClient/bssl/poly1305_i15.c similarity index 100% rename from src/SSLClient/bssl/poly1305_i15.c rename to src/client/SSLClient/bssl/poly1305_i15.c diff --git a/src/SSLClient/bssl/prf.c b/src/client/SSLClient/bssl/prf.c similarity index 100% rename from src/SSLClient/bssl/prf.c rename to src/client/SSLClient/bssl/prf.c diff --git a/src/SSLClient/bssl/prf_md5sha1.c b/src/client/SSLClient/bssl/prf_md5sha1.c similarity index 100% rename from src/SSLClient/bssl/prf_md5sha1.c rename to src/client/SSLClient/bssl/prf_md5sha1.c diff --git a/src/SSLClient/bssl/prf_sha256.c b/src/client/SSLClient/bssl/prf_sha256.c similarity index 100% rename from src/SSLClient/bssl/prf_sha256.c rename to src/client/SSLClient/bssl/prf_sha256.c diff --git a/src/SSLClient/bssl/prf_sha384.c b/src/client/SSLClient/bssl/prf_sha384.c similarity index 100% rename from src/SSLClient/bssl/prf_sha384.c rename to src/client/SSLClient/bssl/prf_sha384.c diff --git a/src/SSLClient/bssl/rsa_default_keygen.c b/src/client/SSLClient/bssl/rsa_default_keygen.c similarity index 100% rename from src/SSLClient/bssl/rsa_default_keygen.c rename to src/client/SSLClient/bssl/rsa_default_keygen.c diff --git a/src/SSLClient/bssl/rsa_default_modulus.c b/src/client/SSLClient/bssl/rsa_default_modulus.c similarity index 100% rename from src/SSLClient/bssl/rsa_default_modulus.c rename to src/client/SSLClient/bssl/rsa_default_modulus.c diff --git a/src/SSLClient/bssl/rsa_default_oaep_decrypt.c b/src/client/SSLClient/bssl/rsa_default_oaep_decrypt.c similarity index 100% rename from src/SSLClient/bssl/rsa_default_oaep_decrypt.c rename to src/client/SSLClient/bssl/rsa_default_oaep_decrypt.c diff --git a/src/SSLClient/bssl/rsa_default_oaep_encrypt.c b/src/client/SSLClient/bssl/rsa_default_oaep_encrypt.c similarity index 100% rename from src/SSLClient/bssl/rsa_default_oaep_encrypt.c rename to src/client/SSLClient/bssl/rsa_default_oaep_encrypt.c diff --git a/src/SSLClient/bssl/rsa_default_pkcs1_sign.c b/src/client/SSLClient/bssl/rsa_default_pkcs1_sign.c similarity index 100% rename from src/SSLClient/bssl/rsa_default_pkcs1_sign.c rename to src/client/SSLClient/bssl/rsa_default_pkcs1_sign.c diff --git a/src/SSLClient/bssl/rsa_default_pkcs1_vrfy.c b/src/client/SSLClient/bssl/rsa_default_pkcs1_vrfy.c similarity index 100% rename from src/SSLClient/bssl/rsa_default_pkcs1_vrfy.c rename to src/client/SSLClient/bssl/rsa_default_pkcs1_vrfy.c diff --git a/src/SSLClient/bssl/rsa_default_priv.c b/src/client/SSLClient/bssl/rsa_default_priv.c similarity index 100% rename from src/SSLClient/bssl/rsa_default_priv.c rename to src/client/SSLClient/bssl/rsa_default_priv.c diff --git a/src/SSLClient/bssl/rsa_default_privexp.c b/src/client/SSLClient/bssl/rsa_default_privexp.c similarity index 100% rename from src/SSLClient/bssl/rsa_default_privexp.c rename to src/client/SSLClient/bssl/rsa_default_privexp.c diff --git a/src/SSLClient/bssl/rsa_default_pss_sign.c b/src/client/SSLClient/bssl/rsa_default_pss_sign.c similarity index 100% rename from src/SSLClient/bssl/rsa_default_pss_sign.c rename to src/client/SSLClient/bssl/rsa_default_pss_sign.c diff --git a/src/SSLClient/bssl/rsa_default_pss_vrfy.c b/src/client/SSLClient/bssl/rsa_default_pss_vrfy.c similarity index 100% rename from src/SSLClient/bssl/rsa_default_pss_vrfy.c rename to src/client/SSLClient/bssl/rsa_default_pss_vrfy.c diff --git a/src/SSLClient/bssl/rsa_default_pub.c b/src/client/SSLClient/bssl/rsa_default_pub.c similarity index 100% rename from src/SSLClient/bssl/rsa_default_pub.c rename to src/client/SSLClient/bssl/rsa_default_pub.c diff --git a/src/SSLClient/bssl/rsa_default_pubexp.c b/src/client/SSLClient/bssl/rsa_default_pubexp.c similarity index 100% rename from src/SSLClient/bssl/rsa_default_pubexp.c rename to src/client/SSLClient/bssl/rsa_default_pubexp.c diff --git a/src/SSLClient/bssl/rsa_i15_keygen.c b/src/client/SSLClient/bssl/rsa_i15_keygen.c similarity index 100% rename from src/SSLClient/bssl/rsa_i15_keygen.c rename to src/client/SSLClient/bssl/rsa_i15_keygen.c diff --git a/src/SSLClient/bssl/rsa_i15_modulus.c b/src/client/SSLClient/bssl/rsa_i15_modulus.c similarity index 100% rename from src/SSLClient/bssl/rsa_i15_modulus.c rename to src/client/SSLClient/bssl/rsa_i15_modulus.c diff --git a/src/SSLClient/bssl/rsa_i15_oaep_decrypt.c b/src/client/SSLClient/bssl/rsa_i15_oaep_decrypt.c similarity index 100% rename from src/SSLClient/bssl/rsa_i15_oaep_decrypt.c rename to src/client/SSLClient/bssl/rsa_i15_oaep_decrypt.c diff --git a/src/SSLClient/bssl/rsa_i15_oaep_encrypt.c b/src/client/SSLClient/bssl/rsa_i15_oaep_encrypt.c similarity index 100% rename from src/SSLClient/bssl/rsa_i15_oaep_encrypt.c rename to src/client/SSLClient/bssl/rsa_i15_oaep_encrypt.c diff --git a/src/SSLClient/bssl/rsa_i15_pkcs1_sign.c b/src/client/SSLClient/bssl/rsa_i15_pkcs1_sign.c similarity index 100% rename from src/SSLClient/bssl/rsa_i15_pkcs1_sign.c rename to src/client/SSLClient/bssl/rsa_i15_pkcs1_sign.c diff --git a/src/SSLClient/bssl/rsa_i15_pkcs1_vrfy.c b/src/client/SSLClient/bssl/rsa_i15_pkcs1_vrfy.c similarity index 100% rename from src/SSLClient/bssl/rsa_i15_pkcs1_vrfy.c rename to src/client/SSLClient/bssl/rsa_i15_pkcs1_vrfy.c diff --git a/src/SSLClient/bssl/rsa_i15_priv.c b/src/client/SSLClient/bssl/rsa_i15_priv.c similarity index 100% rename from src/SSLClient/bssl/rsa_i15_priv.c rename to src/client/SSLClient/bssl/rsa_i15_priv.c diff --git a/src/SSLClient/bssl/rsa_i15_privexp.c b/src/client/SSLClient/bssl/rsa_i15_privexp.c similarity index 100% rename from src/SSLClient/bssl/rsa_i15_privexp.c rename to src/client/SSLClient/bssl/rsa_i15_privexp.c diff --git a/src/SSLClient/bssl/rsa_i15_pss_sign.c b/src/client/SSLClient/bssl/rsa_i15_pss_sign.c similarity index 100% rename from src/SSLClient/bssl/rsa_i15_pss_sign.c rename to src/client/SSLClient/bssl/rsa_i15_pss_sign.c diff --git a/src/SSLClient/bssl/rsa_i15_pss_vrfy.c b/src/client/SSLClient/bssl/rsa_i15_pss_vrfy.c similarity index 100% rename from src/SSLClient/bssl/rsa_i15_pss_vrfy.c rename to src/client/SSLClient/bssl/rsa_i15_pss_vrfy.c diff --git a/src/SSLClient/bssl/rsa_i15_pub.c b/src/client/SSLClient/bssl/rsa_i15_pub.c similarity index 100% rename from src/SSLClient/bssl/rsa_i15_pub.c rename to src/client/SSLClient/bssl/rsa_i15_pub.c diff --git a/src/SSLClient/bssl/rsa_i15_pubexp.c b/src/client/SSLClient/bssl/rsa_i15_pubexp.c similarity index 100% rename from src/SSLClient/bssl/rsa_i15_pubexp.c rename to src/client/SSLClient/bssl/rsa_i15_pubexp.c diff --git a/src/SSLClient/bssl/rsa_i31_keygen.c b/src/client/SSLClient/bssl/rsa_i31_keygen.c similarity index 100% rename from src/SSLClient/bssl/rsa_i31_keygen.c rename to src/client/SSLClient/bssl/rsa_i31_keygen.c diff --git a/src/SSLClient/bssl/rsa_i31_keygen_inner.c b/src/client/SSLClient/bssl/rsa_i31_keygen_inner.c similarity index 100% rename from src/SSLClient/bssl/rsa_i31_keygen_inner.c rename to src/client/SSLClient/bssl/rsa_i31_keygen_inner.c diff --git a/src/SSLClient/bssl/rsa_i31_modulus.c b/src/client/SSLClient/bssl/rsa_i31_modulus.c similarity index 100% rename from src/SSLClient/bssl/rsa_i31_modulus.c rename to src/client/SSLClient/bssl/rsa_i31_modulus.c diff --git a/src/SSLClient/bssl/rsa_i31_oaep_decrypt.c b/src/client/SSLClient/bssl/rsa_i31_oaep_decrypt.c similarity index 100% rename from src/SSLClient/bssl/rsa_i31_oaep_decrypt.c rename to src/client/SSLClient/bssl/rsa_i31_oaep_decrypt.c diff --git a/src/SSLClient/bssl/rsa_i31_oaep_encrypt.c b/src/client/SSLClient/bssl/rsa_i31_oaep_encrypt.c similarity index 100% rename from src/SSLClient/bssl/rsa_i31_oaep_encrypt.c rename to src/client/SSLClient/bssl/rsa_i31_oaep_encrypt.c diff --git a/src/SSLClient/bssl/rsa_i31_pkcs1_sign.c b/src/client/SSLClient/bssl/rsa_i31_pkcs1_sign.c similarity index 100% rename from src/SSLClient/bssl/rsa_i31_pkcs1_sign.c rename to src/client/SSLClient/bssl/rsa_i31_pkcs1_sign.c diff --git a/src/SSLClient/bssl/rsa_i31_pkcs1_vrfy.c b/src/client/SSLClient/bssl/rsa_i31_pkcs1_vrfy.c similarity index 100% rename from src/SSLClient/bssl/rsa_i31_pkcs1_vrfy.c rename to src/client/SSLClient/bssl/rsa_i31_pkcs1_vrfy.c diff --git a/src/SSLClient/bssl/rsa_i31_priv.c b/src/client/SSLClient/bssl/rsa_i31_priv.c similarity index 100% rename from src/SSLClient/bssl/rsa_i31_priv.c rename to src/client/SSLClient/bssl/rsa_i31_priv.c diff --git a/src/SSLClient/bssl/rsa_i31_privexp.c b/src/client/SSLClient/bssl/rsa_i31_privexp.c similarity index 100% rename from src/SSLClient/bssl/rsa_i31_privexp.c rename to src/client/SSLClient/bssl/rsa_i31_privexp.c diff --git a/src/SSLClient/bssl/rsa_i31_pss_sign.c b/src/client/SSLClient/bssl/rsa_i31_pss_sign.c similarity index 100% rename from src/SSLClient/bssl/rsa_i31_pss_sign.c rename to src/client/SSLClient/bssl/rsa_i31_pss_sign.c diff --git a/src/SSLClient/bssl/rsa_i31_pss_vrfy.c b/src/client/SSLClient/bssl/rsa_i31_pss_vrfy.c similarity index 100% rename from src/SSLClient/bssl/rsa_i31_pss_vrfy.c rename to src/client/SSLClient/bssl/rsa_i31_pss_vrfy.c diff --git a/src/SSLClient/bssl/rsa_i31_pub.c b/src/client/SSLClient/bssl/rsa_i31_pub.c similarity index 100% rename from src/SSLClient/bssl/rsa_i31_pub.c rename to src/client/SSLClient/bssl/rsa_i31_pub.c diff --git a/src/SSLClient/bssl/rsa_i31_pubexp.c b/src/client/SSLClient/bssl/rsa_i31_pubexp.c similarity index 100% rename from src/SSLClient/bssl/rsa_i31_pubexp.c rename to src/client/SSLClient/bssl/rsa_i31_pubexp.c diff --git a/src/SSLClient/bssl/rsa_i32_oaep_decrypt.c b/src/client/SSLClient/bssl/rsa_i32_oaep_decrypt.c similarity index 100% rename from src/SSLClient/bssl/rsa_i32_oaep_decrypt.c rename to src/client/SSLClient/bssl/rsa_i32_oaep_decrypt.c diff --git a/src/SSLClient/bssl/rsa_i32_oaep_encrypt.c b/src/client/SSLClient/bssl/rsa_i32_oaep_encrypt.c similarity index 100% rename from src/SSLClient/bssl/rsa_i32_oaep_encrypt.c rename to src/client/SSLClient/bssl/rsa_i32_oaep_encrypt.c diff --git a/src/SSLClient/bssl/rsa_i32_pkcs1_sign.c b/src/client/SSLClient/bssl/rsa_i32_pkcs1_sign.c similarity index 100% rename from src/SSLClient/bssl/rsa_i32_pkcs1_sign.c rename to src/client/SSLClient/bssl/rsa_i32_pkcs1_sign.c diff --git a/src/SSLClient/bssl/rsa_i32_pkcs1_vrfy.c b/src/client/SSLClient/bssl/rsa_i32_pkcs1_vrfy.c similarity index 100% rename from src/SSLClient/bssl/rsa_i32_pkcs1_vrfy.c rename to src/client/SSLClient/bssl/rsa_i32_pkcs1_vrfy.c diff --git a/src/SSLClient/bssl/rsa_i32_priv.c b/src/client/SSLClient/bssl/rsa_i32_priv.c similarity index 100% rename from src/SSLClient/bssl/rsa_i32_priv.c rename to src/client/SSLClient/bssl/rsa_i32_priv.c diff --git a/src/SSLClient/bssl/rsa_i32_pss_sign.c b/src/client/SSLClient/bssl/rsa_i32_pss_sign.c similarity index 100% rename from src/SSLClient/bssl/rsa_i32_pss_sign.c rename to src/client/SSLClient/bssl/rsa_i32_pss_sign.c diff --git a/src/SSLClient/bssl/rsa_i32_pss_vrfy.c b/src/client/SSLClient/bssl/rsa_i32_pss_vrfy.c similarity index 100% rename from src/SSLClient/bssl/rsa_i32_pss_vrfy.c rename to src/client/SSLClient/bssl/rsa_i32_pss_vrfy.c diff --git a/src/SSLClient/bssl/rsa_i32_pub.c b/src/client/SSLClient/bssl/rsa_i32_pub.c similarity index 100% rename from src/SSLClient/bssl/rsa_i32_pub.c rename to src/client/SSLClient/bssl/rsa_i32_pub.c diff --git a/src/SSLClient/bssl/rsa_i62_keygen.c b/src/client/SSLClient/bssl/rsa_i62_keygen.c similarity index 100% rename from src/SSLClient/bssl/rsa_i62_keygen.c rename to src/client/SSLClient/bssl/rsa_i62_keygen.c diff --git a/src/SSLClient/bssl/rsa_i62_oaep_decrypt.c b/src/client/SSLClient/bssl/rsa_i62_oaep_decrypt.c similarity index 100% rename from src/SSLClient/bssl/rsa_i62_oaep_decrypt.c rename to src/client/SSLClient/bssl/rsa_i62_oaep_decrypt.c diff --git a/src/SSLClient/bssl/rsa_i62_oaep_encrypt.c b/src/client/SSLClient/bssl/rsa_i62_oaep_encrypt.c similarity index 100% rename from src/SSLClient/bssl/rsa_i62_oaep_encrypt.c rename to src/client/SSLClient/bssl/rsa_i62_oaep_encrypt.c diff --git a/src/SSLClient/bssl/rsa_i62_pkcs1_sign.c b/src/client/SSLClient/bssl/rsa_i62_pkcs1_sign.c similarity index 100% rename from src/SSLClient/bssl/rsa_i62_pkcs1_sign.c rename to src/client/SSLClient/bssl/rsa_i62_pkcs1_sign.c diff --git a/src/SSLClient/bssl/rsa_i62_pkcs1_vrfy.c b/src/client/SSLClient/bssl/rsa_i62_pkcs1_vrfy.c similarity index 100% rename from src/SSLClient/bssl/rsa_i62_pkcs1_vrfy.c rename to src/client/SSLClient/bssl/rsa_i62_pkcs1_vrfy.c diff --git a/src/SSLClient/bssl/rsa_i62_priv.c b/src/client/SSLClient/bssl/rsa_i62_priv.c similarity index 100% rename from src/SSLClient/bssl/rsa_i62_priv.c rename to src/client/SSLClient/bssl/rsa_i62_priv.c diff --git a/src/SSLClient/bssl/rsa_i62_pss_sign.c b/src/client/SSLClient/bssl/rsa_i62_pss_sign.c similarity index 100% rename from src/SSLClient/bssl/rsa_i62_pss_sign.c rename to src/client/SSLClient/bssl/rsa_i62_pss_sign.c diff --git a/src/SSLClient/bssl/rsa_i62_pss_vrfy.c b/src/client/SSLClient/bssl/rsa_i62_pss_vrfy.c similarity index 100% rename from src/SSLClient/bssl/rsa_i62_pss_vrfy.c rename to src/client/SSLClient/bssl/rsa_i62_pss_vrfy.c diff --git a/src/SSLClient/bssl/rsa_i62_pub.c b/src/client/SSLClient/bssl/rsa_i62_pub.c similarity index 100% rename from src/SSLClient/bssl/rsa_i62_pub.c rename to src/client/SSLClient/bssl/rsa_i62_pub.c diff --git a/src/SSLClient/bssl/rsa_oaep_pad.c b/src/client/SSLClient/bssl/rsa_oaep_pad.c similarity index 100% rename from src/SSLClient/bssl/rsa_oaep_pad.c rename to src/client/SSLClient/bssl/rsa_oaep_pad.c diff --git a/src/SSLClient/bssl/rsa_oaep_unpad.c b/src/client/SSLClient/bssl/rsa_oaep_unpad.c similarity index 100% rename from src/SSLClient/bssl/rsa_oaep_unpad.c rename to src/client/SSLClient/bssl/rsa_oaep_unpad.c diff --git a/src/SSLClient/bssl/rsa_pkcs1_sig_pad.c b/src/client/SSLClient/bssl/rsa_pkcs1_sig_pad.c similarity index 100% rename from src/SSLClient/bssl/rsa_pkcs1_sig_pad.c rename to src/client/SSLClient/bssl/rsa_pkcs1_sig_pad.c diff --git a/src/SSLClient/bssl/rsa_pkcs1_sig_unpad.c b/src/client/SSLClient/bssl/rsa_pkcs1_sig_unpad.c similarity index 100% rename from src/SSLClient/bssl/rsa_pkcs1_sig_unpad.c rename to src/client/SSLClient/bssl/rsa_pkcs1_sig_unpad.c diff --git a/src/SSLClient/bssl/rsa_pss_sig_pad.c b/src/client/SSLClient/bssl/rsa_pss_sig_pad.c similarity index 100% rename from src/SSLClient/bssl/rsa_pss_sig_pad.c rename to src/client/SSLClient/bssl/rsa_pss_sig_pad.c diff --git a/src/SSLClient/bssl/rsa_pss_sig_unpad.c b/src/client/SSLClient/bssl/rsa_pss_sig_unpad.c similarity index 100% rename from src/SSLClient/bssl/rsa_pss_sig_unpad.c rename to src/client/SSLClient/bssl/rsa_pss_sig_unpad.c diff --git a/src/SSLClient/bssl/rsa_ssl_decrypt.c b/src/client/SSLClient/bssl/rsa_ssl_decrypt.c similarity index 100% rename from src/SSLClient/bssl/rsa_ssl_decrypt.c rename to src/client/SSLClient/bssl/rsa_ssl_decrypt.c diff --git a/src/SSLClient/bssl/settings.c b/src/client/SSLClient/bssl/settings.c similarity index 100% rename from src/SSLClient/bssl/settings.c rename to src/client/SSLClient/bssl/settings.c diff --git a/src/SSLClient/bssl/sha1.c b/src/client/SSLClient/bssl/sha1.c similarity index 100% rename from src/SSLClient/bssl/sha1.c rename to src/client/SSLClient/bssl/sha1.c diff --git a/src/SSLClient/bssl/sha2big.c b/src/client/SSLClient/bssl/sha2big.c similarity index 100% rename from src/SSLClient/bssl/sha2big.c rename to src/client/SSLClient/bssl/sha2big.c diff --git a/src/SSLClient/bssl/sha2small.c b/src/client/SSLClient/bssl/sha2small.c similarity index 100% rename from src/SSLClient/bssl/sha2small.c rename to src/client/SSLClient/bssl/sha2small.c diff --git a/src/SSLClient/bssl/shake.c b/src/client/SSLClient/bssl/shake.c similarity index 100% rename from src/SSLClient/bssl/shake.c rename to src/client/SSLClient/bssl/shake.c diff --git a/src/SSLClient/bssl/skey_decoder.c b/src/client/SSLClient/bssl/skey_decoder.c similarity index 100% rename from src/SSLClient/bssl/skey_decoder.c rename to src/client/SSLClient/bssl/skey_decoder.c diff --git a/src/SSLClient/bssl/skey_decoder.t0 b/src/client/SSLClient/bssl/skey_decoder.t0 similarity index 100% rename from src/SSLClient/bssl/skey_decoder.t0 rename to src/client/SSLClient/bssl/skey_decoder.t0 diff --git a/src/SSLClient/bssl/ssl_ccert_single_ec.c b/src/client/SSLClient/bssl/ssl_ccert_single_ec.c similarity index 100% rename from src/SSLClient/bssl/ssl_ccert_single_ec.c rename to src/client/SSLClient/bssl/ssl_ccert_single_ec.c diff --git a/src/SSLClient/bssl/ssl_ccert_single_rsa.c b/src/client/SSLClient/bssl/ssl_ccert_single_rsa.c similarity index 100% rename from src/SSLClient/bssl/ssl_ccert_single_rsa.c rename to src/client/SSLClient/bssl/ssl_ccert_single_rsa.c diff --git a/src/SSLClient/bssl/ssl_client.c b/src/client/SSLClient/bssl/ssl_client.c similarity index 100% rename from src/SSLClient/bssl/ssl_client.c rename to src/client/SSLClient/bssl/ssl_client.c diff --git a/src/SSLClient/bssl/ssl_client_default_rsapub.c b/src/client/SSLClient/bssl/ssl_client_default_rsapub.c similarity index 100% rename from src/SSLClient/bssl/ssl_client_default_rsapub.c rename to src/client/SSLClient/bssl/ssl_client_default_rsapub.c diff --git a/src/SSLClient/bssl/ssl_client_full.c b/src/client/SSLClient/bssl/ssl_client_full.c similarity index 100% rename from src/SSLClient/bssl/ssl_client_full.c rename to src/client/SSLClient/bssl/ssl_client_full.c diff --git a/src/SSLClient/bssl/ssl_engine.c b/src/client/SSLClient/bssl/ssl_engine.c similarity index 100% rename from src/SSLClient/bssl/ssl_engine.c rename to src/client/SSLClient/bssl/ssl_engine.c diff --git a/src/SSLClient/bssl/ssl_engine_default_aescbc.c b/src/client/SSLClient/bssl/ssl_engine_default_aescbc.c similarity index 100% rename from src/SSLClient/bssl/ssl_engine_default_aescbc.c rename to src/client/SSLClient/bssl/ssl_engine_default_aescbc.c diff --git a/src/SSLClient/bssl/ssl_engine_default_aesccm.c b/src/client/SSLClient/bssl/ssl_engine_default_aesccm.c similarity index 100% rename from src/SSLClient/bssl/ssl_engine_default_aesccm.c rename to src/client/SSLClient/bssl/ssl_engine_default_aesccm.c diff --git a/src/SSLClient/bssl/ssl_engine_default_aesgcm.c b/src/client/SSLClient/bssl/ssl_engine_default_aesgcm.c similarity index 100% rename from src/SSLClient/bssl/ssl_engine_default_aesgcm.c rename to src/client/SSLClient/bssl/ssl_engine_default_aesgcm.c diff --git a/src/SSLClient/bssl/ssl_engine_default_chapol.c b/src/client/SSLClient/bssl/ssl_engine_default_chapol.c similarity index 100% rename from src/SSLClient/bssl/ssl_engine_default_chapol.c rename to src/client/SSLClient/bssl/ssl_engine_default_chapol.c diff --git a/src/SSLClient/bssl/ssl_engine_default_descbc.c b/src/client/SSLClient/bssl/ssl_engine_default_descbc.c similarity index 100% rename from src/SSLClient/bssl/ssl_engine_default_descbc.c rename to src/client/SSLClient/bssl/ssl_engine_default_descbc.c diff --git a/src/SSLClient/bssl/ssl_engine_default_ec.c b/src/client/SSLClient/bssl/ssl_engine_default_ec.c similarity index 100% rename from src/SSLClient/bssl/ssl_engine_default_ec.c rename to src/client/SSLClient/bssl/ssl_engine_default_ec.c diff --git a/src/SSLClient/bssl/ssl_engine_default_ecdsa.c b/src/client/SSLClient/bssl/ssl_engine_default_ecdsa.c similarity index 100% rename from src/SSLClient/bssl/ssl_engine_default_ecdsa.c rename to src/client/SSLClient/bssl/ssl_engine_default_ecdsa.c diff --git a/src/SSLClient/bssl/ssl_engine_default_rsavrfy.c b/src/client/SSLClient/bssl/ssl_engine_default_rsavrfy.c similarity index 100% rename from src/SSLClient/bssl/ssl_engine_default_rsavrfy.c rename to src/client/SSLClient/bssl/ssl_engine_default_rsavrfy.c diff --git a/src/SSLClient/bssl/ssl_hashes.c b/src/client/SSLClient/bssl/ssl_hashes.c similarity index 100% rename from src/SSLClient/bssl/ssl_hashes.c rename to src/client/SSLClient/bssl/ssl_hashes.c diff --git a/src/SSLClient/bssl/ssl_hs_client.c b/src/client/SSLClient/bssl/ssl_hs_client.c similarity index 100% rename from src/SSLClient/bssl/ssl_hs_client.c rename to src/client/SSLClient/bssl/ssl_hs_client.c diff --git a/src/SSLClient/bssl/ssl_hs_client.t0 b/src/client/SSLClient/bssl/ssl_hs_client.t0 similarity index 100% rename from src/SSLClient/bssl/ssl_hs_client.t0 rename to src/client/SSLClient/bssl/ssl_hs_client.t0 diff --git a/src/SSLClient/bssl/ssl_hs_common.t0 b/src/client/SSLClient/bssl/ssl_hs_common.t0 similarity index 100% rename from src/SSLClient/bssl/ssl_hs_common.t0 rename to src/client/SSLClient/bssl/ssl_hs_common.t0 diff --git a/src/SSLClient/bssl/ssl_hs_server.c b/src/client/SSLClient/bssl/ssl_hs_server.c similarity index 100% rename from src/SSLClient/bssl/ssl_hs_server.c rename to src/client/SSLClient/bssl/ssl_hs_server.c diff --git a/src/SSLClient/bssl/ssl_hs_server.t0 b/src/client/SSLClient/bssl/ssl_hs_server.t0 similarity index 100% rename from src/SSLClient/bssl/ssl_hs_server.t0 rename to src/client/SSLClient/bssl/ssl_hs_server.t0 diff --git a/src/SSLClient/bssl/ssl_io.c b/src/client/SSLClient/bssl/ssl_io.c similarity index 100% rename from src/SSLClient/bssl/ssl_io.c rename to src/client/SSLClient/bssl/ssl_io.c diff --git a/src/SSLClient/bssl/ssl_keyexport.c b/src/client/SSLClient/bssl/ssl_keyexport.c similarity index 100% rename from src/SSLClient/bssl/ssl_keyexport.c rename to src/client/SSLClient/bssl/ssl_keyexport.c diff --git a/src/SSLClient/bssl/ssl_lru.c b/src/client/SSLClient/bssl/ssl_lru.c similarity index 100% rename from src/SSLClient/bssl/ssl_lru.c rename to src/client/SSLClient/bssl/ssl_lru.c diff --git a/src/SSLClient/bssl/ssl_rec_cbc.c b/src/client/SSLClient/bssl/ssl_rec_cbc.c similarity index 100% rename from src/SSLClient/bssl/ssl_rec_cbc.c rename to src/client/SSLClient/bssl/ssl_rec_cbc.c diff --git a/src/SSLClient/bssl/ssl_rec_ccm.c b/src/client/SSLClient/bssl/ssl_rec_ccm.c similarity index 100% rename from src/SSLClient/bssl/ssl_rec_ccm.c rename to src/client/SSLClient/bssl/ssl_rec_ccm.c diff --git a/src/SSLClient/bssl/ssl_rec_chapol.c b/src/client/SSLClient/bssl/ssl_rec_chapol.c similarity index 100% rename from src/SSLClient/bssl/ssl_rec_chapol.c rename to src/client/SSLClient/bssl/ssl_rec_chapol.c diff --git a/src/SSLClient/bssl/ssl_rec_gcm.c b/src/client/SSLClient/bssl/ssl_rec_gcm.c similarity index 100% rename from src/SSLClient/bssl/ssl_rec_gcm.c rename to src/client/SSLClient/bssl/ssl_rec_gcm.c diff --git a/src/SSLClient/bssl/ssl_scert_single_ec.c b/src/client/SSLClient/bssl/ssl_scert_single_ec.c similarity index 100% rename from src/SSLClient/bssl/ssl_scert_single_ec.c rename to src/client/SSLClient/bssl/ssl_scert_single_ec.c diff --git a/src/SSLClient/bssl/ssl_scert_single_rsa.c b/src/client/SSLClient/bssl/ssl_scert_single_rsa.c similarity index 100% rename from src/SSLClient/bssl/ssl_scert_single_rsa.c rename to src/client/SSLClient/bssl/ssl_scert_single_rsa.c diff --git a/src/SSLClient/bssl/ssl_server.c b/src/client/SSLClient/bssl/ssl_server.c similarity index 100% rename from src/SSLClient/bssl/ssl_server.c rename to src/client/SSLClient/bssl/ssl_server.c diff --git a/src/SSLClient/bssl/ssl_server_full_ec.c b/src/client/SSLClient/bssl/ssl_server_full_ec.c similarity index 100% rename from src/SSLClient/bssl/ssl_server_full_ec.c rename to src/client/SSLClient/bssl/ssl_server_full_ec.c diff --git a/src/SSLClient/bssl/ssl_server_full_rsa.c b/src/client/SSLClient/bssl/ssl_server_full_rsa.c similarity index 100% rename from src/SSLClient/bssl/ssl_server_full_rsa.c rename to src/client/SSLClient/bssl/ssl_server_full_rsa.c diff --git a/src/SSLClient/bssl/ssl_server_mine2c.c b/src/client/SSLClient/bssl/ssl_server_mine2c.c similarity index 100% rename from src/SSLClient/bssl/ssl_server_mine2c.c rename to src/client/SSLClient/bssl/ssl_server_mine2c.c diff --git a/src/SSLClient/bssl/ssl_server_mine2g.c b/src/client/SSLClient/bssl/ssl_server_mine2g.c similarity index 100% rename from src/SSLClient/bssl/ssl_server_mine2g.c rename to src/client/SSLClient/bssl/ssl_server_mine2g.c diff --git a/src/SSLClient/bssl/ssl_server_minf2c.c b/src/client/SSLClient/bssl/ssl_server_minf2c.c similarity index 100% rename from src/SSLClient/bssl/ssl_server_minf2c.c rename to src/client/SSLClient/bssl/ssl_server_minf2c.c diff --git a/src/SSLClient/bssl/ssl_server_minf2g.c b/src/client/SSLClient/bssl/ssl_server_minf2g.c similarity index 100% rename from src/SSLClient/bssl/ssl_server_minf2g.c rename to src/client/SSLClient/bssl/ssl_server_minf2g.c diff --git a/src/SSLClient/bssl/ssl_server_minr2g.c b/src/client/SSLClient/bssl/ssl_server_minr2g.c similarity index 100% rename from src/SSLClient/bssl/ssl_server_minr2g.c rename to src/client/SSLClient/bssl/ssl_server_minr2g.c diff --git a/src/SSLClient/bssl/ssl_server_minu2g.c b/src/client/SSLClient/bssl/ssl_server_minu2g.c similarity index 100% rename from src/SSLClient/bssl/ssl_server_minu2g.c rename to src/client/SSLClient/bssl/ssl_server_minu2g.c diff --git a/src/SSLClient/bssl/ssl_server_minv2g.c b/src/client/SSLClient/bssl/ssl_server_minv2g.c similarity index 100% rename from src/SSLClient/bssl/ssl_server_minv2g.c rename to src/client/SSLClient/bssl/ssl_server_minv2g.c diff --git a/src/SSLClient/bssl/sysrng.c b/src/client/SSLClient/bssl/sysrng.c similarity index 100% rename from src/SSLClient/bssl/sysrng.c rename to src/client/SSLClient/bssl/sysrng.c diff --git a/src/SSLClient/bssl/x509_decoder.c b/src/client/SSLClient/bssl/x509_decoder.c similarity index 100% rename from src/SSLClient/bssl/x509_decoder.c rename to src/client/SSLClient/bssl/x509_decoder.c diff --git a/src/SSLClient/bssl/x509_decoder.t0 b/src/client/SSLClient/bssl/x509_decoder.t0 similarity index 100% rename from src/SSLClient/bssl/x509_decoder.t0 rename to src/client/SSLClient/bssl/x509_decoder.t0 diff --git a/src/SSLClient/bssl/x509_knownkey.c b/src/client/SSLClient/bssl/x509_knownkey.c similarity index 100% rename from src/SSLClient/bssl/x509_knownkey.c rename to src/client/SSLClient/bssl/x509_knownkey.c diff --git a/src/SSLClient/bssl/x509_minimal.c b/src/client/SSLClient/bssl/x509_minimal.c similarity index 100% rename from src/SSLClient/bssl/x509_minimal.c rename to src/client/SSLClient/bssl/x509_minimal.c diff --git a/src/SSLClient/bssl/x509_minimal.t0 b/src/client/SSLClient/bssl/x509_minimal.t0 similarity index 100% rename from src/SSLClient/bssl/x509_minimal.t0 rename to src/client/SSLClient/bssl/x509_minimal.t0 diff --git a/src/SSLClient/bssl/x509_minimal_full.c b/src/client/SSLClient/bssl/x509_minimal_full.c similarity index 100% rename from src/SSLClient/bssl/x509_minimal_full.c rename to src/client/SSLClient/bssl/x509_minimal_full.c diff --git a/src/SSLClient/client/BSSL_CertStore.cpp b/src/client/SSLClient/client/BSSL_CertStore.cpp similarity index 100% rename from src/SSLClient/client/BSSL_CertStore.cpp rename to src/client/SSLClient/client/BSSL_CertStore.cpp diff --git a/src/SSLClient/client/BSSL_CertStore.h b/src/client/SSLClient/client/BSSL_CertStore.h similarity index 100% rename from src/SSLClient/client/BSSL_CertStore.h rename to src/client/SSLClient/client/BSSL_CertStore.h diff --git a/src/SSLClient/client/BSSL_Helper.cpp b/src/client/SSLClient/client/BSSL_Helper.cpp similarity index 100% rename from src/SSLClient/client/BSSL_Helper.cpp rename to src/client/SSLClient/client/BSSL_Helper.cpp diff --git a/src/SSLClient/client/BSSL_Helper.h b/src/client/SSLClient/client/BSSL_Helper.h similarity index 100% rename from src/SSLClient/client/BSSL_Helper.h rename to src/client/SSLClient/client/BSSL_Helper.h diff --git a/src/SSLClient/client/BSSL_SSL_Client.cpp b/src/client/SSLClient/client/BSSL_SSL_Client.cpp similarity index 100% rename from src/SSLClient/client/BSSL_SSL_Client.cpp rename to src/client/SSLClient/client/BSSL_SSL_Client.cpp diff --git a/src/SSLClient/client/BSSL_SSL_Client.h b/src/client/SSLClient/client/BSSL_SSL_Client.h similarity index 100% rename from src/SSLClient/client/BSSL_SSL_Client.h rename to src/client/SSLClient/client/BSSL_SSL_Client.h diff --git a/src/SSLClient/client/BSSL_TCP_Client.cpp b/src/client/SSLClient/client/BSSL_TCP_Client.cpp similarity index 100% rename from src/SSLClient/client/BSSL_TCP_Client.cpp rename to src/client/SSLClient/client/BSSL_TCP_Client.cpp diff --git a/src/SSLClient/client/BSSL_TCP_Client.h b/src/client/SSLClient/client/BSSL_TCP_Client.h similarity index 100% rename from src/SSLClient/client/BSSL_TCP_Client.h rename to src/client/SSLClient/client/BSSL_TCP_Client.h diff --git a/src/SSLClient/client/stm32_time_fix.c b/src/client/SSLClient/client/stm32_time_fix.c similarity index 100% rename from src/SSLClient/client/stm32_time_fix.c rename to src/client/SSLClient/client/stm32_time_fix.c diff --git a/src/extras/WiFiClientImpl.h b/src/client/WiFiClientImpl.h similarity index 99% rename from src/extras/WiFiClientImpl.h rename to src/client/WiFiClientImpl.h index 9de0a5b3..3f57f61c 100644 --- a/src/extras/WiFiClientImpl.h +++ b/src/client/WiFiClientImpl.h @@ -465,12 +465,13 @@ class WiFiClientImpl : public Client } else if (res < 0) { - log_e("fail on fd %d, errno: %d, \"%s\"", _socket, errno, strerror(errno)); + // log_e("fail on fd %d, errno: %d, \"%s\"", _socket, errno, strerror(errno)); if (errno != EAGAIN) { // if resource was busy, can try again, otherwise give up res = 0; retry = 0; + tcpClose(); } } else diff --git a/src/extras/MB_Time.h b/src/extras/MB_Time.h index d6063880..3cd0f15d 100644 --- a/src/extras/MB_Time.h +++ b/src/extras/MB_Time.h @@ -1,10 +1,6 @@ #ifndef MB_Time_H #define MB_Time_H -#include "./ESP_Mail_Client_Version.h" -#if !VALID_VERSION_CHECK(30415) -#error "Mixed versions compilation." -#endif /* * Time helper class v1.0.7 diff --git a/src/extras/Networks.h b/src/extras/Networks.h index 3b0f329f..dd1c9519 100644 --- a/src/extras/Networks.h +++ b/src/extras/Networks.h @@ -3,11 +3,6 @@ #include "./ESP_Mail_FS.h" -#include "./ESP_Mail_Client_Version.h" -#if !VALID_VERSION_CHECK(30415) -#error "Mixed versions compilation." -#endif - // Renesas devices #if defined(ARDUINO_UNOWIFIR4) || defined(ARDUINO_MINIMA) || defined(ARDUINO_PORTENTA_C33) #define ESP_MAIL_STRSEP strsepImpl diff --git a/src/extras/RFC2047.cpp b/src/extras/RFC2047.cpp index 36e5c74f..b27834e6 100644 --- a/src/extras/RFC2047.cpp +++ b/src/extras/RFC2047.cpp @@ -1,11 +1,6 @@ #ifndef RFC2047_CPP #define RFC2047_CPP -#include "ESP_Mail_Client_Version.h" -#if !VALID_VERSION_CHECK(30415) -#error "Mixed versions compilation." -#endif - #include "RFC2047.h" RFC2047_Decoder::RFC2047_Decoder() {} diff --git a/src/extras/RFC2047.h b/src/extras/RFC2047.h index 86f5f33b..31033e98 100644 --- a/src/extras/RFC2047.h +++ b/src/extras/RFC2047.h @@ -3,10 +3,6 @@ #ifndef RFC2047_H #define RFC2047_H -#include "ESP_Mail_Client_Version.h" -#if !VALID_VERSION_CHECK(30415) -#error "Mixed versions compilation." -#endif #include #include "./ESP_Mail_FS.h"