mirror of
https://github.com/espressif/esp-protocols.git
synced 2025-07-16 12:02:11 +02:00
asio: Basic SSL/TLS support in asio port for ESP platform
This port employs IDF port of OpenSSL for most common features, others are discouraged or not supported. The port also introduces several stubs for OpenSSL functions which ASIO needs to get compiled and linked. Upstream ASIO supports WolfSSL as SSL/TLS stack, as well, which is another option for SSL support in ASIO on ESP platform. * Original commit: espressif/esp-idf@9459c0dd43
This commit is contained in:
60
components/asio/port/src/esp_asio_openssl_stubs.c
Normal file
60
components/asio/port/src/esp_asio_openssl_stubs.c
Normal file
@ -0,0 +1,60 @@
|
||||
// Copyright 2020 Espressif Systems (Shanghai) PTE LTD
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
|
||||
#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;
|
||||
}
|
||||
|
||||
uint32_t SSL_set_mode(SSL *ssl, uint32_t mode)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
int SSL_CTX_clear_chain_certs(SSL_CTX *ctx)
|
||||
{
|
||||
return 1;
|
||||
}
|
Reference in New Issue
Block a user