From 5552fdbf102586e0e32765956144e7f6f034a69a Mon Sep 17 00:00:00 2001 From: Nathaniel Wesley Filardo Date: Thu, 26 Dec 2019 18:16:32 +0000 Subject: [PATCH 01/11] mispec: don't use %f The additional reporting, while nice, prevents the use of mispec on integer-only builds --- lua_tests/mispec.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lua_tests/mispec.lua b/lua_tests/mispec.lua index 9025f5bdf9..13dc1c070d 100644 --- a/lua_tests/mispec.lua +++ b/lua_tests/mispec.lua @@ -117,8 +117,8 @@ M.runNextPending = function() M.succeeded = M.total - M.failed local elapsedSeconds = (tmr.now() - M.startTime) / 1000 / 1000 print(string.format( - '\n\nCompleted in %.2f seconds.\nSuccess rate is %.1f%% (%d failed out of %d).', - elapsedSeconds, 100 * M.succeeded / M.total, M.failed, M.total)) + '\n\nCompleted in %d seconds; %d failed out of %d.', + elapsedSeconds, M.failed, M.total)) M.pending = nil M.queuedEventuallyCount = nil end From 1c8dd6af559acd1ce2cb1a24b1dc75f3f9fbfc08 Mon Sep 17 00:00:00 2001 From: Nathaniel Wesley Filardo Date: Thu, 26 Dec 2019 18:17:12 +0000 Subject: [PATCH 02/11] mispec: don't use uart.write Prefer print everywhere. --- lua_tests/mispec.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua_tests/mispec.lua b/lua_tests/mispec.lua index 13dc1c070d..ca143d15d9 100644 --- a/lua_tests/mispec.lua +++ b/lua_tests/mispec.lua @@ -133,7 +133,7 @@ M.run = function() local it = {} it.should = function(_, desc, func) table.insert(M.pending, function() - uart.write(0, '\n * ' .. desc) + print('\n * ' .. desc) M.total = M.total + 1 if M.pre then M.pre() end local status, err = pcall(func) From fe9f2d6aff6f18946d2864a1b2395732619f69a8 Mon Sep 17 00:00:00 2001 From: Nathaniel Wesley Filardo Date: Tue, 7 Apr 2020 17:39:39 +0100 Subject: [PATCH 03/11] mqtt: remove dead store --- app/modules/mqtt.c | 1 - 1 file changed, 1 deletion(-) diff --git a/app/modules/mqtt.c b/app/modules/mqtt.c index 0d6766999b..f3582a4ca9 100644 --- a/app/modules/mqtt.c +++ b/app/modules/mqtt.c @@ -1208,7 +1208,6 @@ static int mqtt_socket_connect( lua_State* L ) lua_pushvalue(L, stack); // copy argument (func) to the top of stack luaL_unref(L, LUA_REGISTRYINDEX, mud->cb_connect_fail_ref); mud->cb_connect_fail_ref = luaL_ref(L, LUA_REGISTRYINDEX); - stack++; } lua_pushvalue(L, 1); // copy userdata to the top of stack From 0daef0a82a3fd93eebd0f6b6fa3336c54750bf66 Mon Sep 17 00:00:00 2001 From: Nathaniel Wesley Filardo Date: Tue, 7 Apr 2020 17:40:01 +0100 Subject: [PATCH 04/11] net: annotate deliberate case fallthrough --- app/modules/net.c | 1 + 1 file changed, 1 insertion(+) diff --git a/app/modules/net.c b/app/modules/net.c index 3286a1388e..1f8ab00c06 100644 --- a/app/modules/net.c +++ b/app/modules/net.c @@ -110,6 +110,7 @@ lnet_userdata *net_create( lua_State *L, enum net_type type ) { ud->client.cb_reconnect_ref = LUA_NOREF; ud->client.cb_disconnect_ref = LUA_NOREF; ud->client.hold = 0; + /* FALLTHROUGH */ case TYPE_UDP_SOCKET: ud->client.wait_dns = 0; ud->client.cb_dns_ref = LUA_NOREF; From 132dccda0dc71c2691e90223b3c1cf6070af94b4 Mon Sep 17 00:00:00 2001 From: Nathaniel Wesley Filardo Date: Sun, 5 Apr 2020 23:57:30 +0100 Subject: [PATCH 05/11] lua_examples/lfs/HTTP_OTA: move :connect() after :on() IMHO, it's generally good style to register the callbacks first. --- lua_examples/lfs/HTTP_OTA.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lua_examples/lfs/HTTP_OTA.lua b/lua_examples/lfs/HTTP_OTA.lua index 513771b38e..8722dbb418 100644 --- a/lua_examples/lfs/HTTP_OTA.lua +++ b/lua_examples/lfs/HTTP_OTA.lua @@ -12,8 +12,7 @@ local n, total, size = 0, 0 doRequest = function(socket, hostIP) -- luacheck: no unused if hostIP then - local con = net.createConnection(net.TCP,0) - con:connect(80,hostIP) + local con = tls.createConnection(net.TCP,0) -- Note that the current dev version can only accept uncompressed LFS images con:on("connection",function(sck) local request = table.concat( { @@ -28,6 +27,7 @@ doRequest = function(socket, hostIP) -- luacheck: no unused sck:send(request) sck:on("receive",firstRec) end) + con:connect(80,hostIP) end end From c79ba4ec759062045f6443fcace8d7bc5488ea39 Mon Sep 17 00:00:00 2001 From: Nathaniel Wesley Filardo Date: Fri, 14 Feb 2020 09:10:25 +0000 Subject: [PATCH 06/11] file: raise error on .on() with non-function/nil Seems more polite than quietly accepting other types as nil. --- app/modules/file.c | 12 +++++++++--- docs/modules/file.md | 2 +- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/app/modules/file.c b/app/modules/file.c index db717076da..b5f14292e3 100644 --- a/app/modules/file.c +++ b/app/modules/file.c @@ -88,15 +88,21 @@ static int file_on(lua_State *L) case ON_RTC: luaL_unref(L, LUA_REGISTRYINDEX, rtc_cb_ref); - if ((lua_type(L, 2) == LUA_TFUNCTION) || - (lua_type(L, 2) == LUA_TLIGHTFUNCTION)) { + switch(lua_type(L, 2)) { + case LUA_TFUNCTION: + case LUA_TLIGHTFUNCTION: lua_pushvalue(L, 2); // copy argument (func) to the top of stack rtc_cb_ref = luaL_ref(L, LUA_REGISTRYINDEX); vfs_register_rtc_cb(file_rtc_cb); - } else { + break; + case LUA_TNIL: rtc_cb_ref = LUA_NOREF; vfs_register_rtc_cb(NULL); + break; + default: + luaL_error(L, "Callback should be function or nil"); } + break; default: break; diff --git a/docs/modules/file.md b/docs/modules/file.md index 75ecc2ef15..4426e9795d 100644 --- a/docs/modules/file.md +++ b/docs/modules/file.md @@ -222,7 +222,7 @@ Trigger events are: #### Parameters - `event` string -- `function()` callback function. Unregisters the callback if `function()` is omitted. +- `function()` callback function. Unregisters the callback if `function()` is omitted or `nil`. #### Returns `nil` From 810d60dc25176313e2793cef464243fe310db407 Mon Sep 17 00:00:00 2001 From: Nathaniel Wesley Filardo Date: Sun, 5 Apr 2020 01:25:57 +0100 Subject: [PATCH 07/11] mqtt: drop LUA_GCSTOP/GCRESTART dance --- app/modules/mqtt.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/app/modules/mqtt.c b/app/modules/mqtt.c index f3582a4ca9..f38c124adf 100644 --- a/app/modules/mqtt.c +++ b/app/modules/mqtt.c @@ -1037,10 +1037,11 @@ static int mqtt_delete( lua_State* L ) mud->cb_unsuback_ref = LUA_NOREF; luaL_unref(L, LUA_REGISTRYINDEX, mud->cb_puback_ref); mud->cb_puback_ref = LUA_NOREF; - lua_gc(L, LUA_GCSTOP, 0); - luaL_unref(L, LUA_REGISTRYINDEX, mud->self_ref); + + int selfref = mud->self_ref; mud->self_ref = LUA_NOREF; - lua_gc(L, LUA_GCRESTART, 0); + luaL_unref(L, LUA_REGISTRYINDEX, mud->self_ref); + NODE_DBG("leave mqtt_delete.\n"); return 0; } From 627bd5d4ffba96e89f71373f9b10cd9e333476c3 Mon Sep 17 00:00:00 2001 From: Nathaniel Wesley Filardo Date: Sun, 5 Apr 2020 01:26:27 +0100 Subject: [PATCH 08/11] net: drop LUA_GCSTOP/GCRESTART dance --- app/modules/net.c | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/app/modules/net.c b/app/modules/net.c index 1f8ab00c06..71ff1aa2f7 100644 --- a/app/modules/net.c +++ b/app/modules/net.c @@ -142,10 +142,9 @@ static void net_err_cb(void *arg, err_t err) { lua_call(L, 2, 0); } if (ud->client.wait_dns == 0) { - lua_gc(L, LUA_GCSTOP, 0); - luaL_unref(L, LUA_REGISTRYINDEX, ud->self_ref); + int selfref = ud->self_ref; ud->self_ref = LUA_NOREF; - lua_gc(L, LUA_GCRESTART, 0); + luaL_unref(L, LUA_REGISTRYINDEX, selfref); } } @@ -189,10 +188,9 @@ static void net_dns_cb(const char *name, ip_addr_t *ipaddr, void *arg) { if (ud->pcb && ud->type == TYPE_TCP_CLIENT && ud->tcp_pcb->state == CLOSED) { tcp_connect(ud->tcp_pcb, &addr, ud->tcp_pcb->remote_port, net_connected_cb); } else if (!ud->pcb && ud->client.wait_dns == 0) { - lua_gc(L, LUA_GCSTOP, 0); - luaL_unref(L, LUA_REGISTRYINDEX, ud->self_ref); + int selfref = ud->self_ref; ud->self_ref = LUA_NOREF; - lua_gc(L, LUA_GCRESTART, 0); + luaL_unref(L, LUA_REGISTRYINDEX, selfref); } } @@ -742,10 +740,10 @@ int net_close( lua_State *L ) { } if (ud->type == TYPE_TCP_SERVER || (ud->pcb == NULL && ud->client.wait_dns == 0)) { -// lua_gc(L, LUA_GCSTOP, 0); - luaL_unref(L, LUA_REGISTRYINDEX, ud->self_ref); + + int selfref = ud->self_ref; ud->self_ref = LUA_NOREF; -// lua_gc(L, LUA_GCRESTART, 0); + luaL_unref(L, LUA_REGISTRYINDEX, selfref); } #if 0 dbg_print_ud("close exit", ud); @@ -794,10 +792,10 @@ int net_delete( lua_State *L ) { ud->server.cb_accept_ref = LUA_NOREF; break; } -// lua_gc(L, LUA_GCSTOP, 0); - luaL_unref(L, LUA_REGISTRYINDEX, ud->self_ref); + + int selfref = ud->self_ref; ud->self_ref = LUA_NOREF; -// lua_gc(L, LUA_GCRESTART, 0); + luaL_unref(L, LUA_REGISTRYINDEX, selfref); #if 0 dbg_print_ud("delete end", ud); #endif From 766ab59df7e7a84bfb84346fa0baa9c5a303bb35 Mon Sep 17 00:00:00 2001 From: Nathaniel Wesley Filardo Date: Mon, 6 Apr 2020 12:19:38 +0100 Subject: [PATCH 09/11] net.dns: don't calloc a single int Removes yet another unchecked allocation point in our C libraries. While here, fix potential reference leaks on error paths Also while here, remove some stale documentation. There can be as many DNS requests in flight as LwIP has room for in its table (DNS_TABLE_SIZE, which defaults to 4). --- app/modules/net.c | 35 ++++++++++++++++++++--------------- docs/modules/net.md | 7 +------ 2 files changed, 21 insertions(+), 21 deletions(-) diff --git a/app/modules/net.c b/app/modules/net.c index 71ff1aa2f7..64775354ac 100644 --- a/app/modules/net.c +++ b/app/modules/net.c @@ -857,12 +857,19 @@ static void net_dns_static_cb(const char *name, ip_addr_t *ipaddr, void *callbac if (ipaddr != NULL) addr = *ipaddr; else addr.addr = 0xFFFFFFFF; - int cb_ref = ((int*)callback_arg)[0]; - free(callback_arg); + int cb_ref = (int)callback_arg; lua_State *L = lua_getstate(); + /* + * Move reference from registry to stack before the call could possibly + * longjmp us out of here. + */ lua_rawgeti(L, LUA_REGISTRYINDEX, cb_ref); + luaL_unref(L, LUA_REGISTRYINDEX, cb_ref); + + // XXX I have no idea why the API insists on a `nil` here, but it does. lua_pushnil(L); + if (addr.addr != 0xFFFFFFFF) { char iptmp[20]; size_t ipl = sprintf(iptmp, IPSTR, IP2STR(&addr.addr)); @@ -871,8 +878,6 @@ static void net_dns_static_cb(const char *name, ip_addr_t *ipaddr, void *callbac lua_pushnil(L); } lua_call(L, 2, 0); - - luaL_unref(L, LUA_REGISTRYINDEX, cb_ref); } // Lua: net.dns.resolve( domain, function(sk, ip) ) @@ -883,25 +888,25 @@ static int net_dns_static( lua_State* L ) { return luaL_error(L, "wrong domain"); } + /* Register callback with registry */ luaL_checkanyfunction(L, 2); - lua_pushvalue(L, 2); // copy argument (func) to the top of stack + lua_pushvalue(L, 2); int cbref = luaL_ref(L, LUA_REGISTRYINDEX); - if (cbref == LUA_NOREF) { - return luaL_error(L, "wrong callback"); - } - int *cbref_ptr = calloc(1, sizeof(int)); - cbref_ptr[0] = cbref; ip_addr_t addr; - err_t err = dns_gethostbyname(domain, &addr, net_dns_static_cb, cbref_ptr); + + _Static_assert(sizeof(void *) >= sizeof(typeof(cbref)), + "Can't upcast int to ptr"); + + err_t err = dns_gethostbyname(domain, &addr, net_dns_static_cb, (void *)cbref); if (err == ERR_OK) { - net_dns_static_cb(domain, &addr, cbref_ptr); + net_dns_static_cb(domain, &addr, (void *)cbref); return 0; } else if (err == ERR_INPROGRESS) { return 0; } else { - int e = lwip_lua_checkerr(L, err); - free(cbref_ptr); - return e; + /* Bail out! Unhook callback from registry, first */ + luaL_unref(L, LUA_REGISTRYINDEX, cbref); + return lwip_lua_checkerr(L, err); } return 0; } diff --git a/docs/modules/net.md b/docs/modules/net.md index 751abc8b3d..f6d6901f05 100644 --- a/docs/modules/net.md +++ b/docs/modules/net.md @@ -597,13 +597,8 @@ Resolve a hostname to an IP address. Doesn't require a socket like [`net.socket. - `host` hostname to resolve - `function(sk, ip)` callback called when the name was resolved. `sk` is always `nil` -There is at most one callback for all `net.dns.resolve()` requests at any time; -all resolution results are sent to the most recent callback specified at time -of receipt! If multiple DNS callbacks are needed, associate them with separate -sockets using [`net.socket:dns()`](#netsocketdns). - #### Returns -`nil` +`nil` but may raise errors for severe network stack issues (e.g., out of DNS query table slots) #### Example ```lua From bd7695f574792275c8fb0e1737b989d81419f33a Mon Sep 17 00:00:00 2001 From: Nathaniel Wesley Filardo Date: Tue, 7 Apr 2020 14:46:20 +0100 Subject: [PATCH 10/11] tls: fix new verification API Because the old API was inactive, we were setting MBEDTLS_SSL_VERIFY_NONE even after we'd parsed the certificate. tls tests now include a deliberate certificate mismatch; this was discovered by moving the mqtt tests over to the new API. --- app/mbedtls/app/espconn_mbedtls.c | 84 +++++++++++++++++++------------ 1 file changed, 53 insertions(+), 31 deletions(-) diff --git a/app/mbedtls/app/espconn_mbedtls.c b/app/mbedtls/app/espconn_mbedtls.c index b5da2531b5..82beaec9e6 100644 --- a/app/mbedtls/app/espconn_mbedtls.c +++ b/app/mbedtls/app/espconn_mbedtls.c @@ -458,17 +458,12 @@ espconn_mbedtls_parse(mbedtls_msg *msg, mbedtls_auth_type auth_type, const uint8 switch (auth_type) { case ESPCONN_CERT_AUTH: ret = mbedtls_x509_crt_parse(&msg->psession->cacert, buf, len); - lwIP_REQUIRE_NOERROR(ret, exit); - mbedtls_ssl_conf_authmode(&msg->conf, MBEDTLS_SSL_VERIFY_REQUIRED); - mbedtls_ssl_conf_ca_chain(&msg->conf, &msg->psession->cacert, NULL); break; case ESPCONN_CERT_OWN: ret = mbedtls_x509_crt_parse(&msg->psession->clicert, buf, len); break; case ESPCONN_PK: ret = mbedtls_pk_parse_key(&msg->psession->pkey, buf, len, NULL, 0); - lwIP_REQUIRE_NOERROR(ret, exit); - ret = mbedtls_ssl_conf_own_cert(&msg->conf, &msg->psession->clicert, &msg->psession->pkey); break; default: return false; @@ -509,8 +504,9 @@ nodemcu_tls_cert_get(mbedtls_msg *msg, mbedtls_auth_type auth_type) return 0; } - if (cbref == LUA_NOREF) + if (cbref == LUA_NOREF) { return 0; + } lua_State *L = lua_getstate(); @@ -522,8 +518,8 @@ nodemcu_tls_cert_get(mbedtls_msg *msg, mbedtls_auth_type auth_type) lua_pop(L, 1); /* pcall will have pushed an error message */ return -1; } - if (lua_isnil(L, -1)) { - /* nil return; stop iteration */ + if (lua_isnil(L, -1) || (lua_isboolean(L,-1) && lua_toboolean(L,-1) == false)) { + /* nil or false return; stop iteration */ lua_pop(L, 1); break; } @@ -562,14 +558,6 @@ static bool mbedtls_msg_info_load(mbedtls_msg *msg, mbedtls_auth_type auth_type) size_t load_len = 0; file_param file_param; - /* Override with Lua callbacks, if registered */ - switch(nodemcu_tls_cert_get(msg, auth_type)) { - case -1: - return false; - case 1: - return true; - } - bzero(&file_param, sizeof(file_param)); again: @@ -629,41 +617,75 @@ static bool mbedtls_msg_config(mbedtls_msg *msg) bool load_flag = false; int ret = ESPCONN_OK; + /* Load upstream default configs */ + ret = mbedtls_ssl_config_defaults(&msg->conf, MBEDTLS_SSL_IS_CLIENT, MBEDTLS_SSL_TRANSPORT_STREAM, MBEDTLS_SSL_PRESET_DEFAULT); + lwIP_REQUIRE_NOERROR(ret, exit); + + ret = mbedtls_ssl_setup(&msg->ssl, &msg->conf); + lwIP_REQUIRE_NOERROR(ret, exit); + /*Initialize the RNG and the session data*/ ret = mbedtls_ctr_drbg_seed(&msg->ctr_drbg, mbedtls_entropy_func, &msg->entropy, "client", 6); lwIP_REQUIRE_NOERROR(ret, exit); /*Load the certificate and private RSA key*/ - if (ssl_client_options.cert_req_sector.flag - || (ssl_client_options.cert_auth_callback != LUA_NOREF)) { - + ret = 0; + if (ssl_client_options.cert_auth_callback != LUA_NOREF) { + ret = nodemcu_tls_cert_get(msg, ESPCONN_PK); + switch(ret) { + case 0: break; + case -1: ret = ESPCONN_ABRT; goto exit; + case 1: switch(nodemcu_tls_cert_get(msg, ESPCONN_CERT_OWN)) { + case -1: ret = ESPCONN_ABRT; goto exit; + case 0: break; + case 1: + ret = mbedtls_ssl_conf_own_cert(&msg->conf, &msg->psession->clicert, &msg->psession->pkey); + lwIP_REQUIRE_ACTION(ret == 0, exit, ret = ESPCONN_ABRT); + } + } + } + if (ret == 0 && ssl_client_options.cert_req_sector.flag) { load_flag = mbedtls_msg_info_load(msg, ESPCONN_CERT_OWN); lwIP_REQUIRE_ACTION(load_flag, exit, ret = ESPCONN_MEM); load_flag = mbedtls_msg_info_load(msg, ESPCONN_PK); lwIP_REQUIRE_ACTION(load_flag, exit, ret = ESPCONN_MEM); + ret = mbedtls_ssl_conf_own_cert(&msg->conf, &msg->psession->clicert, &msg->psession->pkey); + lwIP_REQUIRE_ACTION(ret == 0, exit, ret = ESPCONN_ABRT); } + ret = 0; + /*Load the trusted CA*/ - if(ssl_client_options.cert_ca_sector.flag - || (ssl_client_options.cert_verify_callback != LUA_NOREF)) { + + if (ssl_client_options.cert_verify_callback != LUA_NOREF) { + ret = nodemcu_tls_cert_get(msg, ESPCONN_CERT_AUTH); + switch(ret) { + case 0: break; + case -1: ret = ESPCONN_ABRT; goto exit; + case 1: + mbedtls_ssl_conf_authmode(&msg->conf, MBEDTLS_SSL_VERIFY_REQUIRED); + mbedtls_ssl_conf_ca_chain(&msg->conf, &msg->psession->cacert, NULL); + break; + } + } + if(ret == 0 && ssl_client_options.cert_ca_sector.flag) { load_flag = mbedtls_msg_info_load(msg, ESPCONN_CERT_AUTH); lwIP_REQUIRE_ACTION(load_flag, exit, ret = ESPCONN_MEM); + mbedtls_ssl_conf_authmode(&msg->conf, MBEDTLS_SSL_VERIFY_REQUIRED); + mbedtls_ssl_conf_ca_chain(&msg->conf, &msg->psession->cacert, NULL); + } else if (ret == 0) { + /* + * OPTIONAL is not optimal for security, but makes interop easier in this session + * This gets overridden below if appropriate. + */ + mbedtls_ssl_conf_authmode(&msg->conf, MBEDTLS_SSL_VERIFY_NONE); } - /*Setup the stuff*/ - ret = mbedtls_ssl_config_defaults(&msg->conf, MBEDTLS_SSL_IS_CLIENT, MBEDTLS_SSL_TRANSPORT_STREAM, MBEDTLS_SSL_PRESET_DEFAULT); - lwIP_REQUIRE_NOERROR(ret, exit); + ret = 0; - /*OPTIONAL is not optimal for security, but makes interop easier in this session*/ - if (ssl_client_options.cert_ca_sector.flag == false) { - mbedtls_ssl_conf_authmode(&msg->conf, MBEDTLS_SSL_VERIFY_NONE); - } mbedtls_ssl_conf_rng(&msg->conf, mbedtls_ctr_drbg_random, &msg->ctr_drbg); mbedtls_ssl_conf_dbg(&msg->conf, mbedtls_dbg, NULL); - ret = mbedtls_ssl_setup(&msg->ssl, &msg->conf); - lwIP_REQUIRE_NOERROR(ret, exit); - mbedtls_ssl_set_bio(&msg->ssl, &msg->fd, mbedtls_net_send, mbedtls_net_recv, NULL); exit: From 04ab7d7f4edf95a4b39d54cf56c59bc688c5af92 Mon Sep 17 00:00:00 2001 From: Nathaniel Wesley Filardo Date: Tue, 7 Apr 2020 18:45:47 +0100 Subject: [PATCH 11/11] app/modules: prune some unnecessary metamethods --- app/modules/mqtt.c | 1 - app/modules/net.c | 1 - app/modules/tls.c | 2 -- app/modules/wifi.c | 2 -- 4 files changed, 6 deletions(-) diff --git a/app/modules/mqtt.c b/app/modules/mqtt.c index f38c124adf..41965f46c8 100644 --- a/app/modules/mqtt.c +++ b/app/modules/mqtt.c @@ -1758,7 +1758,6 @@ LROT_BEGIN(mqtt) LROT_NUMENTRY( CONNACK_REFUSED_BAD_USER_OR_PASS, MQTT_CONNACK_REFUSED_BAD_USER_OR_PASS ) LROT_NUMENTRY( CONNACK_REFUSED_NOT_AUTHORIZED, MQTT_CONNACK_REFUSED_NOT_AUTHORIZED ) - LROT_TABENTRY( __metatable, mqtt ) LROT_END( mqtt, mqtt, 0 ) diff --git a/app/modules/net.c b/app/modules/net.c index 64775354ac..17779eb04c 100644 --- a/app/modules/net.c +++ b/app/modules/net.c @@ -1064,7 +1064,6 @@ LROT_BEGIN(net) LROT_FUNCENTRY( multicastJoin, net_multicastJoin ) LROT_FUNCENTRY( multicastLeave, net_multicastLeave ) LROT_TABENTRY( dns, net_dns ) - LROT_TABENTRY( __metatable, net ) LROT_END( net, net, 0 ) diff --git a/app/modules/tls.c b/app/modules/tls.c index affe33d375..acd64ba86b 100644 --- a/app/modules/tls.c +++ b/app/modules/tls.c @@ -641,7 +641,6 @@ LROT_END( tls_socket, tls_socket, 0 ) LROT_PUBLIC_BEGIN(tls_cert) LROT_FUNCENTRY( verify, tls_cert_verify ) LROT_FUNCENTRY( auth, tls_cert_auth ) - LROT_TABENTRY( __index, tls_cert ) LROT_END( tls_cert, tls_cert, 0 ) @@ -651,7 +650,6 @@ LROT_BEGIN(tls) LROT_FUNCENTRY( setDebug, tls_set_debug_threshold ) #endif LROT_TABENTRY( cert, tls_cert ) - LROT_TABENTRY( __metatable, tls ) LROT_END( tls, tls, 0 ) diff --git a/app/modules/wifi.c b/app/modules/wifi.c index 27ec988e16..b3af00324d 100644 --- a/app/modules/wifi.c +++ b/app/modules/wifi.c @@ -1909,7 +1909,6 @@ LROT_BEGIN(wifi_ap) LROT_FUNCENTRY( getconfig, wifi_ap_getconfig_current ) LROT_FUNCENTRY( getdefaultconfig, wifi_ap_getconfig_default ) LROT_TABENTRY( dhcp, wifi_ap_dhcp ) -// LROT_TABENTRY( __metatable, wifi_ap ) LROT_END( wifi_ap, wifi_ap, 0 ) @@ -1969,7 +1968,6 @@ LROT_BEGIN(wifi) LROT_NUMENTRY( COUNTRY_AUTO, WIFI_COUNTRY_POLICY_AUTO ) LROT_NUMENTRY( COUNTRY_MANUAL, WIFI_COUNTRY_POLICY_MANUAL ) - LROT_TABENTRY( __metatable, wifi ) LROT_END( wifi, wifi, 0 )