1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-06-17 22:23:10 +03:00

Remove stray axtls refs, deprecated compat funcs (#7626)

Remove the axTLS compatability functions from WiFiClient/ServerSecure,
device tests for axTLS, and any document refs to axTLS.
This commit is contained in:
Earle F. Philhower, III
2020-10-02 21:39:36 -07:00
committed by GitHub
parent 7c8f934d2b
commit 85ba53a249
6 changed files with 4 additions and 218 deletions

View File

@ -97,7 +97,6 @@ void WiFiClientSecure::_clearAuthenticationSettings() {
_use_self_signed = false;
_knownkey = nullptr;
_ta = nullptr;
_axtls_ta = nullptr;
}
@ -106,8 +105,6 @@ WiFiClientSecure::WiFiClientSecure() : WiFiClient() {
_clearAuthenticationSettings();
_certStore = nullptr; // Don't want to remove cert store on a clear, should be long lived
_sk = nullptr;
_axtls_chain = nullptr;
_axtls_sk = nullptr;
stack_thunk_add_ref();
}
@ -124,10 +121,6 @@ WiFiClientSecure::~WiFiClientSecure() {
_cipher_list = nullptr; // std::shared will free if last reference
_freeSSL();
stack_thunk_del_ref();
// Clean up any dangling axtls compat structures, if needed
_axtls_ta = nullptr;
_axtls_chain = nullptr;
_axtls_sk = nullptr;
}
WiFiClientSecure::WiFiClientSecure(ClientContext* client,
@ -1576,79 +1569,4 @@ bool WiFiClientSecure::probeMaxFragmentLength(IPAddress ip, uint16_t port, uint1
return _SendAbort(probe, supportsLen);
}
// AXTLS compatibility interfaces
bool WiFiClientSecure::setCACert(const uint8_t* pk, size_t size) {
_axtls_ta = nullptr;
_axtls_ta = std::shared_ptr<X509List>(new X509List(pk, size));
_ta = _axtls_ta.get();
return _ta ? true : false;
}
bool WiFiClientSecure::setCertificate(const uint8_t* pk, size_t size) {
_axtls_chain = nullptr;
_axtls_chain = std::shared_ptr<X509List>(new X509List(pk, size));
_chain = _axtls_chain.get();
return _chain ? true : false;
}
bool WiFiClientSecure::setPrivateKey(const uint8_t* pk, size_t size) {
_axtls_sk = nullptr;
_axtls_sk = std::shared_ptr<PrivateKey>(new PrivateKey(pk, size));
_sk = _axtls_sk.get();
return _sk ? true : false;
}
uint8_t *WiFiClientSecure::_streamLoad(Stream& stream, size_t size) {
uint8_t *dest = (uint8_t*)malloc(size);
if (!dest) {
return nullptr;
}
if (size != stream.readBytes(dest, size)) {
free(dest);
return nullptr;
}
return dest;
}
bool WiFiClientSecure::loadCACert(Stream& stream, size_t size) {
uint8_t *dest = _streamLoad(stream, size);
bool ret = false;
if (dest) {
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
ret = setCACert(dest, size);
#pragma GCC diagnostic pop
}
free(dest);
return ret;
}
bool WiFiClientSecure::loadCertificate(Stream& stream, size_t size) {
uint8_t *dest = _streamLoad(stream, size);
bool ret = false;
if (dest) {
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
ret = setCertificate(dest, size);
#pragma GCC diagnostic pop
}
free(dest);
return ret;
}
bool WiFiClientSecure::loadPrivateKey(Stream& stream, size_t size) {
uint8_t *dest = _streamLoad(stream, size);
bool ret = false;
if (dest) {
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
ret = setPrivateKey(dest, size);
#pragma GCC diagnostic pop
}
free(dest);
return ret;
}
};