mirror of
https://github.com/esp8266/Arduino.git
synced 2025-06-07 16:23:38 +03:00
Move BearSSL _cipher* init to _clear() for consistency (#5178)
The cipher list count/pointer was cleared separately in the three constructors available. Move this reset to _clear() to reduce code duplication and keep the semantics.
This commit is contained in:
parent
5137d4da11
commit
8e11836378
@ -72,6 +72,8 @@ void WiFiClientSecure::_clear() {
|
|||||||
_recvapp_len = 0;
|
_recvapp_len = 0;
|
||||||
_oom_err = false;
|
_oom_err = false;
|
||||||
_deleteChainKeyTA = false;
|
_deleteChainKeyTA = false;
|
||||||
|
_cipher_list = NULL;
|
||||||
|
_cipher_cnt = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void WiFiClientSecure::_clearAuthenticationSettings() {
|
void WiFiClientSecure::_clearAuthenticationSettings() {
|
||||||
@ -85,8 +87,6 @@ void WiFiClientSecure::_clearAuthenticationSettings() {
|
|||||||
|
|
||||||
|
|
||||||
WiFiClientSecure::WiFiClientSecure() : WiFiClient() {
|
WiFiClientSecure::WiFiClientSecure() : WiFiClient() {
|
||||||
_cipher_list = NULL;
|
|
||||||
_cipher_cnt = 0;
|
|
||||||
_clear();
|
_clear();
|
||||||
_clearAuthenticationSettings();
|
_clearAuthenticationSettings();
|
||||||
_certStore = nullptr; // Don't want to remove cert store on a clear, should be long lived
|
_certStore = nullptr; // Don't want to remove cert store on a clear, should be long lived
|
||||||
@ -116,8 +116,6 @@ WiFiClientSecure::~WiFiClientSecure() {
|
|||||||
WiFiClientSecure::WiFiClientSecure(ClientContext* client,
|
WiFiClientSecure::WiFiClientSecure(ClientContext* client,
|
||||||
const BearSSLX509List *chain, const BearSSLPrivateKey *sk,
|
const BearSSLX509List *chain, const BearSSLPrivateKey *sk,
|
||||||
int iobuf_in_size, int iobuf_out_size, const BearSSLX509List *client_CA_ta) {
|
int iobuf_in_size, int iobuf_out_size, const BearSSLX509List *client_CA_ta) {
|
||||||
_cipher_list = NULL;
|
|
||||||
_cipher_cnt = 0;
|
|
||||||
_clear();
|
_clear();
|
||||||
_clearAuthenticationSettings();
|
_clearAuthenticationSettings();
|
||||||
_iobuf_in_size = iobuf_in_size;
|
_iobuf_in_size = iobuf_in_size;
|
||||||
@ -135,8 +133,6 @@ WiFiClientSecure::WiFiClientSecure(ClientContext *client,
|
|||||||
const BearSSLX509List *chain,
|
const BearSSLX509List *chain,
|
||||||
unsigned cert_issuer_key_type, const BearSSLPrivateKey *sk,
|
unsigned cert_issuer_key_type, const BearSSLPrivateKey *sk,
|
||||||
int iobuf_in_size, int iobuf_out_size, const BearSSLX509List *client_CA_ta) {
|
int iobuf_in_size, int iobuf_out_size, const BearSSLX509List *client_CA_ta) {
|
||||||
_cipher_list = NULL;
|
|
||||||
_cipher_cnt = 0;
|
|
||||||
_clear();
|
_clear();
|
||||||
_clearAuthenticationSettings();
|
_clearAuthenticationSettings();
|
||||||
_iobuf_in_size = iobuf_in_size;
|
_iobuf_in_size = iobuf_in_size;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user