From aa6d8b466258ccf4c523129d2e4d8f589f13a51e Mon Sep 17 00:00:00 2001 From: Sergey Lyubka Date: Wed, 15 Dec 2021 11:04:43 +0000 Subject: [PATCH] Remove TLS custom_init() API --- mongoose.c | 8 -------- mongoose.h | 1 - src/tls.h | 1 - src/tls_mbed.c | 4 ---- src/tls_openssl.c | 4 ---- 5 files changed, 18 deletions(-) diff --git a/mongoose.c b/mongoose.c index 76a141f1..86326a58 100644 --- a/mongoose.c +++ b/mongoose.c @@ -3780,10 +3780,6 @@ void mg_tls_init(struct mg_connection *c, struct mg_tls_opts *opts) { if (tls == NULL) { mg_error(c, "TLS OOM"); goto fail; - } else if (opts->custom_init != NULL && - opts->custom_init(c, opts, tls) != 0) { - mg_error(c, "TLS custom init failed"); - goto fail; } LOG(LL_DEBUG, ("%lu Setting TLS, CA: %s, CRL: %s, cert: %s, key: %s", c->id, ca, crl, cert, certkey)); @@ -3949,10 +3945,6 @@ void mg_tls_init(struct mg_connection *c, struct mg_tls_opts *opts) { if (tls == NULL) { mg_error(c, "TLS OOM"); goto fail; - } else if (opts->custom_init != NULL && - opts->custom_init(c, opts, tls) != 0) { - mg_error(c, "TLS custom init failed"); - goto fail; } if (!s_initialised) { diff --git a/mongoose.h b/mongoose.h index 09e08a54..7599767e 100644 --- a/mongoose.h +++ b/mongoose.h @@ -930,7 +930,6 @@ struct mg_tls_opts { const char *certkey; // Certificate key const char *ciphers; // Cipher list struct mg_str srvname; // If not empty, enables server name verification - int (*custom_init)(struct mg_connection *, struct mg_tls_opts *, void *tls); }; void mg_tls_init(struct mg_connection *, struct mg_tls_opts *); diff --git a/src/tls.h b/src/tls.h index c9846f78..704c366e 100644 --- a/src/tls.h +++ b/src/tls.h @@ -11,7 +11,6 @@ struct mg_tls_opts { const char *certkey; // Certificate key const char *ciphers; // Cipher list struct mg_str srvname; // If not empty, enables server name verification - int (*custom_init)(struct mg_connection *, struct mg_tls_opts *, void *tls); }; void mg_tls_init(struct mg_connection *, struct mg_tls_opts *); diff --git a/src/tls_mbed.c b/src/tls_mbed.c index af928190..f1dc8b3c 100644 --- a/src/tls_mbed.c +++ b/src/tls_mbed.c @@ -58,10 +58,6 @@ void mg_tls_init(struct mg_connection *c, struct mg_tls_opts *opts) { if (tls == NULL) { mg_error(c, "TLS OOM"); goto fail; - } else if (opts->custom_init != NULL && - opts->custom_init(c, opts, tls) != 0) { - mg_error(c, "TLS custom init failed"); - goto fail; } LOG(LL_DEBUG, ("%lu Setting TLS, CA: %s, CRL: %s, cert: %s, key: %s", c->id, ca, crl, cert, certkey)); diff --git a/src/tls_openssl.c b/src/tls_openssl.c index 13aa0afa..0772f7ff 100644 --- a/src/tls_openssl.c +++ b/src/tls_openssl.c @@ -28,10 +28,6 @@ void mg_tls_init(struct mg_connection *c, struct mg_tls_opts *opts) { if (tls == NULL) { mg_error(c, "TLS OOM"); goto fail; - } else if (opts->custom_init != NULL && - opts->custom_init(c, opts, tls) != 0) { - mg_error(c, "TLS custom init failed"); - goto fail; } if (!s_initialised) {