mirror of
https://github.com/cesanta/mongoose.git
synced 2025-06-07 17:42:30 +08:00
freshen: early attempts to make ota and config work
freshen: implement ota rollback freshen: api for rpc freshen: implement rpc api (without transport) PUBLISHED_FROM=9f935f676161c81464a0dc53d5d8d085b2437ffb
This commit is contained in:
parent
dab526936f
commit
0ae2b82b60
@ -4688,9 +4688,11 @@ static enum mg_ssl_if_result mg_use_ca_cert(struct mg_ssl_if_ctx *ctx,
|
|||||||
const char *cert);
|
const char *cert);
|
||||||
static enum mg_ssl_if_result mg_set_cipher_list(struct mg_ssl_if_ctx *ctx,
|
static enum mg_ssl_if_result mg_set_cipher_list(struct mg_ssl_if_ctx *ctx,
|
||||||
const char *ciphers);
|
const char *ciphers);
|
||||||
|
#ifdef MBEDTLS_KEY_EXCHANGE__SOME__PSK_ENABLED
|
||||||
static enum mg_ssl_if_result mg_ssl_if_mbed_set_psk(struct mg_ssl_if_ctx *ctx,
|
static enum mg_ssl_if_result mg_ssl_if_mbed_set_psk(struct mg_ssl_if_ctx *ctx,
|
||||||
const char *identity,
|
const char *identity,
|
||||||
const char *key);
|
const char *key);
|
||||||
|
#endif
|
||||||
|
|
||||||
enum mg_ssl_if_result mg_ssl_if_conn_init(
|
enum mg_ssl_if_result mg_ssl_if_conn_init(
|
||||||
struct mg_connection *nc, const struct mg_ssl_if_conn_params *params,
|
struct mg_connection *nc, const struct mg_ssl_if_conn_params *params,
|
||||||
@ -4739,11 +4741,13 @@ enum mg_ssl_if_result mg_ssl_if_conn_init(
|
|||||||
return MG_SSL_ERROR;
|
return MG_SSL_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef MBEDTLS_KEY_EXCHANGE__SOME__PSK_ENABLED
|
||||||
if (mg_ssl_if_mbed_set_psk(ctx, params->psk_identity, params->psk_key) !=
|
if (mg_ssl_if_mbed_set_psk(ctx, params->psk_identity, params->psk_key) !=
|
||||||
MG_SSL_OK) {
|
MG_SSL_OK) {
|
||||||
MG_SET_PTRPTR(err_msg, "Invalid PSK settings");
|
MG_SET_PTRPTR(err_msg, "Invalid PSK settings");
|
||||||
return MG_SSL_ERROR;
|
return MG_SSL_ERROR;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
if (!(nc->flags & MG_F_LISTENING)) {
|
if (!(nc->flags & MG_F_LISTENING)) {
|
||||||
ctx->ssl = (mbedtls_ssl_context *) MG_CALLOC(1, sizeof(*ctx->ssl));
|
ctx->ssl = (mbedtls_ssl_context *) MG_CALLOC(1, sizeof(*ctx->ssl));
|
||||||
@ -5037,6 +5041,7 @@ static enum mg_ssl_if_result mg_set_cipher_list(struct mg_ssl_if_ctx *ctx,
|
|||||||
return MG_SSL_OK;
|
return MG_SSL_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef MBEDTLS_KEY_EXCHANGE__SOME__PSK_ENABLED
|
||||||
static enum mg_ssl_if_result mg_ssl_if_mbed_set_psk(struct mg_ssl_if_ctx *ctx,
|
static enum mg_ssl_if_result mg_ssl_if_mbed_set_psk(struct mg_ssl_if_ctx *ctx,
|
||||||
const char *identity,
|
const char *identity,
|
||||||
const char *key_str) {
|
const char *key_str) {
|
||||||
@ -5073,6 +5078,7 @@ static enum mg_ssl_if_result mg_ssl_if_mbed_set_psk(struct mg_ssl_if_ctx *ctx,
|
|||||||
}
|
}
|
||||||
return MG_SSL_OK;
|
return MG_SSL_OK;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
const char *mg_set_ssl(struct mg_connection *nc, const char *cert,
|
const char *mg_set_ssl(struct mg_connection *nc, const char *cert,
|
||||||
const char *ca_cert) {
|
const char *ca_cert) {
|
||||||
|
@ -67,9 +67,11 @@ static enum mg_ssl_if_result mg_use_ca_cert(struct mg_ssl_if_ctx *ctx,
|
|||||||
const char *cert);
|
const char *cert);
|
||||||
static enum mg_ssl_if_result mg_set_cipher_list(struct mg_ssl_if_ctx *ctx,
|
static enum mg_ssl_if_result mg_set_cipher_list(struct mg_ssl_if_ctx *ctx,
|
||||||
const char *ciphers);
|
const char *ciphers);
|
||||||
|
#ifdef MBEDTLS_KEY_EXCHANGE__SOME__PSK_ENABLED
|
||||||
static enum mg_ssl_if_result mg_ssl_if_mbed_set_psk(struct mg_ssl_if_ctx *ctx,
|
static enum mg_ssl_if_result mg_ssl_if_mbed_set_psk(struct mg_ssl_if_ctx *ctx,
|
||||||
const char *identity,
|
const char *identity,
|
||||||
const char *key);
|
const char *key);
|
||||||
|
#endif
|
||||||
|
|
||||||
enum mg_ssl_if_result mg_ssl_if_conn_init(
|
enum mg_ssl_if_result mg_ssl_if_conn_init(
|
||||||
struct mg_connection *nc, const struct mg_ssl_if_conn_params *params,
|
struct mg_connection *nc, const struct mg_ssl_if_conn_params *params,
|
||||||
@ -118,11 +120,13 @@ enum mg_ssl_if_result mg_ssl_if_conn_init(
|
|||||||
return MG_SSL_ERROR;
|
return MG_SSL_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef MBEDTLS_KEY_EXCHANGE__SOME__PSK_ENABLED
|
||||||
if (mg_ssl_if_mbed_set_psk(ctx, params->psk_identity, params->psk_key) !=
|
if (mg_ssl_if_mbed_set_psk(ctx, params->psk_identity, params->psk_key) !=
|
||||||
MG_SSL_OK) {
|
MG_SSL_OK) {
|
||||||
MG_SET_PTRPTR(err_msg, "Invalid PSK settings");
|
MG_SET_PTRPTR(err_msg, "Invalid PSK settings");
|
||||||
return MG_SSL_ERROR;
|
return MG_SSL_ERROR;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
if (!(nc->flags & MG_F_LISTENING)) {
|
if (!(nc->flags & MG_F_LISTENING)) {
|
||||||
ctx->ssl = (mbedtls_ssl_context *) MG_CALLOC(1, sizeof(*ctx->ssl));
|
ctx->ssl = (mbedtls_ssl_context *) MG_CALLOC(1, sizeof(*ctx->ssl));
|
||||||
@ -416,6 +420,7 @@ static enum mg_ssl_if_result mg_set_cipher_list(struct mg_ssl_if_ctx *ctx,
|
|||||||
return MG_SSL_OK;
|
return MG_SSL_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef MBEDTLS_KEY_EXCHANGE__SOME__PSK_ENABLED
|
||||||
static enum mg_ssl_if_result mg_ssl_if_mbed_set_psk(struct mg_ssl_if_ctx *ctx,
|
static enum mg_ssl_if_result mg_ssl_if_mbed_set_psk(struct mg_ssl_if_ctx *ctx,
|
||||||
const char *identity,
|
const char *identity,
|
||||||
const char *key_str) {
|
const char *key_str) {
|
||||||
@ -452,6 +457,7 @@ static enum mg_ssl_if_result mg_ssl_if_mbed_set_psk(struct mg_ssl_if_ctx *ctx,
|
|||||||
}
|
}
|
||||||
return MG_SSL_OK;
|
return MG_SSL_OK;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
const char *mg_set_ssl(struct mg_connection *nc, const char *cert,
|
const char *mg_set_ssl(struct mg_connection *nc, const char *cert,
|
||||||
const char *ca_cert) {
|
const char *ca_cert) {
|
||||||
|
Loading…
Reference in New Issue
Block a user