mirror of
https://github.com/cesanta/mongoose.git
synced 2026-12-04 21:58:22 +00:00
Compare commits
7
Commits
ad45248327
...
381e31198b
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
381e31198b | ||
|
|
28ba381bd9 | ||
|
|
567963b034 | ||
|
|
7d3fe4f9cb | ||
|
|
c8bf39dcd8 | ||
|
|
393c811f31 | ||
|
|
be40827e17 |
No files matched your search
+14
-2
@@ -18800,6 +18800,18 @@ static int mg_tls_recv_cert(struct mg_connection *c, bool is_client) {
|
||||
} // else r = 0 or -2 => subj not found or pubkey not matching
|
||||
}
|
||||
|
||||
// Single CA: accept the chain if the CA itself is in it, e.g. a
|
||||
// cross-signed copy of the root. Same subject and same public key
|
||||
// means the same trusted key, and the links below ci are verified
|
||||
if (tls->ca_der.len > 0 && ca.subj.len == ci->subj.len &&
|
||||
memcmp(ca.subj.value, ci->subj.value, ca.subj.len) == 0 &&
|
||||
ca.pubkey.len == ci->pubkey.len &&
|
||||
memcmp(ca.pubkey.buf, ci->pubkey.buf, ca.pubkey.len) == 0) {
|
||||
found_ca = true;
|
||||
MG_VERBOSE(("CA found in chain at depth %d", certnum - 1));
|
||||
break;
|
||||
}
|
||||
|
||||
if (certnum == sizeof(certs) / sizeof(certs[0]) - 1) {
|
||||
mg_error(c, "too many certificates in the chain");
|
||||
return -1;
|
||||
@@ -19602,7 +19614,7 @@ void mg_tls_init(struct mg_connection *c, const struct mg_tls_opts *opts) {
|
||||
if (!c->is_client) tls->is_twoway = true; // server + CA: two-way auth
|
||||
}
|
||||
|
||||
if (opts->cert.buf == NULL) {
|
||||
if (opts->cert.buf == NULL || opts->cert.len == 0) {
|
||||
MG_VERBOSE(("No certificate provided"));
|
||||
goto xit;
|
||||
}
|
||||
@@ -19631,7 +19643,7 @@ void mg_tls_init(struct mg_connection *c, const struct mg_tls_opts *opts) {
|
||||
}
|
||||
|
||||
// parse PEM or DER EC key
|
||||
if (opts->key.buf == NULL) {
|
||||
if (opts->key.buf == NULL || opts->key.len == 0) {
|
||||
mg_error(c, "Certificate provided without a private key");
|
||||
return;
|
||||
}
|
||||
|
||||
+14
-2
@@ -1931,6 +1931,18 @@ static int mg_tls_recv_cert(struct mg_connection *c, bool is_client) {
|
||||
} // else r = 0 or -2 => subj not found or pubkey not matching
|
||||
}
|
||||
|
||||
// Single CA: accept the chain if the CA itself is in it, e.g. a
|
||||
// cross-signed copy of the root. Same subject and same public key
|
||||
// means the same trusted key, and the links below ci are verified
|
||||
if (tls->ca_der.len > 0 && ca.subj.len == ci->subj.len &&
|
||||
memcmp(ca.subj.value, ci->subj.value, ca.subj.len) == 0 &&
|
||||
ca.pubkey.len == ci->pubkey.len &&
|
||||
memcmp(ca.pubkey.buf, ci->pubkey.buf, ca.pubkey.len) == 0) {
|
||||
found_ca = true;
|
||||
MG_VERBOSE(("CA found in chain at depth %d", certnum - 1));
|
||||
break;
|
||||
}
|
||||
|
||||
if (certnum == sizeof(certs) / sizeof(certs[0]) - 1) {
|
||||
mg_error(c, "too many certificates in the chain");
|
||||
return -1;
|
||||
@@ -2733,7 +2745,7 @@ void mg_tls_init(struct mg_connection *c, const struct mg_tls_opts *opts) {
|
||||
if (!c->is_client) tls->is_twoway = true; // server + CA: two-way auth
|
||||
}
|
||||
|
||||
if (opts->cert.buf == NULL) {
|
||||
if (opts->cert.buf == NULL || opts->cert.len == 0) {
|
||||
MG_VERBOSE(("No certificate provided"));
|
||||
goto xit;
|
||||
}
|
||||
@@ -2762,7 +2774,7 @@ void mg_tls_init(struct mg_connection *c, const struct mg_tls_opts *opts) {
|
||||
}
|
||||
|
||||
// parse PEM or DER EC key
|
||||
if (opts->key.buf == NULL) {
|
||||
if (opts->key.buf == NULL || opts->key.len == 0) {
|
||||
mg_error(c, "Certificate provided without a private key");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -309,6 +309,7 @@ mip_diabish: CC = gcc
|
||||
mip_diabish: CFLAGS += -std=gnu89 -Werror=declaration-after-statement -Werror=vla -Wno-pedantic
|
||||
mip_diabish: mip_test
|
||||
|
||||
mip_vc98: MDASH = 0
|
||||
mip_vc98: mip_test.c mongoose.c mongoose.h packed_fs.c Makefile
|
||||
$(DOCKER) mdashnet/vc98 wine cl mip_test.c packed_fs.c $(VCFLAGS) $(DEFS) $(TFLAGS) /Fe$@.exe
|
||||
$(DOCKER) -e WINEPREFIX=/tmp/wineprefix mdashnet/vc98 wine $@.exe
|
||||
|
||||
@@ -593,6 +593,7 @@ bool mip_x_test(struct mg_mgr *mgr) {
|
||||
|
||||
// Clear
|
||||
s_error = false;
|
||||
mg_mgr_poll(mgr, 0); // prevent mDash from trashing mg_mgr_free()
|
||||
mg_mgr_free(mgr);
|
||||
ASSERT(mgr->conns == NULL); // Deconstruction OK
|
||||
printf("HEALTH_DASHBOARD\t\"cleanup\": %s\n", s_error ? "false":"true");
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
#define MQTT_QOS 1
|
||||
#define MQTT_RECONNECT_PERIOD_MS 3000
|
||||
|
||||
#define TLS_CA ""
|
||||
#define TLS_CA "" // Use https://mongoose.ws/tls/
|
||||
#define TLS_KEY ""
|
||||
#define TLS_CRT ""
|
||||
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
See full project at https://github.com/mongoose-examples/nucleo-f429zi-dashboard-full
|
||||
|
||||
# Nucleo-F429ZI Mongoose Integration
|
||||
|
||||
This guide explains how to bring up a production-grade Web UI dashboard on the
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
See full project at https://github.com/mongoose-examples/nucleo-f746zg-dashboard-full
|
||||
|
||||
# Nucleo-F746ZG Mongoose Integration
|
||||
|
||||
This guide explains how to bring up a production-grade Web UI dashboard on the
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
See full project at https://github.com/mongoose-examples/nucleo-f756zg-dashboard-full
|
||||
|
||||
# Nucleo-F756ZG Mongoose Integration
|
||||
|
||||
This guide explains how to bring up a production-grade Web UI dashboard on the
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
See full project at https://github.com/mongoose-examples/nucleo-h743zi-dashboard-full
|
||||
|
||||
# Nucleo-H743ZI Mongoose Integration
|
||||
|
||||
This guide explains how to bring up a production-grade Web UI dashboard on the
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
See full project at https://github.com/mongoose-examples/nucleo-n657x0-q-dashboard-full
|
||||
|
||||
# Nucleo-N657X0-Q Mongoose Integration
|
||||
|
||||
This guide explains how to bring up a production-grade Web UI dashboard on the
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
See full project at https://github.com/mongoose-examples/nucleo-u5a5zj-q-dashboard-full
|
||||
|
||||
# Nucleo-U5A5ZJ-Q Mongoose Integration
|
||||
|
||||
This guide explains how to bring up a production-grade Web UI dashboard on the
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
See full project at https://github.com/mongoose-examples/portenta-h7-dashboard-full
|
||||
|
||||
# Portenta H7 Mongoose Integration
|
||||
|
||||
This guide explains how to bring up a production-grade Web UI dashboard on the
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
See full project https://github.com/mongoose-examples/stm32h573i-dk-dashboard-full
|
||||
|
||||
# STM32H573I-DK Mongoose Integration
|
||||
|
||||
This guide explains how to bring up a production-grade Web UI dashboard on the
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
See full project at https://github.com/mongoose-examples/stm32h747i-disco-dashboard-full
|
||||
|
||||
# STM32H747I-DISCO Mongoose Integration
|
||||
|
||||
This guide explains how to bring up a production-grade Web UI dashboard on the
|
||||
|
||||
Reference in new issue
Block a user