mirror of
https://github.com/esp8266/Arduino.git
synced 2025-06-17 22:23:10 +03:00
WiFiServerSecure: Cache SSL sessions (#7774)
* WiFiServerSecure: Cache the SSL sessions * Add SSL session caching to HTTPS server examples * Document server SSL session caching * Fix an incomplete sentence in the documentation * Document BearSSL::Session * Use the number of sessions instead of the buffer size in ServerSessions' constructors
This commit is contained in:
committed by
GitHub
parent
8add1fd2d9
commit
032db6fc81
@ -872,6 +872,22 @@ bool X509List::append(const uint8_t *derCert, size_t derLen) {
|
||||
return true;
|
||||
}
|
||||
|
||||
ServerSessions::~ServerSessions() {
|
||||
if (_isDynamic && _store != nullptr)
|
||||
delete _store;
|
||||
}
|
||||
|
||||
ServerSessions::ServerSessions(ServerSession *sessions, uint32_t size, bool isDynamic) :
|
||||
_size(sessions != nullptr ? size : 0),
|
||||
_store(sessions), _isDynamic(isDynamic) {
|
||||
if (_size > 0)
|
||||
br_ssl_session_cache_lru_init(&_cache, (uint8_t*)_store, size * sizeof(ServerSession));
|
||||
}
|
||||
|
||||
const br_ssl_session_cache_class **ServerSessions::getCache() {
|
||||
return _size > 0 ? &_cache.vtable : nullptr;
|
||||
}
|
||||
|
||||
// SHA256 hash for updater
|
||||
void HashSHA256::begin() {
|
||||
br_sha256_init( &_cc );
|
||||
|
Reference in New Issue
Block a user