mirror of
https://github.com/espressif/esp-protocols.git
synced 2025-07-24 07:47:30 +02:00
asio: Use internal ssl context and engine impl
Implement asio-ssl layer with three classes in asio::ssl::mbedtls: * context -- replaces SSL_CTX, used mainly as a container to options, certs, keys * engine -- replaces SSL, implements the actual mbedtls operations * bio -- implements openssl BIO specifically tailered to mbedtls and its asio usage Further updates: * asio: Used shared_ptr<> for bio pairs * asio: Add error checks to mbedtls-bio * asio: Address potential ssl-context ownership issue * asio: Address potential bio-engine ownership issue * Original commit: espressif/esp-idf@d823106aa6
This commit is contained in:
20
components/asio/port/src/asio_ssl_impl.cpp
Normal file
20
components/asio/port/src/asio_ssl_impl.cpp
Normal file
@ -0,0 +1,20 @@
|
||||
//
|
||||
// SPDX-FileCopyrightText: 2021 Espressif Systems (Shanghai) CO LTD
|
||||
//
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
//
|
||||
|
||||
#include "asio/detail/config.hpp"
|
||||
#include "asio/ssl/detail/openssl_init.hpp"
|
||||
|
||||
namespace asio {
|
||||
namespace ssl {
|
||||
namespace detail {
|
||||
|
||||
// No OpenSSL in this implementation, instance is nullptr
|
||||
asio::detail::shared_ptr<openssl_init_base::do_init> openssl_init_base::instance()
|
||||
{
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
} } } // namespace asio::ssl::detail
|
@ -1,47 +0,0 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2020-2021 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
//
|
||||
|
||||
#include "esp_asio_config.h"
|
||||
#include "internal/ssl_dbg.h"
|
||||
#include "openssl/esp_asio_openssl_stubs.h"
|
||||
|
||||
// Unsupported features as macros to make the assertions more readable
|
||||
#define ESP_OPENSSL_DH_IS_SUPPORTED 0
|
||||
#define ESP_OPENSSL_GENERAL_NAMES_IS_SUPPORTED 0
|
||||
|
||||
void DH_free (DH *r)
|
||||
{
|
||||
SSL_ASSERT3(ESP_OPENSSL_DH_IS_SUPPORTED);
|
||||
}
|
||||
|
||||
DH *PEM_read_bio_DHparams(BIO *bp, DH **x, pem_password_cb *cb, void *u)
|
||||
{
|
||||
SSL_ASSERT2(ESP_OPENSSL_DH_IS_SUPPORTED);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
int SSL_CTX_set_tmp_dh(SSL_CTX *ctx, const DH *dh)
|
||||
{
|
||||
SSL_ASSERT1(ESP_OPENSSL_DH_IS_SUPPORTED);
|
||||
return -1;
|
||||
}
|
||||
|
||||
void GENERAL_NAMES_free(GENERAL_NAMES * gens)
|
||||
{
|
||||
SSL_ASSERT3(ESP_OPENSSL_GENERAL_NAMES_IS_SUPPORTED);
|
||||
}
|
||||
|
||||
X509_NAME *X509_get_subject_name(X509 *a)
|
||||
{
|
||||
SSL_ASSERT2(ESP_OPENSSL_GENERAL_NAMES_IS_SUPPORTED);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
int SSL_CTX_clear_chain_certs(SSL_CTX *ctx)
|
||||
{
|
||||
return 1;
|
||||
}
|
Reference in New Issue
Block a user