mirror of
https://github.com/espressif/esp-idf.git
synced 2025-09-30 19:19:21 +00: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.
This commit is contained in:
@@ -89,7 +89,7 @@ static void ssl_platform_debug(void *ctx, int level,
|
||||
}
|
||||
#endif
|
||||
|
||||
int mbedtls_ssl_send(void *ctx, const unsigned char *buf, size_t len )
|
||||
static int mbedtls_bio_send(void *ctx, const unsigned char *buf, size_t len )
|
||||
{
|
||||
BIO *bio = ctx;
|
||||
int written = BIO_write(bio, buf, len);
|
||||
@@ -99,7 +99,7 @@ int mbedtls_ssl_send(void *ctx, const unsigned char *buf, size_t len )
|
||||
return written;
|
||||
}
|
||||
|
||||
static int mbedtls_ssl_recv(void *ctx, unsigned char *buf, size_t len )
|
||||
static int mbedtls_bio_recv(void *ctx, unsigned char *buf, size_t len )
|
||||
{
|
||||
BIO *bio = ctx;
|
||||
int read = BIO_read(bio, buf, len);
|
||||
@@ -316,7 +316,7 @@ int ssl_pm_handshake(SSL *ssl)
|
||||
struct ssl_pm *ssl_pm = (struct ssl_pm *)ssl->ssl_pm;
|
||||
|
||||
if (ssl->bio) {
|
||||
mbedtls_ssl_set_bio(&ssl_pm->ssl, ssl->bio, mbedtls_ssl_send, mbedtls_ssl_recv, NULL);
|
||||
mbedtls_ssl_set_bio(&ssl_pm->ssl, ssl->bio, mbedtls_bio_send, mbedtls_bio_recv, NULL);
|
||||
}
|
||||
|
||||
ret = ssl_pm_reload_crt(ssl);
|
||||
|
Reference in New Issue
Block a user