From 3354e2acbfcff1fdf45ad19e68ddceeb6dcd5af8 Mon Sep 17 00:00:00 2001 From: s-hadinger <49731213+s-hadinger@users.noreply.github.com> Date: Mon, 10 Apr 2023 16:20:11 +0200 Subject: [PATCH] Matter log unknown opcodes (#18379) --- .../src/embedded/Matter_Commissioning.be | 36 +- .../src/embedded/Matter_Session.be | 15 +- .../solidified_Matter_Commissioning.h | 1441 +++++---- .../src/solidify/solidified_Matter_Session.h | 2686 +++++++++-------- .../src/solidify/solidified_Matter_UI.h | 60 +- .../xdrv_52_3_berry_crypto.ino | 4 +- 6 files changed, 2235 insertions(+), 2007 deletions(-) diff --git a/lib/libesp32/berry_matter/src/embedded/Matter_Commissioning.be b/lib/libesp32/berry_matter/src/embedded/Matter_Commissioning.be index 1d9e01b7f..9fee61fb3 100644 --- a/lib/libesp32/berry_matter/src/embedded/Matter_Commissioning.be +++ b/lib/libesp32/berry_matter/src/embedded/Matter_Commissioning.be @@ -77,7 +77,11 @@ class Matter_Commisioning_Context end tasmota.log("MTR: received message " + matter.inspect(msg), 3) - if msg.opcode == 0x20 + if msg.opcode == 0x10 + return self.parse_MsgCounterSyncReq(msg) + elif msg.opcode == 0x11 + return self.parse_MsgCounterSyncRsp(msg) + elif msg.opcode == 0x20 return self.parse_PBKDFParamRequest(msg) elif msg.opcode == 0x22 return self.parse_Pake1(msg) @@ -89,6 +93,10 @@ class Matter_Commisioning_Context return self.parse_Sigma3(msg) elif msg.opcode == 0x40 return self.parse_StatusReport(msg) + else + import string + tasmota.log(string.format("MTR: >????????? Unknown OpCode (secure channel) %02X", msg.opcode), 2) + return false end return false @@ -679,9 +687,33 @@ class Matter_Commisioning_Context return true end + ############################################################# + # placeholder, nothing to run for now def parse_StatusReport(msg) var session = msg.session - tasmota.log("MTR: StatusReport = "+msg.raw[msg.app_payload_idx..].tohex(), 2) + tasmota.log("MTR: >Status "+msg.raw[msg.app_payload_idx..].tohex(), 2) + return false # we don't explicitly ack the message + end + + ############################################################# + # MsgCounterSyncReq + # + # Not yet implemented + def parse_MsgCounterSyncReq(msg) + import string + var session = msg.session + tasmota.log(string.format("MTR: >????????? MsgCounterSyncReq not implemented %s", msg.raw[msg.app_payload_idx..].tohex()), 2) + return false # we don't explicitly ack the message + end + + ############################################################# + # MsgCounterSyncRsp + # + # Not yet implemented + def parse_MsgCounterSyncRsp(msg) + import string + var session = msg.session + tasmota.log(string.format("MTR: >????????? MsgCounterSyncRsp not implemented %s", msg.raw[msg.app_payload_idx..].tohex()), 2) return false # we don't explicitly ack the message end diff --git a/lib/libesp32/berry_matter/src/embedded/Matter_Session.be b/lib/libesp32/berry_matter/src/embedded/Matter_Session.be index 23dfd8321..d1ade5824 100644 --- a/lib/libesp32/berry_matter/src/embedded/Matter_Session.be +++ b/lib/libesp32/berry_matter/src/embedded/Matter_Session.be @@ -375,13 +375,19 @@ class Matter_Session : Matter_Expirable def is_CASE() return self.mode == self._CASE end ############################################################# - # Register the frabric as complete (end of commissioning) - def fabric_completed() - self._fabric.set_no_expiration() - self._fabric.set_persist(true) + # Assign a new fabric index + def assign_fabric_index() if (self._fabric.get_fabric_index() == nil) self._fabric.set_fabric_index(self._store.next_fabric_idx()) end + end + + ############################################################# + # Register the fabric as complete (end of commissioning) + def fabric_completed() + self._fabric.set_no_expiration() + self._fabric.set_persist(true) + self.assign_fabric_index() self._store.add_fabric(self._fabric) end @@ -389,6 +395,7 @@ class Matter_Session : Matter_Expirable # Register the frabric as complete (end of commissioning) def fabric_candidate() self._fabric.set_expire_in_seconds(120) # expire in 2 minutes + self.assign_fabric_index() self._store.add_fabric(self._fabric) end diff --git a/lib/libesp32/berry_matter/src/solidify/solidified_Matter_Commissioning.h b/lib/libesp32/berry_matter/src/solidify/solidified_Matter_Commissioning.h index 1a7f0a1d6..61d12fe9b 100644 --- a/lib/libesp32/berry_matter/src/solidify/solidified_Matter_Commissioning.h +++ b/lib/libesp32/berry_matter/src/solidify/solidified_Matter_Commissioning.h @@ -6,6 +6,165 @@ extern const bclass be_class_Matter_Commisioning_Context; +/******************************************************************** +** Solidified function: process_incoming +********************************************************************/ +be_local_closure(Matter_Commisioning_Context_process_incoming, /* name */ + be_nested_proto( + 9, /* nstack */ + 2, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[22]) { /* constants */ + /* K0 */ be_nested_str_weak(device), + /* K1 */ be_nested_str_weak(is_commissioning_open), + /* K2 */ be_nested_str_weak(opcode), + /* K3 */ be_nested_str_weak(tasmota), + /* K4 */ be_nested_str_weak(log), + /* K5 */ be_nested_str_weak(MTR_X3A_X20commissioning_X20not_X20open), + /* K6 */ be_const_int(2), + /* K7 */ be_nested_str_weak(MTR_X3A_X20received_X20message_X20), + /* K8 */ be_nested_str_weak(matter), + /* K9 */ be_nested_str_weak(inspect), + /* K10 */ be_const_int(3), + /* K11 */ be_nested_str_weak(parse_MsgCounterSyncReq), + /* K12 */ be_nested_str_weak(parse_MsgCounterSyncRsp), + /* K13 */ be_nested_str_weak(parse_PBKDFParamRequest), + /* K14 */ be_nested_str_weak(parse_Pake1), + /* K15 */ be_nested_str_weak(parse_Pake3), + /* K16 */ be_nested_str_weak(parse_Sigma1), + /* K17 */ be_nested_str_weak(parse_Sigma3), + /* K18 */ be_nested_str_weak(parse_StatusReport), + /* K19 */ be_nested_str_weak(string), + /* K20 */ be_nested_str_weak(format), + /* K21 */ be_nested_str_weak(MTR_X3A_X20_X3E_X3F_X3F_X3F_X3F_X3F_X3F_X3F_X3F_X3F_X20Unknown_X20OpCode_X20_X28secure_X20channel_X29_X20_X2502X), + }), + be_str_weak(process_incoming), + &be_const_str_solidified, + ( &(const binstruction[113]) { /* code */ + 0x88080100, // 0000 GETMBR R2 R0 K0 + 0x8C080501, // 0001 GETMET R2 R2 K1 + 0x7C080200, // 0002 CALL R2 1 + 0x740A000E, // 0003 JMPT R2 #0013 + 0x88080302, // 0004 GETMBR R2 R1 K2 + 0x540E001F, // 0005 LDINT R3 32 + 0x28080403, // 0006 GE R2 R2 R3 + 0x780A000A, // 0007 JMPF R2 #0013 + 0x88080302, // 0008 GETMBR R2 R1 K2 + 0x540E0023, // 0009 LDINT R3 36 + 0x18080403, // 000A LE R2 R2 R3 + 0x780A0006, // 000B JMPF R2 #0013 + 0xB80A0600, // 000C GETNGBL R2 K3 + 0x8C080504, // 000D GETMET R2 R2 K4 + 0x58100005, // 000E LDCONST R4 K5 + 0x58140006, // 000F LDCONST R5 K6 + 0x7C080600, // 0010 CALL R2 3 + 0x50080000, // 0011 LDBOOL R2 0 0 + 0x80040400, // 0012 RET 1 R2 + 0xB80A0600, // 0013 GETNGBL R2 K3 + 0x8C080504, // 0014 GETMET R2 R2 K4 + 0xB8121000, // 0015 GETNGBL R4 K8 + 0x8C100909, // 0016 GETMET R4 R4 K9 + 0x5C180200, // 0017 MOVE R6 R1 + 0x7C100400, // 0018 CALL R4 2 + 0x00120E04, // 0019 ADD R4 K7 R4 + 0x5814000A, // 001A LDCONST R5 K10 + 0x7C080600, // 001B CALL R2 3 + 0x88080302, // 001C GETMBR R2 R1 K2 + 0x540E000F, // 001D LDINT R3 16 + 0x1C080403, // 001E EQ R2 R2 R3 + 0x780A0004, // 001F JMPF R2 #0025 + 0x8C08010B, // 0020 GETMET R2 R0 K11 + 0x5C100200, // 0021 MOVE R4 R1 + 0x7C080400, // 0022 CALL R2 2 + 0x80040400, // 0023 RET 1 R2 + 0x70020049, // 0024 JMP #006F + 0x88080302, // 0025 GETMBR R2 R1 K2 + 0x540E0010, // 0026 LDINT R3 17 + 0x1C080403, // 0027 EQ R2 R2 R3 + 0x780A0004, // 0028 JMPF R2 #002E + 0x8C08010C, // 0029 GETMET R2 R0 K12 + 0x5C100200, // 002A MOVE R4 R1 + 0x7C080400, // 002B CALL R2 2 + 0x80040400, // 002C RET 1 R2 + 0x70020040, // 002D JMP #006F + 0x88080302, // 002E GETMBR R2 R1 K2 + 0x540E001F, // 002F LDINT R3 32 + 0x1C080403, // 0030 EQ R2 R2 R3 + 0x780A0004, // 0031 JMPF R2 #0037 + 0x8C08010D, // 0032 GETMET R2 R0 K13 + 0x5C100200, // 0033 MOVE R4 R1 + 0x7C080400, // 0034 CALL R2 2 + 0x80040400, // 0035 RET 1 R2 + 0x70020037, // 0036 JMP #006F + 0x88080302, // 0037 GETMBR R2 R1 K2 + 0x540E0021, // 0038 LDINT R3 34 + 0x1C080403, // 0039 EQ R2 R2 R3 + 0x780A0004, // 003A JMPF R2 #0040 + 0x8C08010E, // 003B GETMET R2 R0 K14 + 0x5C100200, // 003C MOVE R4 R1 + 0x7C080400, // 003D CALL R2 2 + 0x80040400, // 003E RET 1 R2 + 0x7002002E, // 003F JMP #006F + 0x88080302, // 0040 GETMBR R2 R1 K2 + 0x540E0023, // 0041 LDINT R3 36 + 0x1C080403, // 0042 EQ R2 R2 R3 + 0x780A0004, // 0043 JMPF R2 #0049 + 0x8C08010F, // 0044 GETMET R2 R0 K15 + 0x5C100200, // 0045 MOVE R4 R1 + 0x7C080400, // 0046 CALL R2 2 + 0x80040400, // 0047 RET 1 R2 + 0x70020025, // 0048 JMP #006F + 0x88080302, // 0049 GETMBR R2 R1 K2 + 0x540E002F, // 004A LDINT R3 48 + 0x1C080403, // 004B EQ R2 R2 R3 + 0x780A0004, // 004C JMPF R2 #0052 + 0x8C080110, // 004D GETMET R2 R0 K16 + 0x5C100200, // 004E MOVE R4 R1 + 0x7C080400, // 004F CALL R2 2 + 0x80040400, // 0050 RET 1 R2 + 0x7002001C, // 0051 JMP #006F + 0x88080302, // 0052 GETMBR R2 R1 K2 + 0x540E0031, // 0053 LDINT R3 50 + 0x1C080403, // 0054 EQ R2 R2 R3 + 0x780A0004, // 0055 JMPF R2 #005B + 0x8C080111, // 0056 GETMET R2 R0 K17 + 0x5C100200, // 0057 MOVE R4 R1 + 0x7C080400, // 0058 CALL R2 2 + 0x80040400, // 0059 RET 1 R2 + 0x70020013, // 005A JMP #006F + 0x88080302, // 005B GETMBR R2 R1 K2 + 0x540E003F, // 005C LDINT R3 64 + 0x1C080403, // 005D EQ R2 R2 R3 + 0x780A0004, // 005E JMPF R2 #0064 + 0x8C080112, // 005F GETMET R2 R0 K18 + 0x5C100200, // 0060 MOVE R4 R1 + 0x7C080400, // 0061 CALL R2 2 + 0x80040400, // 0062 RET 1 R2 + 0x7002000A, // 0063 JMP #006F + 0xA40A2600, // 0064 IMPORT R2 K19 + 0xB80E0600, // 0065 GETNGBL R3 K3 + 0x8C0C0704, // 0066 GETMET R3 R3 K4 + 0x8C140514, // 0067 GETMET R5 R2 K20 + 0x581C0015, // 0068 LDCONST R7 K21 + 0x88200302, // 0069 GETMBR R8 R1 K2 + 0x7C140600, // 006A CALL R5 3 + 0x58180006, // 006B LDCONST R6 K6 + 0x7C0C0600, // 006C CALL R3 3 + 0x500C0000, // 006D LDBOOL R3 0 0 + 0x80040600, // 006E RET 1 R3 + 0x50080000, // 006F LDBOOL R2 0 0 + 0x80040400, // 0070 RET 1 R2 + }) + ) +); +/*******************************************************************/ + + /******************************************************************** ** Solidified function: parse_PBKDFParamRequest ********************************************************************/ @@ -223,6 +382,75 @@ be_local_closure(Matter_Commisioning_Context_parse_PBKDFParamRequest, /* name /*******************************************************************/ +/******************************************************************** +** Solidified function: send_status_report +********************************************************************/ +be_local_closure(Matter_Commisioning_Context_send_status_report, /* name */ + be_nested_proto( + 16, /* nstack */ + 6, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[11]) { /* constants */ + /* K0 */ be_nested_str_weak(build_response), + /* K1 */ be_nested_str_weak(add), + /* K2 */ be_const_int(2), + /* K3 */ be_nested_str_weak(encode_frame), + /* K4 */ be_nested_str_weak(responder), + /* K5 */ be_nested_str_weak(send_response), + /* K6 */ be_nested_str_weak(remote_ip), + /* K7 */ be_nested_str_weak(remote_port), + /* K8 */ be_nested_str_weak(message_counter), + /* K9 */ be_nested_str_weak(session), + /* K10 */ be_nested_str_weak(local_session_id), + }), + be_str_weak(send_status_report), + &be_const_str_solidified, + ( &(const binstruction[34]) { /* code */ + 0x8C180300, // 0000 GETMET R6 R1 K0 + 0x5422003F, // 0001 LDINT R8 64 + 0x5C240A00, // 0002 MOVE R9 R5 + 0x7C180600, // 0003 CALL R6 3 + 0x601C0015, // 0004 GETGBL R7 G21 + 0x7C1C0000, // 0005 CALL R7 0 + 0x8C200F01, // 0006 GETMET R8 R7 K1 + 0x5C280400, // 0007 MOVE R10 R2 + 0x582C0002, // 0008 LDCONST R11 K2 + 0x7C200600, // 0009 CALL R8 3 + 0x8C200F01, // 000A GETMET R8 R7 K1 + 0x5C280600, // 000B MOVE R10 R3 + 0x542E0003, // 000C LDINT R11 4 + 0x7C200600, // 000D CALL R8 3 + 0x8C200F01, // 000E GETMET R8 R7 K1 + 0x5C280800, // 000F MOVE R10 R4 + 0x542E0003, // 0010 LDINT R11 4 + 0x7C200600, // 0011 CALL R8 3 + 0x8C200D03, // 0012 GETMET R8 R6 K3 + 0x5C280E00, // 0013 MOVE R10 R7 + 0x7C200400, // 0014 CALL R8 2 + 0x88240104, // 0015 GETMBR R9 R0 K4 + 0x8C241305, // 0016 GETMET R9 R9 K5 + 0x5C2C1000, // 0017 MOVE R11 R8 + 0x88300306, // 0018 GETMBR R12 R1 K6 + 0x88340307, // 0019 GETMBR R13 R1 K7 + 0x78160001, // 001A JMPF R5 #001D + 0x88380D08, // 001B GETMBR R14 R6 K8 + 0x70020000, // 001C JMP #001E + 0x4C380000, // 001D LDNIL R14 + 0x883C0309, // 001E GETMBR R15 R1 K9 + 0x883C1F0A, // 001F GETMBR R15 R15 K10 + 0x7C240C00, // 0020 CALL R9 6 + 0x80000000, // 0021 RET 0 + }) + ) +); +/*******************************************************************/ + + /******************************************************************** ** Solidified function: parse_Pake1 ********************************************************************/ @@ -415,171 +643,11 @@ be_local_closure(Matter_Commisioning_Context_parse_Pake1, /* name */ /******************************************************************** -** Solidified function: init +** Solidified function: parse_Pake3 ********************************************************************/ -be_local_closure(Matter_Commisioning_Context_init, /* name */ - be_nested_proto( - 6, /* nstack */ - 2, /* argc */ - 2, /* varg */ - 0, /* has upvals */ - NULL, /* no upvals */ - 0, /* has sup protos */ - NULL, /* no sub protos */ - 1, /* has constants */ - ( &(const bvalue[ 5]) { /* constants */ - /* K0 */ be_nested_str_weak(crypto), - /* K1 */ be_nested_str_weak(responder), - /* K2 */ be_nested_str_weak(device), - /* K3 */ be_nested_str_weak(y), - /* K4 */ be_nested_str_weak(random), - }), - be_str_weak(init), - &be_const_str_solidified, - ( &(const binstruction[ 9]) { /* code */ - 0xA40A0000, // 0000 IMPORT R2 K0 - 0x90020201, // 0001 SETMBR R0 K1 R1 - 0x880C0302, // 0002 GETMBR R3 R1 K2 - 0x90020403, // 0003 SETMBR R0 K2 R3 - 0x8C0C0504, // 0004 GETMET R3 R2 K4 - 0x5416001F, // 0005 LDINT R5 32 - 0x7C0C0400, // 0006 CALL R3 2 - 0x90020603, // 0007 SETMBR R0 K3 R3 - 0x80000000, // 0008 RET 0 - }) - ) -); -/*******************************************************************/ - - -/******************************************************************** -** Solidified function: find_fabric_by_destination_id -********************************************************************/ -be_local_closure(Matter_Commisioning_Context_find_fabric_by_destination_id, /* name */ +be_local_closure(Matter_Commisioning_Context_parse_Pake3, /* name */ be_nested_proto( 14, /* nstack */ - 3, /* argc */ - 2, /* varg */ - 0, /* has upvals */ - NULL, /* no upvals */ - 0, /* has sup protos */ - NULL, /* no sub protos */ - 1, /* has constants */ - ( &(const bvalue[21]) { /* constants */ - /* K0 */ be_nested_str_weak(crypto), - /* K1 */ be_nested_str_weak(tasmota), - /* K2 */ be_nested_str_weak(log), - /* K3 */ be_nested_str_weak(MTR_X3A_X20SEARCHING_X3A_X20destinationId_X3D), - /* K4 */ be_nested_str_weak(tohex), - /* K5 */ be_const_int(3), - /* K6 */ be_nested_str_weak(device), - /* K7 */ be_nested_str_weak(sessions), - /* K8 */ be_nested_str_weak(fabrics), - /* K9 */ be_nested_str_weak(noc), - /* K10 */ be_nested_str_weak(fabric_id), - /* K11 */ be_nested_str_weak(device_id), - /* K12 */ be_nested_str_weak(get_ca_pub), - /* K13 */ be_nested_str_weak(get_ipk_group_key), - /* K14 */ be_nested_str_weak(MTR_X3A_X20SIGMA1_X3A_X20destinationMessage_X3D), - /* K15 */ be_nested_str_weak(MTR_X3A_X20SIGMA1_X3A_X20key_ipk_X3D), - /* K16 */ be_nested_str_weak(HMAC_SHA256), - /* K17 */ be_nested_str_weak(update), - /* K18 */ be_nested_str_weak(out), - /* K19 */ be_nested_str_weak(MTR_X3A_X20SIGMA1_X3A_X20candidateDestinationId_X3D), - /* K20 */ be_nested_str_weak(stop_iteration), - }), - be_str_weak(find_fabric_by_destination_id), - &be_const_str_solidified, - ( &(const binstruction[77]) { /* code */ - 0xA40E0000, // 0000 IMPORT R3 K0 - 0xB8120200, // 0001 GETNGBL R4 K1 - 0x8C100902, // 0002 GETMET R4 R4 K2 - 0x8C180304, // 0003 GETMET R6 R1 K4 - 0x7C180200, // 0004 CALL R6 1 - 0x001A0606, // 0005 ADD R6 K3 R6 - 0x581C0005, // 0006 LDCONST R7 K5 - 0x7C100600, // 0007 CALL R4 3 - 0x60100010, // 0008 GETGBL R4 G16 - 0x88140106, // 0009 GETMBR R5 R0 K6 - 0x88140B07, // 000A GETMBR R5 R5 K7 - 0x88140B08, // 000B GETMBR R5 R5 K8 - 0x7C100200, // 000C CALL R4 1 - 0xA8020039, // 000D EXBLK 0 #0048 - 0x5C140800, // 000E MOVE R5 R4 - 0x7C140000, // 000F CALL R5 0 - 0x88180B09, // 0010 GETMBR R6 R5 K9 - 0x4C1C0000, // 0011 LDNIL R7 - 0x1C180C07, // 0012 EQ R6 R6 R7 - 0x741A0007, // 0013 JMPT R6 #001C - 0x88180B0A, // 0014 GETMBR R6 R5 K10 - 0x4C1C0000, // 0015 LDNIL R7 - 0x1C180C07, // 0016 EQ R6 R6 R7 - 0x741A0003, // 0017 JMPT R6 #001C - 0x88180B0B, // 0018 GETMBR R6 R5 K11 - 0x4C1C0000, // 0019 LDNIL R7 - 0x1C180C07, // 001A EQ R6 R6 R7 - 0x781A0000, // 001B JMPF R6 #001D - 0x7001FFF0, // 001C JMP #000E - 0x8C180B0C, // 001D GETMET R6 R5 K12 - 0x7C180200, // 001E CALL R6 1 - 0x00180406, // 001F ADD R6 R2 R6 - 0x881C0B0A, // 0020 GETMBR R7 R5 K10 - 0x00180C07, // 0021 ADD R6 R6 R7 - 0x881C0B0B, // 0022 GETMBR R7 R5 K11 - 0x00180C07, // 0023 ADD R6 R6 R7 - 0x8C1C0B0D, // 0024 GETMET R7 R5 K13 - 0x7C1C0200, // 0025 CALL R7 1 - 0xB8220200, // 0026 GETNGBL R8 K1 - 0x8C201102, // 0027 GETMET R8 R8 K2 - 0x8C280D04, // 0028 GETMET R10 R6 K4 - 0x7C280200, // 0029 CALL R10 1 - 0x002A1C0A, // 002A ADD R10 K14 R10 - 0x582C0005, // 002B LDCONST R11 K5 - 0x7C200600, // 002C CALL R8 3 - 0xB8220200, // 002D GETNGBL R8 K1 - 0x8C201102, // 002E GETMET R8 R8 K2 - 0x8C280F04, // 002F GETMET R10 R7 K4 - 0x7C280200, // 0030 CALL R10 1 - 0x002A1E0A, // 0031 ADD R10 K15 R10 - 0x542E0003, // 0032 LDINT R11 4 - 0x7C200600, // 0033 CALL R8 3 - 0x8C200710, // 0034 GETMET R8 R3 K16 - 0x5C280E00, // 0035 MOVE R10 R7 - 0x7C200400, // 0036 CALL R8 2 - 0x8C241111, // 0037 GETMET R9 R8 K17 - 0x5C2C0C00, // 0038 MOVE R11 R6 - 0x7C240400, // 0039 CALL R9 2 - 0x8C241112, // 003A GETMET R9 R8 K18 - 0x7C240200, // 003B CALL R9 1 - 0xB82A0200, // 003C GETNGBL R10 K1 - 0x8C281502, // 003D GETMET R10 R10 K2 - 0x8C301304, // 003E GETMET R12 R9 K4 - 0x7C300200, // 003F CALL R12 1 - 0x0032260C, // 0040 ADD R12 K19 R12 - 0x58340005, // 0041 LDCONST R13 K5 - 0x7C280600, // 0042 CALL R10 3 - 0x1C281201, // 0043 EQ R10 R9 R1 - 0x782A0001, // 0044 JMPF R10 #0047 - 0xA8040001, // 0045 EXBLK 1 1 - 0x80040A00, // 0046 RET 1 R5 - 0x7001FFC5, // 0047 JMP #000E - 0x58100014, // 0048 LDCONST R4 K20 - 0xAC100200, // 0049 CATCH R4 1 0 - 0xB0080000, // 004A RAISE 2 R0 R0 - 0x4C100000, // 004B LDNIL R4 - 0x80040800, // 004C RET 1 R4 - }) - ) -); -/*******************************************************************/ - - -/******************************************************************** -** Solidified function: process_incoming -********************************************************************/ -be_local_closure(Matter_Commisioning_Context_process_incoming, /* name */ - be_nested_proto( - 7, /* nstack */ 2, /* argc */ 2, /* varg */ 0, /* has upvals */ @@ -587,135 +655,157 @@ be_local_closure(Matter_Commisioning_Context_process_incoming, /* name */ 0, /* has sup protos */ NULL, /* no sub protos */ 1, /* has constants */ - ( &(const bvalue[17]) { /* constants */ - /* K0 */ be_nested_str_weak(device), - /* K1 */ be_nested_str_weak(is_commissioning_open), - /* K2 */ be_nested_str_weak(opcode), - /* K3 */ be_nested_str_weak(tasmota), - /* K4 */ be_nested_str_weak(log), - /* K5 */ be_nested_str_weak(MTR_X3A_X20commissioning_X20not_X20open), - /* K6 */ be_const_int(2), - /* K7 */ be_nested_str_weak(MTR_X3A_X20received_X20message_X20), - /* K8 */ be_nested_str_weak(matter), - /* K9 */ be_nested_str_weak(inspect), - /* K10 */ be_const_int(3), - /* K11 */ be_nested_str_weak(parse_PBKDFParamRequest), - /* K12 */ be_nested_str_weak(parse_Pake1), - /* K13 */ be_nested_str_weak(parse_Pake3), - /* K14 */ be_nested_str_weak(parse_Sigma1), - /* K15 */ be_nested_str_weak(parse_Sigma3), - /* K16 */ be_nested_str_weak(parse_StatusReport), + ( &(const bvalue[34]) { /* constants */ + /* K0 */ be_nested_str_weak(crypto), + /* K1 */ be_nested_str_weak(opcode), + /* K2 */ be_nested_str_weak(local_session_id), + /* K3 */ be_const_int(0), + /* K4 */ be_nested_str_weak(protocol_id), + /* K5 */ be_nested_str_weak(tasmota), + /* K6 */ be_nested_str_weak(log), + /* K7 */ be_nested_str_weak(MTR_X3A_X20invalid_X20Pake3_X20message), + /* K8 */ be_const_int(2), + /* K9 */ be_nested_str_weak(MTR_X3A_X20StatusReport_X28General_X20Code_X3A_X20FAILURE_X2C_X20ProtocolId_X3A_X20SECURE_CHANNEL_X2C_X20ProtocolCode_X3A_X20INVALID_PARAMETER_X29), + /* K10 */ be_nested_str_weak(send_status_report), + /* K11 */ be_const_int(1), + /* K12 */ be_nested_str_weak(matter), + /* K13 */ be_nested_str_weak(Pake3), + /* K14 */ be_nested_str_weak(parse), + /* K15 */ be_nested_str_weak(raw), + /* K16 */ be_nested_str_weak(app_payload_idx), + /* K17 */ be_nested_str_weak(cA), + /* K18 */ be_nested_str_weak(spake), + /* K19 */ be_nested_str_weak(MTR_X3A_X20invalid_X20cA_X20received), + /* K20 */ be_nested_str_weak(created), + /* K21 */ be_nested_str_weak(rtc), + /* K22 */ be_nested_str_weak(utc), + /* K23 */ be_nested_str_weak(HKDF_SHA256), + /* K24 */ be_nested_str_weak(derive), + /* K25 */ be_nested_str_weak(Ke), + /* K26 */ be_nested_str_weak(fromstring), + /* K27 */ be_nested_str_weak(SEKeys_Info), + /* K28 */ be_nested_str_weak(I2RKey), + /* K29 */ be_nested_str_weak(R2IKey), + /* K30 */ be_nested_str_weak(AttestationChallenge), + /* K31 */ be_nested_str_weak(add_session), + /* K32 */ be_nested_str_weak(future_local_session_id), + /* K33 */ be_nested_str_weak(future_initiator_session_id), }), - be_str_weak(process_incoming), + be_str_weak(parse_Pake3), &be_const_str_solidified, - ( &(const binstruction[83]) { /* code */ - 0x88080100, // 0000 GETMBR R2 R0 K0 - 0x8C080501, // 0001 GETMET R2 R2 K1 - 0x7C080200, // 0002 CALL R2 1 - 0x740A000E, // 0003 JMPT R2 #0013 - 0x88080302, // 0004 GETMBR R2 R1 K2 - 0x540E001F, // 0005 LDINT R3 32 - 0x28080403, // 0006 GE R2 R2 R3 - 0x780A000A, // 0007 JMPF R2 #0013 - 0x88080302, // 0008 GETMBR R2 R1 K2 - 0x540E0023, // 0009 LDINT R3 36 - 0x18080403, // 000A LE R2 R2 R3 - 0x780A0006, // 000B JMPF R2 #0013 - 0xB80A0600, // 000C GETNGBL R2 K3 - 0x8C080504, // 000D GETMET R2 R2 K4 - 0x58100005, // 000E LDCONST R4 K5 - 0x58140006, // 000F LDCONST R5 K6 - 0x7C080600, // 0010 CALL R2 3 - 0x50080000, // 0011 LDBOOL R2 0 0 - 0x80040400, // 0012 RET 1 R2 - 0xB80A0600, // 0013 GETNGBL R2 K3 - 0x8C080504, // 0014 GETMET R2 R2 K4 - 0xB8121000, // 0015 GETNGBL R4 K8 - 0x8C100909, // 0016 GETMET R4 R4 K9 - 0x5C180200, // 0017 MOVE R6 R1 - 0x7C100400, // 0018 CALL R4 2 - 0x00120E04, // 0019 ADD R4 K7 R4 - 0x5814000A, // 001A LDCONST R5 K10 - 0x7C080600, // 001B CALL R2 3 - 0x88080302, // 001C GETMBR R2 R1 K2 - 0x540E001F, // 001D LDINT R3 32 - 0x1C080403, // 001E EQ R2 R2 R3 - 0x780A0004, // 001F JMPF R2 #0025 - 0x8C08010B, // 0020 GETMET R2 R0 K11 - 0x5C100200, // 0021 MOVE R4 R1 - 0x7C080400, // 0022 CALL R2 2 - 0x80040400, // 0023 RET 1 R2 - 0x7002002B, // 0024 JMP #0051 - 0x88080302, // 0025 GETMBR R2 R1 K2 - 0x540E0021, // 0026 LDINT R3 34 - 0x1C080403, // 0027 EQ R2 R2 R3 - 0x780A0004, // 0028 JMPF R2 #002E - 0x8C08010C, // 0029 GETMET R2 R0 K12 - 0x5C100200, // 002A MOVE R4 R1 - 0x7C080400, // 002B CALL R2 2 - 0x80040400, // 002C RET 1 R2 - 0x70020022, // 002D JMP #0051 - 0x88080302, // 002E GETMBR R2 R1 K2 - 0x540E0023, // 002F LDINT R3 36 - 0x1C080403, // 0030 EQ R2 R2 R3 - 0x780A0004, // 0031 JMPF R2 #0037 - 0x8C08010D, // 0032 GETMET R2 R0 K13 - 0x5C100200, // 0033 MOVE R4 R1 - 0x7C080400, // 0034 CALL R2 2 - 0x80040400, // 0035 RET 1 R2 - 0x70020019, // 0036 JMP #0051 - 0x88080302, // 0037 GETMBR R2 R1 K2 - 0x540E002F, // 0038 LDINT R3 48 - 0x1C080403, // 0039 EQ R2 R2 R3 - 0x780A0004, // 003A JMPF R2 #0040 - 0x8C08010E, // 003B GETMET R2 R0 K14 - 0x5C100200, // 003C MOVE R4 R1 - 0x7C080400, // 003D CALL R2 2 - 0x80040400, // 003E RET 1 R2 - 0x70020010, // 003F JMP #0051 - 0x88080302, // 0040 GETMBR R2 R1 K2 - 0x540E0031, // 0041 LDINT R3 50 - 0x1C080403, // 0042 EQ R2 R2 R3 - 0x780A0004, // 0043 JMPF R2 #0049 - 0x8C08010F, // 0044 GETMET R2 R0 K15 - 0x5C100200, // 0045 MOVE R4 R1 - 0x7C080400, // 0046 CALL R2 2 - 0x80040400, // 0047 RET 1 R2 - 0x70020007, // 0048 JMP #0051 - 0x88080302, // 0049 GETMBR R2 R1 K2 - 0x540E003F, // 004A LDINT R3 64 - 0x1C080403, // 004B EQ R2 R2 R3 - 0x780A0003, // 004C JMPF R2 #0051 - 0x8C080110, // 004D GETMET R2 R0 K16 - 0x5C100200, // 004E MOVE R4 R1 - 0x7C080400, // 004F CALL R2 2 - 0x80040400, // 0050 RET 1 R2 - 0x50080000, // 0051 LDBOOL R2 0 0 - 0x80040400, // 0052 RET 1 R2 - }) - ) -); -/*******************************************************************/ - - -/******************************************************************** -** Solidified function: every_second -********************************************************************/ -be_local_closure(Matter_Commisioning_Context_every_second, /* name */ - be_nested_proto( - 1, /* nstack */ - 1, /* argc */ - 2, /* varg */ - 0, /* has upvals */ - NULL, /* no upvals */ - 0, /* has sup protos */ - NULL, /* no sub protos */ - 0, /* has constants */ - NULL, /* no const */ - be_str_weak(every_second), - &be_const_str_solidified, - ( &(const binstruction[ 1]) { /* code */ - 0x80000000, // 0000 RET 0 + ( &(const binstruction[112]) { /* code */ + 0xA40A0000, // 0000 IMPORT R2 K0 + 0x880C0301, // 0001 GETMBR R3 R1 K1 + 0x54120023, // 0002 LDINT R4 36 + 0x200C0604, // 0003 NE R3 R3 R4 + 0x740E0005, // 0004 JMPT R3 #000B + 0x880C0302, // 0005 GETMBR R3 R1 K2 + 0x200C0703, // 0006 NE R3 R3 K3 + 0x740E0002, // 0007 JMPT R3 #000B + 0x880C0304, // 0008 GETMBR R3 R1 K4 + 0x200C0703, // 0009 NE R3 R3 K3 + 0x780E0012, // 000A JMPF R3 #001E + 0xB80E0A00, // 000B GETNGBL R3 K5 + 0x8C0C0706, // 000C GETMET R3 R3 K6 + 0x58140007, // 000D LDCONST R5 K7 + 0x58180008, // 000E LDCONST R6 K8 + 0x7C0C0600, // 000F CALL R3 3 + 0xB80E0A00, // 0010 GETNGBL R3 K5 + 0x8C0C0706, // 0011 GETMET R3 R3 K6 + 0x58140009, // 0012 LDCONST R5 K9 + 0x58180008, // 0013 LDCONST R6 K8 + 0x7C0C0600, // 0014 CALL R3 3 + 0x8C0C010A, // 0015 GETMET R3 R0 K10 + 0x5C140200, // 0016 MOVE R5 R1 + 0x5818000B, // 0017 LDCONST R6 K11 + 0x581C0003, // 0018 LDCONST R7 K3 + 0x58200008, // 0019 LDCONST R8 K8 + 0x50240000, // 001A LDBOOL R9 0 0 + 0x7C0C0C00, // 001B CALL R3 6 + 0x50100000, // 001C LDBOOL R4 0 0 + 0x80040800, // 001D RET 1 R4 + 0xB80E1800, // 001E GETNGBL R3 K12 + 0x8C0C070D, // 001F GETMET R3 R3 K13 + 0x7C0C0200, // 0020 CALL R3 1 + 0x8C0C070E, // 0021 GETMET R3 R3 K14 + 0x8814030F, // 0022 GETMBR R5 R1 K15 + 0x88180310, // 0023 GETMBR R6 R1 K16 + 0x7C0C0600, // 0024 CALL R3 3 + 0x88100711, // 0025 GETMBR R4 R3 K17 + 0x90022204, // 0026 SETMBR R0 K17 R4 + 0x88100111, // 0027 GETMBR R4 R0 K17 + 0x88140112, // 0028 GETMBR R5 R0 K18 + 0x88140B11, // 0029 GETMBR R5 R5 K17 + 0x20100805, // 002A NE R4 R4 R5 + 0x78120012, // 002B JMPF R4 #003F + 0xB8120A00, // 002C GETNGBL R4 K5 + 0x8C100906, // 002D GETMET R4 R4 K6 + 0x58180013, // 002E LDCONST R6 K19 + 0x581C0008, // 002F LDCONST R7 K8 + 0x7C100600, // 0030 CALL R4 3 + 0xB8120A00, // 0031 GETNGBL R4 K5 + 0x8C100906, // 0032 GETMET R4 R4 K6 + 0x58180009, // 0033 LDCONST R6 K9 + 0x581C0008, // 0034 LDCONST R7 K8 + 0x7C100600, // 0035 CALL R4 3 + 0x8C10010A, // 0036 GETMET R4 R0 K10 + 0x5C180200, // 0037 MOVE R6 R1 + 0x581C000B, // 0038 LDCONST R7 K11 + 0x58200003, // 0039 LDCONST R8 K3 + 0x58240008, // 003A LDCONST R9 K8 + 0x50280000, // 003B LDBOOL R10 0 0 + 0x7C100C00, // 003C CALL R4 6 + 0x50140000, // 003D LDBOOL R5 0 0 + 0x80040A00, // 003E RET 1 R5 + 0xB8120A00, // 003F GETNGBL R4 K5 + 0x8C100915, // 0040 GETMET R4 R4 K21 + 0x7C100200, // 0041 CALL R4 1 + 0x94100916, // 0042 GETIDX R4 R4 K22 + 0x90022804, // 0043 SETMBR R0 K20 R4 + 0x8C100517, // 0044 GETMET R4 R2 K23 + 0x7C100200, // 0045 CALL R4 1 + 0x8C100918, // 0046 GETMET R4 R4 K24 + 0x88180119, // 0047 GETMBR R6 R0 K25 + 0x601C0015, // 0048 GETGBL R7 G21 + 0x7C1C0000, // 0049 CALL R7 0 + 0x60200015, // 004A GETGBL R8 G21 + 0x7C200000, // 004B CALL R8 0 + 0x8C20111A, // 004C GETMET R8 R8 K26 + 0x8828011B, // 004D GETMBR R10 R0 K27 + 0x7C200400, // 004E CALL R8 2 + 0x5426002F, // 004F LDINT R9 48 + 0x7C100A00, // 0050 CALL R4 5 + 0x5416000E, // 0051 LDINT R5 15 + 0x40160605, // 0052 CONNECT R5 K3 R5 + 0x94140805, // 0053 GETIDX R5 R4 R5 + 0x90023805, // 0054 SETMBR R0 K28 R5 + 0x5416000F, // 0055 LDINT R5 16 + 0x541A001E, // 0056 LDINT R6 31 + 0x40140A06, // 0057 CONNECT R5 R5 R6 + 0x94140805, // 0058 GETIDX R5 R4 R5 + 0x90023A05, // 0059 SETMBR R0 K29 R5 + 0x5416001F, // 005A LDINT R5 32 + 0x541A002E, // 005B LDINT R6 47 + 0x40140A06, // 005C CONNECT R5 R5 R6 + 0x94140805, // 005D GETIDX R5 R4 R5 + 0x90023C05, // 005E SETMBR R0 K30 R5 + 0x8C14010A, // 005F GETMET R5 R0 K10 + 0x5C1C0200, // 0060 MOVE R7 R1 + 0x58200003, // 0061 LDCONST R8 K3 + 0x58240003, // 0062 LDCONST R9 K3 + 0x58280003, // 0063 LDCONST R10 K3 + 0x502C0000, // 0064 LDBOOL R11 0 0 + 0x7C140C00, // 0065 CALL R5 6 + 0x8C18011F, // 0066 GETMET R6 R0 K31 + 0x88200120, // 0067 GETMBR R8 R0 K32 + 0x88240121, // 0068 GETMBR R9 R0 K33 + 0x8828011C, // 0069 GETMBR R10 R0 K28 + 0x882C011D, // 006A GETMBR R11 R0 K29 + 0x8830011E, // 006B GETMBR R12 R0 K30 + 0x88340114, // 006C GETMBR R13 R0 K20 + 0x7C180E00, // 006D CALL R6 7 + 0x50180200, // 006E LDBOOL R6 1 0 + 0x80040C00, // 006F RET 1 R6 }) ) ); @@ -1403,280 +1493,6 @@ be_local_closure(Matter_Commisioning_Context_parse_Sigma3, /* name */ /*******************************************************************/ -/******************************************************************** -** Solidified function: add_session -********************************************************************/ -be_local_closure(Matter_Commisioning_Context_add_session, /* name */ - be_nested_proto( - 15, /* nstack */ - 7, /* argc */ - 2, /* varg */ - 0, /* has upvals */ - NULL, /* no upvals */ - 0, /* has sup protos */ - NULL, /* no sub protos */ - 1, /* has constants */ - ( &(const bvalue[10]) { /* constants */ - /* K0 */ be_nested_str_weak(string), - /* K1 */ be_nested_str_weak(tasmota), - /* K2 */ be_nested_str_weak(log), - /* K3 */ be_nested_str_weak(format), - /* K4 */ be_nested_str_weak(MTR_X3A_X20add_session_X20local_session_id_X3D_X25i_X20initiator_session_id_X3D_X25i), - /* K5 */ be_const_int(3), - /* K6 */ be_nested_str_weak(device), - /* K7 */ be_nested_str_weak(sessions), - /* K8 */ be_nested_str_weak(create_session), - /* K9 */ be_nested_str_weak(set_keys), - }), - be_str_weak(add_session), - &be_const_str_solidified, - ( &(const binstruction[23]) { /* code */ - 0xA41E0000, // 0000 IMPORT R7 K0 - 0xB8220200, // 0001 GETNGBL R8 K1 - 0x8C201102, // 0002 GETMET R8 R8 K2 - 0x8C280F03, // 0003 GETMET R10 R7 K3 - 0x58300004, // 0004 LDCONST R12 K4 - 0x5C340200, // 0005 MOVE R13 R1 - 0x5C380400, // 0006 MOVE R14 R2 - 0x7C280800, // 0007 CALL R10 4 - 0x582C0005, // 0008 LDCONST R11 K5 - 0x7C200600, // 0009 CALL R8 3 - 0x88200106, // 000A GETMBR R8 R0 K6 - 0x88201107, // 000B GETMBR R8 R8 K7 - 0x8C201108, // 000C GETMET R8 R8 K8 - 0x5C280200, // 000D MOVE R10 R1 - 0x5C2C0400, // 000E MOVE R11 R2 - 0x7C200600, // 000F CALL R8 3 - 0x8C241109, // 0010 GETMET R9 R8 K9 - 0x5C2C0600, // 0011 MOVE R11 R3 - 0x5C300800, // 0012 MOVE R12 R4 - 0x5C340A00, // 0013 MOVE R13 R5 - 0x5C380C00, // 0014 MOVE R14 R6 - 0x7C240A00, // 0015 CALL R9 5 - 0x80000000, // 0016 RET 0 - }) - ) -); -/*******************************************************************/ - - -/******************************************************************** -** Solidified function: parse_Pake3 -********************************************************************/ -be_local_closure(Matter_Commisioning_Context_parse_Pake3, /* name */ - be_nested_proto( - 14, /* nstack */ - 2, /* argc */ - 2, /* varg */ - 0, /* has upvals */ - NULL, /* no upvals */ - 0, /* has sup protos */ - NULL, /* no sub protos */ - 1, /* has constants */ - ( &(const bvalue[34]) { /* constants */ - /* K0 */ be_nested_str_weak(crypto), - /* K1 */ be_nested_str_weak(opcode), - /* K2 */ be_nested_str_weak(local_session_id), - /* K3 */ be_const_int(0), - /* K4 */ be_nested_str_weak(protocol_id), - /* K5 */ be_nested_str_weak(tasmota), - /* K6 */ be_nested_str_weak(log), - /* K7 */ be_nested_str_weak(MTR_X3A_X20invalid_X20Pake3_X20message), - /* K8 */ be_const_int(2), - /* K9 */ be_nested_str_weak(MTR_X3A_X20StatusReport_X28General_X20Code_X3A_X20FAILURE_X2C_X20ProtocolId_X3A_X20SECURE_CHANNEL_X2C_X20ProtocolCode_X3A_X20INVALID_PARAMETER_X29), - /* K10 */ be_nested_str_weak(send_status_report), - /* K11 */ be_const_int(1), - /* K12 */ be_nested_str_weak(matter), - /* K13 */ be_nested_str_weak(Pake3), - /* K14 */ be_nested_str_weak(parse), - /* K15 */ be_nested_str_weak(raw), - /* K16 */ be_nested_str_weak(app_payload_idx), - /* K17 */ be_nested_str_weak(cA), - /* K18 */ be_nested_str_weak(spake), - /* K19 */ be_nested_str_weak(MTR_X3A_X20invalid_X20cA_X20received), - /* K20 */ be_nested_str_weak(created), - /* K21 */ be_nested_str_weak(rtc), - /* K22 */ be_nested_str_weak(utc), - /* K23 */ be_nested_str_weak(HKDF_SHA256), - /* K24 */ be_nested_str_weak(derive), - /* K25 */ be_nested_str_weak(Ke), - /* K26 */ be_nested_str_weak(fromstring), - /* K27 */ be_nested_str_weak(SEKeys_Info), - /* K28 */ be_nested_str_weak(I2RKey), - /* K29 */ be_nested_str_weak(R2IKey), - /* K30 */ be_nested_str_weak(AttestationChallenge), - /* K31 */ be_nested_str_weak(add_session), - /* K32 */ be_nested_str_weak(future_local_session_id), - /* K33 */ be_nested_str_weak(future_initiator_session_id), - }), - be_str_weak(parse_Pake3), - &be_const_str_solidified, - ( &(const binstruction[112]) { /* code */ - 0xA40A0000, // 0000 IMPORT R2 K0 - 0x880C0301, // 0001 GETMBR R3 R1 K1 - 0x54120023, // 0002 LDINT R4 36 - 0x200C0604, // 0003 NE R3 R3 R4 - 0x740E0005, // 0004 JMPT R3 #000B - 0x880C0302, // 0005 GETMBR R3 R1 K2 - 0x200C0703, // 0006 NE R3 R3 K3 - 0x740E0002, // 0007 JMPT R3 #000B - 0x880C0304, // 0008 GETMBR R3 R1 K4 - 0x200C0703, // 0009 NE R3 R3 K3 - 0x780E0012, // 000A JMPF R3 #001E - 0xB80E0A00, // 000B GETNGBL R3 K5 - 0x8C0C0706, // 000C GETMET R3 R3 K6 - 0x58140007, // 000D LDCONST R5 K7 - 0x58180008, // 000E LDCONST R6 K8 - 0x7C0C0600, // 000F CALL R3 3 - 0xB80E0A00, // 0010 GETNGBL R3 K5 - 0x8C0C0706, // 0011 GETMET R3 R3 K6 - 0x58140009, // 0012 LDCONST R5 K9 - 0x58180008, // 0013 LDCONST R6 K8 - 0x7C0C0600, // 0014 CALL R3 3 - 0x8C0C010A, // 0015 GETMET R3 R0 K10 - 0x5C140200, // 0016 MOVE R5 R1 - 0x5818000B, // 0017 LDCONST R6 K11 - 0x581C0003, // 0018 LDCONST R7 K3 - 0x58200008, // 0019 LDCONST R8 K8 - 0x50240000, // 001A LDBOOL R9 0 0 - 0x7C0C0C00, // 001B CALL R3 6 - 0x50100000, // 001C LDBOOL R4 0 0 - 0x80040800, // 001D RET 1 R4 - 0xB80E1800, // 001E GETNGBL R3 K12 - 0x8C0C070D, // 001F GETMET R3 R3 K13 - 0x7C0C0200, // 0020 CALL R3 1 - 0x8C0C070E, // 0021 GETMET R3 R3 K14 - 0x8814030F, // 0022 GETMBR R5 R1 K15 - 0x88180310, // 0023 GETMBR R6 R1 K16 - 0x7C0C0600, // 0024 CALL R3 3 - 0x88100711, // 0025 GETMBR R4 R3 K17 - 0x90022204, // 0026 SETMBR R0 K17 R4 - 0x88100111, // 0027 GETMBR R4 R0 K17 - 0x88140112, // 0028 GETMBR R5 R0 K18 - 0x88140B11, // 0029 GETMBR R5 R5 K17 - 0x20100805, // 002A NE R4 R4 R5 - 0x78120012, // 002B JMPF R4 #003F - 0xB8120A00, // 002C GETNGBL R4 K5 - 0x8C100906, // 002D GETMET R4 R4 K6 - 0x58180013, // 002E LDCONST R6 K19 - 0x581C0008, // 002F LDCONST R7 K8 - 0x7C100600, // 0030 CALL R4 3 - 0xB8120A00, // 0031 GETNGBL R4 K5 - 0x8C100906, // 0032 GETMET R4 R4 K6 - 0x58180009, // 0033 LDCONST R6 K9 - 0x581C0008, // 0034 LDCONST R7 K8 - 0x7C100600, // 0035 CALL R4 3 - 0x8C10010A, // 0036 GETMET R4 R0 K10 - 0x5C180200, // 0037 MOVE R6 R1 - 0x581C000B, // 0038 LDCONST R7 K11 - 0x58200003, // 0039 LDCONST R8 K3 - 0x58240008, // 003A LDCONST R9 K8 - 0x50280000, // 003B LDBOOL R10 0 0 - 0x7C100C00, // 003C CALL R4 6 - 0x50140000, // 003D LDBOOL R5 0 0 - 0x80040A00, // 003E RET 1 R5 - 0xB8120A00, // 003F GETNGBL R4 K5 - 0x8C100915, // 0040 GETMET R4 R4 K21 - 0x7C100200, // 0041 CALL R4 1 - 0x94100916, // 0042 GETIDX R4 R4 K22 - 0x90022804, // 0043 SETMBR R0 K20 R4 - 0x8C100517, // 0044 GETMET R4 R2 K23 - 0x7C100200, // 0045 CALL R4 1 - 0x8C100918, // 0046 GETMET R4 R4 K24 - 0x88180119, // 0047 GETMBR R6 R0 K25 - 0x601C0015, // 0048 GETGBL R7 G21 - 0x7C1C0000, // 0049 CALL R7 0 - 0x60200015, // 004A GETGBL R8 G21 - 0x7C200000, // 004B CALL R8 0 - 0x8C20111A, // 004C GETMET R8 R8 K26 - 0x8828011B, // 004D GETMBR R10 R0 K27 - 0x7C200400, // 004E CALL R8 2 - 0x5426002F, // 004F LDINT R9 48 - 0x7C100A00, // 0050 CALL R4 5 - 0x5416000E, // 0051 LDINT R5 15 - 0x40160605, // 0052 CONNECT R5 K3 R5 - 0x94140805, // 0053 GETIDX R5 R4 R5 - 0x90023805, // 0054 SETMBR R0 K28 R5 - 0x5416000F, // 0055 LDINT R5 16 - 0x541A001E, // 0056 LDINT R6 31 - 0x40140A06, // 0057 CONNECT R5 R5 R6 - 0x94140805, // 0058 GETIDX R5 R4 R5 - 0x90023A05, // 0059 SETMBR R0 K29 R5 - 0x5416001F, // 005A LDINT R5 32 - 0x541A002E, // 005B LDINT R6 47 - 0x40140A06, // 005C CONNECT R5 R5 R6 - 0x94140805, // 005D GETIDX R5 R4 R5 - 0x90023C05, // 005E SETMBR R0 K30 R5 - 0x8C14010A, // 005F GETMET R5 R0 K10 - 0x5C1C0200, // 0060 MOVE R7 R1 - 0x58200003, // 0061 LDCONST R8 K3 - 0x58240003, // 0062 LDCONST R9 K3 - 0x58280003, // 0063 LDCONST R10 K3 - 0x502C0000, // 0064 LDBOOL R11 0 0 - 0x7C140C00, // 0065 CALL R5 6 - 0x8C18011F, // 0066 GETMET R6 R0 K31 - 0x88200120, // 0067 GETMBR R8 R0 K32 - 0x88240121, // 0068 GETMBR R9 R0 K33 - 0x8828011C, // 0069 GETMBR R10 R0 K28 - 0x882C011D, // 006A GETMBR R11 R0 K29 - 0x8830011E, // 006B GETMBR R12 R0 K30 - 0x88340114, // 006C GETMBR R13 R0 K20 - 0x7C180E00, // 006D CALL R6 7 - 0x50180200, // 006E LDBOOL R6 1 0 - 0x80040C00, // 006F RET 1 R6 - }) - ) -); -/*******************************************************************/ - - -/******************************************************************** -** Solidified function: parse_StatusReport -********************************************************************/ -be_local_closure(Matter_Commisioning_Context_parse_StatusReport, /* name */ - be_nested_proto( - 7, /* nstack */ - 2, /* argc */ - 2, /* varg */ - 0, /* has upvals */ - NULL, /* no upvals */ - 0, /* has sup protos */ - NULL, /* no sub protos */ - 1, /* has constants */ - ( &(const bvalue[ 9]) { /* constants */ - /* K0 */ be_nested_str_weak(session), - /* K1 */ be_nested_str_weak(tasmota), - /* K2 */ be_nested_str_weak(log), - /* K3 */ be_nested_str_weak(MTR_X3A_X20StatusReport_X20_X3D_X20), - /* K4 */ be_nested_str_weak(raw), - /* K5 */ be_nested_str_weak(app_payload_idx), - /* K6 */ be_const_int(2147483647), - /* K7 */ be_nested_str_weak(tohex), - /* K8 */ be_const_int(2), - }), - be_str_weak(parse_StatusReport), - &be_const_str_solidified, - ( &(const binstruction[14]) { /* code */ - 0x88080300, // 0000 GETMBR R2 R1 K0 - 0xB80E0200, // 0001 GETNGBL R3 K1 - 0x8C0C0702, // 0002 GETMET R3 R3 K2 - 0x88140305, // 0003 GETMBR R5 R1 K5 - 0x40140B06, // 0004 CONNECT R5 R5 K6 - 0x88180304, // 0005 GETMBR R6 R1 K4 - 0x94140C05, // 0006 GETIDX R5 R6 R5 - 0x8C140B07, // 0007 GETMET R5 R5 K7 - 0x7C140200, // 0008 CALL R5 1 - 0x00160605, // 0009 ADD R5 K3 R5 - 0x58180008, // 000A LDCONST R6 K8 - 0x7C0C0600, // 000B CALL R3 3 - 0x500C0000, // 000C LDBOOL R3 0 0 - 0x80040600, // 000D RET 1 R3 - }) - ) -); -/*******************************************************************/ - - /******************************************************************** ** Solidified function: parse_Sigma1 ********************************************************************/ @@ -2653,12 +2469,300 @@ be_local_closure(Matter_Commisioning_Context_parse_Sigma1, /* name */ /******************************************************************** -** Solidified function: send_status_report +** Solidified function: parse_StatusReport ********************************************************************/ -be_local_closure(Matter_Commisioning_Context_send_status_report, /* name */ +be_local_closure(Matter_Commisioning_Context_parse_StatusReport, /* name */ be_nested_proto( - 16, /* nstack */ - 6, /* argc */ + 7, /* nstack */ + 2, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 9]) { /* constants */ + /* K0 */ be_nested_str_weak(session), + /* K1 */ be_nested_str_weak(tasmota), + /* K2 */ be_nested_str_weak(log), + /* K3 */ be_nested_str_weak(MTR_X3A_X20_X3EStatus_X20_X20_X20_X20), + /* K4 */ be_nested_str_weak(raw), + /* K5 */ be_nested_str_weak(app_payload_idx), + /* K6 */ be_const_int(2147483647), + /* K7 */ be_nested_str_weak(tohex), + /* K8 */ be_const_int(2), + }), + be_str_weak(parse_StatusReport), + &be_const_str_solidified, + ( &(const binstruction[14]) { /* code */ + 0x88080300, // 0000 GETMBR R2 R1 K0 + 0xB80E0200, // 0001 GETNGBL R3 K1 + 0x8C0C0702, // 0002 GETMET R3 R3 K2 + 0x88140305, // 0003 GETMBR R5 R1 K5 + 0x40140B06, // 0004 CONNECT R5 R5 K6 + 0x88180304, // 0005 GETMBR R6 R1 K4 + 0x94140C05, // 0006 GETIDX R5 R6 R5 + 0x8C140B07, // 0007 GETMET R5 R5 K7 + 0x7C140200, // 0008 CALL R5 1 + 0x00160605, // 0009 ADD R5 K3 R5 + 0x58180008, // 000A LDCONST R6 K8 + 0x7C0C0600, // 000B CALL R3 3 + 0x500C0000, // 000C LDBOOL R3 0 0 + 0x80040600, // 000D RET 1 R3 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: find_fabric_by_destination_id +********************************************************************/ +be_local_closure(Matter_Commisioning_Context_find_fabric_by_destination_id, /* name */ + be_nested_proto( + 14, /* nstack */ + 3, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[21]) { /* constants */ + /* K0 */ be_nested_str_weak(crypto), + /* K1 */ be_nested_str_weak(tasmota), + /* K2 */ be_nested_str_weak(log), + /* K3 */ be_nested_str_weak(MTR_X3A_X20SEARCHING_X3A_X20destinationId_X3D), + /* K4 */ be_nested_str_weak(tohex), + /* K5 */ be_const_int(3), + /* K6 */ be_nested_str_weak(device), + /* K7 */ be_nested_str_weak(sessions), + /* K8 */ be_nested_str_weak(fabrics), + /* K9 */ be_nested_str_weak(noc), + /* K10 */ be_nested_str_weak(fabric_id), + /* K11 */ be_nested_str_weak(device_id), + /* K12 */ be_nested_str_weak(get_ca_pub), + /* K13 */ be_nested_str_weak(get_ipk_group_key), + /* K14 */ be_nested_str_weak(MTR_X3A_X20SIGMA1_X3A_X20destinationMessage_X3D), + /* K15 */ be_nested_str_weak(MTR_X3A_X20SIGMA1_X3A_X20key_ipk_X3D), + /* K16 */ be_nested_str_weak(HMAC_SHA256), + /* K17 */ be_nested_str_weak(update), + /* K18 */ be_nested_str_weak(out), + /* K19 */ be_nested_str_weak(MTR_X3A_X20SIGMA1_X3A_X20candidateDestinationId_X3D), + /* K20 */ be_nested_str_weak(stop_iteration), + }), + be_str_weak(find_fabric_by_destination_id), + &be_const_str_solidified, + ( &(const binstruction[77]) { /* code */ + 0xA40E0000, // 0000 IMPORT R3 K0 + 0xB8120200, // 0001 GETNGBL R4 K1 + 0x8C100902, // 0002 GETMET R4 R4 K2 + 0x8C180304, // 0003 GETMET R6 R1 K4 + 0x7C180200, // 0004 CALL R6 1 + 0x001A0606, // 0005 ADD R6 K3 R6 + 0x581C0005, // 0006 LDCONST R7 K5 + 0x7C100600, // 0007 CALL R4 3 + 0x60100010, // 0008 GETGBL R4 G16 + 0x88140106, // 0009 GETMBR R5 R0 K6 + 0x88140B07, // 000A GETMBR R5 R5 K7 + 0x88140B08, // 000B GETMBR R5 R5 K8 + 0x7C100200, // 000C CALL R4 1 + 0xA8020039, // 000D EXBLK 0 #0048 + 0x5C140800, // 000E MOVE R5 R4 + 0x7C140000, // 000F CALL R5 0 + 0x88180B09, // 0010 GETMBR R6 R5 K9 + 0x4C1C0000, // 0011 LDNIL R7 + 0x1C180C07, // 0012 EQ R6 R6 R7 + 0x741A0007, // 0013 JMPT R6 #001C + 0x88180B0A, // 0014 GETMBR R6 R5 K10 + 0x4C1C0000, // 0015 LDNIL R7 + 0x1C180C07, // 0016 EQ R6 R6 R7 + 0x741A0003, // 0017 JMPT R6 #001C + 0x88180B0B, // 0018 GETMBR R6 R5 K11 + 0x4C1C0000, // 0019 LDNIL R7 + 0x1C180C07, // 001A EQ R6 R6 R7 + 0x781A0000, // 001B JMPF R6 #001D + 0x7001FFF0, // 001C JMP #000E + 0x8C180B0C, // 001D GETMET R6 R5 K12 + 0x7C180200, // 001E CALL R6 1 + 0x00180406, // 001F ADD R6 R2 R6 + 0x881C0B0A, // 0020 GETMBR R7 R5 K10 + 0x00180C07, // 0021 ADD R6 R6 R7 + 0x881C0B0B, // 0022 GETMBR R7 R5 K11 + 0x00180C07, // 0023 ADD R6 R6 R7 + 0x8C1C0B0D, // 0024 GETMET R7 R5 K13 + 0x7C1C0200, // 0025 CALL R7 1 + 0xB8220200, // 0026 GETNGBL R8 K1 + 0x8C201102, // 0027 GETMET R8 R8 K2 + 0x8C280D04, // 0028 GETMET R10 R6 K4 + 0x7C280200, // 0029 CALL R10 1 + 0x002A1C0A, // 002A ADD R10 K14 R10 + 0x582C0005, // 002B LDCONST R11 K5 + 0x7C200600, // 002C CALL R8 3 + 0xB8220200, // 002D GETNGBL R8 K1 + 0x8C201102, // 002E GETMET R8 R8 K2 + 0x8C280F04, // 002F GETMET R10 R7 K4 + 0x7C280200, // 0030 CALL R10 1 + 0x002A1E0A, // 0031 ADD R10 K15 R10 + 0x542E0003, // 0032 LDINT R11 4 + 0x7C200600, // 0033 CALL R8 3 + 0x8C200710, // 0034 GETMET R8 R3 K16 + 0x5C280E00, // 0035 MOVE R10 R7 + 0x7C200400, // 0036 CALL R8 2 + 0x8C241111, // 0037 GETMET R9 R8 K17 + 0x5C2C0C00, // 0038 MOVE R11 R6 + 0x7C240400, // 0039 CALL R9 2 + 0x8C241112, // 003A GETMET R9 R8 K18 + 0x7C240200, // 003B CALL R9 1 + 0xB82A0200, // 003C GETNGBL R10 K1 + 0x8C281502, // 003D GETMET R10 R10 K2 + 0x8C301304, // 003E GETMET R12 R9 K4 + 0x7C300200, // 003F CALL R12 1 + 0x0032260C, // 0040 ADD R12 K19 R12 + 0x58340005, // 0041 LDCONST R13 K5 + 0x7C280600, // 0042 CALL R10 3 + 0x1C281201, // 0043 EQ R10 R9 R1 + 0x782A0001, // 0044 JMPF R10 #0047 + 0xA8040001, // 0045 EXBLK 1 1 + 0x80040A00, // 0046 RET 1 R5 + 0x7001FFC5, // 0047 JMP #000E + 0x58100014, // 0048 LDCONST R4 K20 + 0xAC100200, // 0049 CATCH R4 1 0 + 0xB0080000, // 004A RAISE 2 R0 R0 + 0x4C100000, // 004B LDNIL R4 + 0x80040800, // 004C RET 1 R4 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: every_second +********************************************************************/ +be_local_closure(Matter_Commisioning_Context_every_second, /* name */ + be_nested_proto( + 1, /* nstack */ + 1, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 0, /* has constants */ + NULL, /* no const */ + be_str_weak(every_second), + &be_const_str_solidified, + ( &(const binstruction[ 1]) { /* code */ + 0x80000000, // 0000 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: add_session +********************************************************************/ +be_local_closure(Matter_Commisioning_Context_add_session, /* name */ + be_nested_proto( + 15, /* nstack */ + 7, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[10]) { /* constants */ + /* K0 */ be_nested_str_weak(string), + /* K1 */ be_nested_str_weak(tasmota), + /* K2 */ be_nested_str_weak(log), + /* K3 */ be_nested_str_weak(format), + /* K4 */ be_nested_str_weak(MTR_X3A_X20add_session_X20local_session_id_X3D_X25i_X20initiator_session_id_X3D_X25i), + /* K5 */ be_const_int(3), + /* K6 */ be_nested_str_weak(device), + /* K7 */ be_nested_str_weak(sessions), + /* K8 */ be_nested_str_weak(create_session), + /* K9 */ be_nested_str_weak(set_keys), + }), + be_str_weak(add_session), + &be_const_str_solidified, + ( &(const binstruction[23]) { /* code */ + 0xA41E0000, // 0000 IMPORT R7 K0 + 0xB8220200, // 0001 GETNGBL R8 K1 + 0x8C201102, // 0002 GETMET R8 R8 K2 + 0x8C280F03, // 0003 GETMET R10 R7 K3 + 0x58300004, // 0004 LDCONST R12 K4 + 0x5C340200, // 0005 MOVE R13 R1 + 0x5C380400, // 0006 MOVE R14 R2 + 0x7C280800, // 0007 CALL R10 4 + 0x582C0005, // 0008 LDCONST R11 K5 + 0x7C200600, // 0009 CALL R8 3 + 0x88200106, // 000A GETMBR R8 R0 K6 + 0x88201107, // 000B GETMBR R8 R8 K7 + 0x8C201108, // 000C GETMET R8 R8 K8 + 0x5C280200, // 000D MOVE R10 R1 + 0x5C2C0400, // 000E MOVE R11 R2 + 0x7C200600, // 000F CALL R8 3 + 0x8C241109, // 0010 GETMET R9 R8 K9 + 0x5C2C0600, // 0011 MOVE R11 R3 + 0x5C300800, // 0012 MOVE R12 R4 + 0x5C340A00, // 0013 MOVE R13 R5 + 0x5C380C00, // 0014 MOVE R14 R6 + 0x7C240A00, // 0015 CALL R9 5 + 0x80000000, // 0016 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: init +********************************************************************/ +be_local_closure(Matter_Commisioning_Context_init, /* name */ + be_nested_proto( + 6, /* nstack */ + 2, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 5]) { /* constants */ + /* K0 */ be_nested_str_weak(crypto), + /* K1 */ be_nested_str_weak(responder), + /* K2 */ be_nested_str_weak(device), + /* K3 */ be_nested_str_weak(y), + /* K4 */ be_nested_str_weak(random), + }), + be_str_weak(init), + &be_const_str_solidified, + ( &(const binstruction[ 9]) { /* code */ + 0xA40A0000, // 0000 IMPORT R2 K0 + 0x90020201, // 0001 SETMBR R0 K1 R1 + 0x880C0302, // 0002 GETMBR R3 R1 K2 + 0x90020403, // 0003 SETMBR R0 K2 R3 + 0x8C0C0504, // 0004 GETMET R3 R2 K4 + 0x5416001F, // 0005 LDINT R5 32 + 0x7C0C0400, // 0006 CALL R3 2 + 0x90020603, // 0007 SETMBR R0 K3 R3 + 0x80000000, // 0008 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: parse_MsgCounterSyncRsp +********************************************************************/ +be_local_closure(Matter_Commisioning_Context_parse_MsgCounterSyncRsp, /* name */ + be_nested_proto( + 11, /* nstack */ + 2, /* argc */ 2, /* varg */ 0, /* has upvals */ NULL, /* no upvals */ @@ -2666,55 +2770,90 @@ be_local_closure(Matter_Commisioning_Context_send_status_report, /* name */ NULL, /* no sub protos */ 1, /* has constants */ ( &(const bvalue[11]) { /* constants */ - /* K0 */ be_nested_str_weak(build_response), - /* K1 */ be_nested_str_weak(add), - /* K2 */ be_const_int(2), - /* K3 */ be_nested_str_weak(encode_frame), - /* K4 */ be_nested_str_weak(responder), - /* K5 */ be_nested_str_weak(send_response), - /* K6 */ be_nested_str_weak(remote_ip), - /* K7 */ be_nested_str_weak(remote_port), - /* K8 */ be_nested_str_weak(message_counter), - /* K9 */ be_nested_str_weak(session), - /* K10 */ be_nested_str_weak(local_session_id), + /* K0 */ be_nested_str_weak(string), + /* K1 */ be_nested_str_weak(session), + /* K2 */ be_nested_str_weak(tasmota), + /* K3 */ be_nested_str_weak(log), + /* K4 */ be_nested_str_weak(format), + /* K5 */ be_nested_str_weak(MTR_X3A_X20_X3E_X3F_X3F_X3F_X3F_X3F_X3F_X3F_X3F_X3F_X20MsgCounterSyncRsp_X20not_X20implemented_X20_X25s), + /* K6 */ be_nested_str_weak(raw), + /* K7 */ be_nested_str_weak(app_payload_idx), + /* K8 */ be_const_int(2147483647), + /* K9 */ be_nested_str_weak(tohex), + /* K10 */ be_const_int(2), }), - be_str_weak(send_status_report), + be_str_weak(parse_MsgCounterSyncRsp), &be_const_str_solidified, - ( &(const binstruction[34]) { /* code */ - 0x8C180300, // 0000 GETMET R6 R1 K0 - 0x5422003F, // 0001 LDINT R8 64 - 0x5C240A00, // 0002 MOVE R9 R5 - 0x7C180600, // 0003 CALL R6 3 - 0x601C0015, // 0004 GETGBL R7 G21 - 0x7C1C0000, // 0005 CALL R7 0 - 0x8C200F01, // 0006 GETMET R8 R7 K1 - 0x5C280400, // 0007 MOVE R10 R2 - 0x582C0002, // 0008 LDCONST R11 K2 - 0x7C200600, // 0009 CALL R8 3 - 0x8C200F01, // 000A GETMET R8 R7 K1 - 0x5C280600, // 000B MOVE R10 R3 - 0x542E0003, // 000C LDINT R11 4 - 0x7C200600, // 000D CALL R8 3 - 0x8C200F01, // 000E GETMET R8 R7 K1 - 0x5C280800, // 000F MOVE R10 R4 - 0x542E0003, // 0010 LDINT R11 4 - 0x7C200600, // 0011 CALL R8 3 - 0x8C200D03, // 0012 GETMET R8 R6 K3 - 0x5C280E00, // 0013 MOVE R10 R7 - 0x7C200400, // 0014 CALL R8 2 - 0x88240104, // 0015 GETMBR R9 R0 K4 - 0x8C241305, // 0016 GETMET R9 R9 K5 - 0x5C2C1000, // 0017 MOVE R11 R8 - 0x88300306, // 0018 GETMBR R12 R1 K6 - 0x88340307, // 0019 GETMBR R13 R1 K7 - 0x78160001, // 001A JMPF R5 #001D - 0x88380D08, // 001B GETMBR R14 R6 K8 - 0x70020000, // 001C JMP #001E - 0x4C380000, // 001D LDNIL R14 - 0x883C0309, // 001E GETMBR R15 R1 K9 - 0x883C1F0A, // 001F GETMBR R15 R15 K10 - 0x7C240C00, // 0020 CALL R9 6 - 0x80000000, // 0021 RET 0 + ( &(const binstruction[17]) { /* code */ + 0xA40A0000, // 0000 IMPORT R2 K0 + 0x880C0301, // 0001 GETMBR R3 R1 K1 + 0xB8120400, // 0002 GETNGBL R4 K2 + 0x8C100903, // 0003 GETMET R4 R4 K3 + 0x8C180504, // 0004 GETMET R6 R2 K4 + 0x58200005, // 0005 LDCONST R8 K5 + 0x88240307, // 0006 GETMBR R9 R1 K7 + 0x40241308, // 0007 CONNECT R9 R9 K8 + 0x88280306, // 0008 GETMBR R10 R1 K6 + 0x94241409, // 0009 GETIDX R9 R10 R9 + 0x8C241309, // 000A GETMET R9 R9 K9 + 0x7C240200, // 000B CALL R9 1 + 0x7C180600, // 000C CALL R6 3 + 0x581C000A, // 000D LDCONST R7 K10 + 0x7C100600, // 000E CALL R4 3 + 0x50100000, // 000F LDBOOL R4 0 0 + 0x80040800, // 0010 RET 1 R4 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: parse_MsgCounterSyncReq +********************************************************************/ +be_local_closure(Matter_Commisioning_Context_parse_MsgCounterSyncReq, /* name */ + be_nested_proto( + 11, /* nstack */ + 2, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[11]) { /* constants */ + /* K0 */ be_nested_str_weak(string), + /* K1 */ be_nested_str_weak(session), + /* K2 */ be_nested_str_weak(tasmota), + /* K3 */ be_nested_str_weak(log), + /* K4 */ be_nested_str_weak(format), + /* K5 */ be_nested_str_weak(MTR_X3A_X20_X3E_X3F_X3F_X3F_X3F_X3F_X3F_X3F_X3F_X3F_X20MsgCounterSyncReq_X20not_X20implemented_X20_X25s), + /* K6 */ be_nested_str_weak(raw), + /* K7 */ be_nested_str_weak(app_payload_idx), + /* K8 */ be_const_int(2147483647), + /* K9 */ be_nested_str_weak(tohex), + /* K10 */ be_const_int(2), + }), + be_str_weak(parse_MsgCounterSyncReq), + &be_const_str_solidified, + ( &(const binstruction[17]) { /* code */ + 0xA40A0000, // 0000 IMPORT R2 K0 + 0x880C0301, // 0001 GETMBR R3 R1 K1 + 0xB8120400, // 0002 GETNGBL R4 K2 + 0x8C100903, // 0003 GETMET R4 R4 K3 + 0x8C180504, // 0004 GETMET R6 R2 K4 + 0x58200005, // 0005 LDCONST R8 K5 + 0x88240307, // 0006 GETMBR R9 R1 K7 + 0x40241308, // 0007 CONNECT R9 R9 K8 + 0x88280306, // 0008 GETMBR R10 R1 K6 + 0x94241409, // 0009 GETIDX R9 R10 R9 + 0x8C241309, // 000A GETMET R9 R9 K9 + 0x7C240200, // 000B CALL R9 1 + 0x7C180600, // 000C CALL R6 3 + 0x581C000A, // 000D LDCONST R7 K10 + 0x7C100600, // 000E CALL R4 3 + 0x50100000, // 000F LDBOOL R4 0 0 + 0x80040800, // 0010 RET 1 R4 }) ) ); @@ -2727,46 +2866,48 @@ be_local_closure(Matter_Commisioning_Context_send_status_report, /* name */ be_local_class(Matter_Commisioning_Context, 20, NULL, - be_nested_map(38, + be_nested_map(40, ( (struct bmapnode*) &(const bmapnode[]) { - { be_const_key_weak(send_status_report, -1), be_const_closure(Matter_Commisioning_Context_send_status_report_closure) }, - { be_const_key_weak(cB, -1), be_const_var(11) }, - { be_const_key_weak(TBEData3_Nonce, 37), be_nested_str_weak(NCASE_Sigma3N) }, - { be_const_key_weak(find_fabric_by_destination_id, -1), be_const_closure(Matter_Commisioning_Context_find_fabric_by_destination_id_closure) }, - { be_const_key_weak(parse_Sigma1, 3), be_const_closure(Matter_Commisioning_Context_parse_Sigma1_closure) }, - { be_const_key_weak(responder, -1), be_const_var(0) }, - { be_const_key_weak(parse_PBKDFParamRequest, -1), be_const_closure(Matter_Commisioning_Context_parse_PBKDFParamRequest_closure) }, - { be_const_key_weak(parse_Pake1, -1), be_const_closure(Matter_Commisioning_Context_parse_Pake1_closure) }, - { be_const_key_weak(process_incoming, -1), be_const_closure(Matter_Commisioning_Context_process_incoming_closure) }, - { be_const_key_weak(future_initiator_session_id, 2), be_const_var(3) }, - { be_const_key_weak(cA, -1), be_const_var(10) }, - { be_const_key_weak(parse_Sigma3, -1), be_const_closure(Matter_Commisioning_Context_parse_Sigma3_closure) }, - { be_const_key_weak(ResponderEph_priv, -1), be_const_var(13) }, - { be_const_key_weak(init, -1), be_const_closure(Matter_Commisioning_Context_init_closure) }, - { be_const_key_weak(parse_StatusReport, -1), be_const_closure(Matter_Commisioning_Context_parse_StatusReport_closure) }, - { be_const_key_weak(device, 8), be_const_var(1) }, - { be_const_key_weak(PBKDFParamResponse, -1), be_const_var(6) }, - { be_const_key_weak(future_local_session_id, 18), be_const_var(4) }, - { be_const_key_weak(pB, 11), be_const_var(9) }, - { be_const_key_weak(add_session, -1), be_const_closure(Matter_Commisioning_Context_add_session_closure) }, - { be_const_key_weak(Ke, -1), be_const_var(12) }, + { be_const_key_weak(cB, 30), be_const_var(11) }, + { be_const_key_weak(parse_MsgCounterSyncReq, 26), be_const_closure(Matter_Commisioning_Context_parse_MsgCounterSyncReq_closure) }, + { be_const_key_weak(pA, 24), be_const_var(8) }, + { be_const_key_weak(R2IKey, -1), be_const_var(18) }, + { be_const_key_weak(ResponderEph_pub, -1), be_const_var(14) }, + { be_const_key_weak(spake, 20), be_const_var(2) }, { be_const_key_weak(SEKeys_Info, -1), be_nested_str_weak(SessionKeys) }, - { be_const_key_weak(S2K_Info, -1), be_nested_str_weak(Sigma2) }, - { be_const_key_weak(created, 26), be_const_var(16) }, - { be_const_key_weak(AttestationChallenge, 21), be_const_var(19) }, - { be_const_key_weak(R2IKey, 20), be_const_var(18) }, + { be_const_key_weak(process_incoming, 16), be_const_closure(Matter_Commisioning_Context_process_incoming_closure) }, + { be_const_key_weak(parse_PBKDFParamRequest, 29), be_const_closure(Matter_Commisioning_Context_parse_PBKDFParamRequest_closure) }, + { be_const_key_weak(send_status_report, -1), be_const_closure(Matter_Commisioning_Context_send_status_report_closure) }, + { be_const_key_weak(future_initiator_session_id, -1), be_const_var(3) }, + { be_const_key_weak(device, -1), be_const_var(1) }, + { be_const_key_weak(initiatorEph_pub, -1), be_const_var(15) }, + { be_const_key_weak(parse_Pake1, 34), be_const_closure(Matter_Commisioning_Context_parse_Pake1_closure) }, + { be_const_key_weak(parse_Sigma3, -1), be_const_closure(Matter_Commisioning_Context_parse_Sigma3_closure) }, { be_const_key_weak(parse_Pake3, -1), be_const_closure(Matter_Commisioning_Context_parse_Pake3_closure) }, - { be_const_key_weak(S3K_Info, -1), be_nested_str_weak(Sigma3) }, - { be_const_key_weak(pA, 16), be_const_var(8) }, - { be_const_key_weak(Matter_Context_Prefix, 14), be_nested_str_weak(CHIP_X20PAKE_X20V1_X20Commissioning) }, - { be_const_key_weak(PBKDFParamRequest, -1), be_const_var(5) }, - { be_const_key_weak(every_second, 10), be_const_closure(Matter_Commisioning_Context_every_second_closure) }, - { be_const_key_weak(TBEData2_Nonce, -1), be_nested_str_weak(NCASE_Sigma2N) }, - { be_const_key_weak(initiatorEph_pub, 4), be_const_var(15) }, - { be_const_key_weak(y, -1), be_const_var(7) }, - { be_const_key_weak(spake, 0), be_const_var(2) }, - { be_const_key_weak(ResponderEph_pub, 1), be_const_var(14) }, { be_const_key_weak(I2RKey, -1), be_const_var(17) }, + { be_const_key_weak(cA, 14), be_const_var(10) }, + { be_const_key_weak(parse_Sigma1, -1), be_const_closure(Matter_Commisioning_Context_parse_Sigma1_closure) }, + { be_const_key_weak(created, 18), be_const_var(16) }, + { be_const_key_weak(Matter_Context_Prefix, -1), be_nested_str_weak(CHIP_X20PAKE_X20V1_X20Commissioning) }, + { be_const_key_weak(parse_StatusReport, -1), be_const_closure(Matter_Commisioning_Context_parse_StatusReport_closure) }, + { be_const_key_weak(find_fabric_by_destination_id, -1), be_const_closure(Matter_Commisioning_Context_find_fabric_by_destination_id_closure) }, + { be_const_key_weak(pB, 22), be_const_var(9) }, + { be_const_key_weak(AttestationChallenge, 39), be_const_var(19) }, + { be_const_key_weak(every_second, -1), be_const_closure(Matter_Commisioning_Context_every_second_closure) }, + { be_const_key_weak(add_session, -1), be_const_closure(Matter_Commisioning_Context_add_session_closure) }, + { be_const_key_weak(TBEData3_Nonce, 1), be_nested_str_weak(NCASE_Sigma3N) }, + { be_const_key_weak(PBKDFParamRequest, -1), be_const_var(5) }, + { be_const_key_weak(ResponderEph_priv, -1), be_const_var(13) }, + { be_const_key_weak(PBKDFParamResponse, 4), be_const_var(6) }, + { be_const_key_weak(future_local_session_id, -1), be_const_var(4) }, + { be_const_key_weak(TBEData2_Nonce, -1), be_nested_str_weak(NCASE_Sigma2N) }, + { be_const_key_weak(responder, -1), be_const_var(0) }, + { be_const_key_weak(Ke, 12), be_const_var(12) }, + { be_const_key_weak(init, -1), be_const_closure(Matter_Commisioning_Context_init_closure) }, + { be_const_key_weak(y, -1), be_const_var(7) }, + { be_const_key_weak(S3K_Info, 10), be_nested_str_weak(Sigma3) }, + { be_const_key_weak(parse_MsgCounterSyncRsp, -1), be_const_closure(Matter_Commisioning_Context_parse_MsgCounterSyncRsp_closure) }, + { be_const_key_weak(S2K_Info, -1), be_nested_str_weak(Sigma2) }, })), be_str_weak(Matter_Commisioning_Context) ); diff --git a/lib/libesp32/berry_matter/src/solidify/solidified_Matter_Session.h b/lib/libesp32/berry_matter/src/solidify/solidified_Matter_Session.h index 079ab1222..e62cc276c 100644 --- a/lib/libesp32/berry_matter/src/solidify/solidified_Matter_Session.h +++ b/lib/libesp32/berry_matter/src/solidify/solidified_Matter_Session.h @@ -1145,227 +1145,9 @@ be_local_closure(Matter_Session_before_remove, /* name */ /******************************************************************** -** Solidified function: set_fabric_device +** Solidified function: get_fabric ********************************************************************/ -be_local_closure(Matter_Session_set_fabric_device, /* name */ - be_nested_proto( - 5, /* nstack */ - 4, /* argc */ - 2, /* varg */ - 0, /* has upvals */ - NULL, /* no upvals */ - 0, /* has sup protos */ - NULL, /* no sub protos */ - 1, /* has constants */ - ( &(const bvalue[ 4]) { /* constants */ - /* K0 */ be_nested_str_weak(_fabric), - /* K1 */ be_nested_str_weak(fabric_id), - /* K2 */ be_nested_str_weak(device_id), - /* K3 */ be_nested_str_weak(fabric_compressed), - }), - be_str_weak(set_fabric_device), - &be_const_str_solidified, - ( &(const binstruction[ 7]) { /* code */ - 0x88100100, // 0000 GETMBR R4 R0 K0 - 0x90120201, // 0001 SETMBR R4 K1 R1 - 0x88100100, // 0002 GETMBR R4 R0 K0 - 0x90120402, // 0003 SETMBR R4 K2 R2 - 0x88100100, // 0004 GETMBR R4 R0 K0 - 0x90120603, // 0005 SETMBR R4 K3 R3 - 0x80000000, // 0006 RET 0 - }) - ) -); -/*******************************************************************/ - - -/******************************************************************** -** Solidified function: init -********************************************************************/ -be_local_closure(Matter_Session_init, /* name */ - be_nested_proto( - 10, /* nstack */ - 5, /* argc */ - 2, /* varg */ - 0, /* has upvals */ - NULL, /* no upvals */ - 0, /* has sup protos */ - NULL, /* no sub protos */ - 1, /* has constants */ - ( &(const bvalue[24]) { /* constants */ - /* K0 */ be_nested_str_weak(crypto), - /* K1 */ be_nested_str_weak(_store), - /* K2 */ be_nested_str_weak(mode), - /* K3 */ be_const_int(0), - /* K4 */ be_nested_str_weak(local_session_id), - /* K5 */ be_nested_str_weak(initiator_session_id), - /* K6 */ be_nested_str_weak(_counter_snd_impl), - /* K7 */ be_nested_str_weak(matter), - /* K8 */ be_nested_str_weak(Counter), - /* K9 */ be_nested_str_weak(_counter_rcv_impl), - /* K10 */ be_nested_str_weak(counter_rcv), - /* K11 */ be_nested_str_weak(counter_snd), - /* K12 */ be_nested_str_weak(next), - /* K13 */ be_nested_str_weak(_COUNTER_SND_INCR), - /* K14 */ be_nested_str_weak(_counter_insecure_rcv), - /* K15 */ be_nested_str_weak(_counter_insecure_snd), - /* K16 */ be_nested_str_weak(_breadcrumb), - /* K17 */ be_nested_str_weak(_exchange_id), - /* K18 */ be_nested_str_weak(random), - /* K19 */ be_const_int(2), - /* K20 */ be_nested_str_weak(get), - /* K21 */ be_nested_str_weak(_fabric), - /* K22 */ be_nested_str_weak(create_fabric), - /* K23 */ be_nested_str_weak(update), - }), - be_str_weak(init), - &be_const_str_solidified, - ( &(const binstruction[47]) { /* code */ - 0xA4160000, // 0000 IMPORT R5 K0 - 0x90020201, // 0001 SETMBR R0 K1 R1 - 0x90020503, // 0002 SETMBR R0 K2 K3 - 0x90020802, // 0003 SETMBR R0 K4 R2 - 0x90020A03, // 0004 SETMBR R0 K5 R3 - 0xB81A0E00, // 0005 GETNGBL R6 K7 - 0x8C180D08, // 0006 GETMET R6 R6 K8 - 0x7C180200, // 0007 CALL R6 1 - 0x90020C06, // 0008 SETMBR R0 K6 R6 - 0xB81A0E00, // 0009 GETNGBL R6 K7 - 0x8C180D08, // 000A GETMET R6 R6 K8 - 0x7C180200, // 000B CALL R6 1 - 0x90021206, // 000C SETMBR R0 K9 R6 - 0x90021503, // 000D SETMBR R0 K10 K3 - 0x88180106, // 000E GETMBR R6 R0 K6 - 0x8C180D0C, // 000F GETMET R6 R6 K12 - 0x7C180200, // 0010 CALL R6 1 - 0x881C010D, // 0011 GETMBR R7 R0 K13 - 0x00180C07, // 0012 ADD R6 R6 R7 - 0x90021606, // 0013 SETMBR R0 K11 R6 - 0xB81A0E00, // 0014 GETNGBL R6 K7 - 0x8C180D08, // 0015 GETMET R6 R6 K8 - 0x7C180200, // 0016 CALL R6 1 - 0x90021C06, // 0017 SETMBR R0 K14 R6 - 0xB81A0E00, // 0018 GETNGBL R6 K7 - 0x8C180D08, // 0019 GETMET R6 R6 K8 - 0x7C180200, // 001A CALL R6 1 - 0x90021E06, // 001B SETMBR R0 K15 R6 - 0x90022103, // 001C SETMBR R0 K16 K3 - 0x8C180B12, // 001D GETMET R6 R5 K18 - 0x58200013, // 001E LDCONST R8 K19 - 0x7C180400, // 001F CALL R6 2 - 0x8C180D14, // 0020 GETMET R6 R6 K20 - 0x58200003, // 0021 LDCONST R8 K3 - 0x58240013, // 0022 LDCONST R9 K19 - 0x7C180600, // 0023 CALL R6 3 - 0x90022206, // 0024 SETMBR R0 K17 R6 - 0x78120001, // 0025 JMPF R4 #0028 - 0x5C180800, // 0026 MOVE R6 R4 - 0x70020002, // 0027 JMP #002B - 0x88180101, // 0028 GETMBR R6 R0 K1 - 0x8C180D16, // 0029 GETMET R6 R6 K22 - 0x7C180200, // 002A CALL R6 1 - 0x90022A06, // 002B SETMBR R0 K21 R6 - 0x8C180117, // 002C GETMET R6 R0 K23 - 0x7C180200, // 002D CALL R6 1 - 0x80000000, // 002E RET 0 - }) - ) -); -/*******************************************************************/ - - -/******************************************************************** -** Solidified function: set_mode_CASE -********************************************************************/ -be_local_closure(Matter_Session_set_mode_CASE, /* name */ - be_nested_proto( - 4, /* nstack */ - 1, /* argc */ - 2, /* varg */ - 0, /* has upvals */ - NULL, /* no upvals */ - 0, /* has sup protos */ - NULL, /* no sub protos */ - 1, /* has constants */ - ( &(const bvalue[ 2]) { /* constants */ - /* K0 */ be_nested_str_weak(set_mode), - /* K1 */ be_nested_str_weak(_CASE), - }), - be_str_weak(set_mode_CASE), - &be_const_str_solidified, - ( &(const binstruction[ 4]) { /* code */ - 0x8C040100, // 0000 GETMET R1 R0 K0 - 0x880C0101, // 0001 GETMBR R3 R0 K1 - 0x7C040400, // 0002 CALL R1 2 - 0x80000000, // 0003 RET 0 - }) - ) -); -/*******************************************************************/ - - -/******************************************************************** -** Solidified function: get_admin_vendor -********************************************************************/ -be_local_closure(Matter_Session_get_admin_vendor, /* name */ - be_nested_proto( - 2, /* nstack */ - 1, /* argc */ - 2, /* varg */ - 0, /* has upvals */ - NULL, /* no upvals */ - 0, /* has sup protos */ - NULL, /* no sub protos */ - 1, /* has constants */ - ( &(const bvalue[ 2]) { /* constants */ - /* K0 */ be_nested_str_weak(_fabric), - /* K1 */ be_nested_str_weak(admin_vendor), - }), - be_str_weak(get_admin_vendor), - &be_const_str_solidified, - ( &(const binstruction[ 3]) { /* code */ - 0x88040100, // 0000 GETMBR R1 R0 K0 - 0x88040301, // 0001 GETMBR R1 R1 K1 - 0x80040200, // 0002 RET 1 R1 - }) - ) -); -/*******************************************************************/ - - -/******************************************************************** -** Solidified function: get_fabric_id -********************************************************************/ -be_local_closure(Matter_Session_get_fabric_id, /* name */ - be_nested_proto( - 2, /* nstack */ - 1, /* argc */ - 2, /* varg */ - 0, /* has upvals */ - NULL, /* no upvals */ - 0, /* has sup protos */ - NULL, /* no sub protos */ - 1, /* has constants */ - ( &(const bvalue[ 2]) { /* constants */ - /* K0 */ be_nested_str_weak(_fabric), - /* K1 */ be_nested_str_weak(fabric_id), - }), - be_str_weak(get_fabric_id), - &be_const_str_solidified, - ( &(const binstruction[ 3]) { /* code */ - 0x88040100, // 0000 GETMBR R1 R0 K0 - 0x88040301, // 0001 GETMBR R1 R1 K1 - 0x80040200, // 0002 RET 1 R1 - }) - ) -); -/*******************************************************************/ - - -/******************************************************************** -** Solidified function: get_ac -********************************************************************/ -be_local_closure(Matter_Session_get_ac, /* name */ +be_local_closure(Matter_Session_get_fabric, /* name */ be_nested_proto( 2, /* nstack */ 1, /* argc */ @@ -1376,9 +1158,9 @@ be_local_closure(Matter_Session_get_ac, /* name */ NULL, /* no sub protos */ 1, /* has constants */ ( &(const bvalue[ 1]) { /* constants */ - /* K0 */ be_nested_str_weak(attestation_challenge), + /* K0 */ be_nested_str_weak(_fabric), }), - be_str_weak(get_ac), + be_str_weak(get_fabric), &be_const_str_solidified, ( &(const binstruction[ 2]) { /* code */ 0x88040100, // 0000 GETMBR R1 R0 K0 @@ -1389,6 +1171,104 @@ be_local_closure(Matter_Session_get_ac, /* name */ /*******************************************************************/ +/******************************************************************** +** Solidified function: persist_to_fabric +********************************************************************/ +be_local_closure(Matter_Session_persist_to_fabric, /* name */ + be_nested_proto( + 4, /* nstack */ + 1, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 2]) { /* constants */ + /* K0 */ be_nested_str_weak(_fabric), + /* K1 */ be_nested_str_weak(add_session), + }), + be_str_weak(persist_to_fabric), + &be_const_str_solidified, + ( &(const binstruction[ 5]) { /* code */ + 0x88040100, // 0000 GETMBR R1 R0 K0 + 0x8C040301, // 0001 GETMET R1 R1 K1 + 0x5C0C0000, // 0002 MOVE R3 R0 + 0x7C040400, // 0003 CALL R1 2 + 0x80000000, // 0004 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: counter_snd_next +********************************************************************/ +be_local_closure(Matter_Session_counter_snd_next, /* name */ + be_nested_proto( + 9, /* nstack */ + 1, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[15]) { /* constants */ + /* K0 */ be_nested_str_weak(string), + /* K1 */ be_nested_str_weak(_counter_snd_impl), + /* K2 */ be_nested_str_weak(next), + /* K3 */ be_nested_str_weak(tasmota), + /* K4 */ be_nested_str_weak(log), + /* K5 */ be_nested_str_weak(format), + /* K6 */ be_nested_str_weak(MTR_X3A_X20_X2E_X20_X20_X20_X20_X20_X20_X20_X20_X20_X20Counter_snd_X3D_X25i), + /* K7 */ be_const_int(3), + /* K8 */ be_nested_str_weak(matter), + /* K9 */ be_nested_str_weak(Counter), + /* K10 */ be_nested_str_weak(is_greater), + /* K11 */ be_nested_str_weak(counter_snd), + /* K12 */ be_nested_str_weak(_COUNTER_SND_INCR), + /* K13 */ be_nested_str_weak(does_persist), + /* K14 */ be_nested_str_weak(save), + }), + be_str_weak(counter_snd_next), + &be_const_str_solidified, + ( &(const binstruction[28]) { /* code */ + 0xA4060000, // 0000 IMPORT R1 K0 + 0x88080101, // 0001 GETMBR R2 R0 K1 + 0x8C080502, // 0002 GETMET R2 R2 K2 + 0x7C080200, // 0003 CALL R2 1 + 0xB80E0600, // 0004 GETNGBL R3 K3 + 0x8C0C0704, // 0005 GETMET R3 R3 K4 + 0x8C140305, // 0006 GETMET R5 R1 K5 + 0x581C0006, // 0007 LDCONST R7 K6 + 0x5C200400, // 0008 MOVE R8 R2 + 0x7C140600, // 0009 CALL R5 3 + 0x58180007, // 000A LDCONST R6 K7 + 0x7C0C0600, // 000B CALL R3 3 + 0xB80E1000, // 000C GETNGBL R3 K8 + 0x880C0709, // 000D GETMBR R3 R3 K9 + 0x8C0C070A, // 000E GETMET R3 R3 K10 + 0x5C140400, // 000F MOVE R5 R2 + 0x8818010B, // 0010 GETMBR R6 R0 K11 + 0x7C0C0600, // 0011 CALL R3 3 + 0x780E0007, // 0012 JMPF R3 #001B + 0x880C010C, // 0013 GETMBR R3 R0 K12 + 0x000C0403, // 0014 ADD R3 R2 R3 + 0x90021603, // 0015 SETMBR R0 K11 R3 + 0x8C0C010D, // 0016 GETMET R3 R0 K13 + 0x7C0C0200, // 0017 CALL R3 1 + 0x780E0001, // 0018 JMPF R3 #001B + 0x8C0C010E, // 0019 GETMET R3 R0 K14 + 0x7C0C0200, // 001A CALL R3 1 + 0x80040400, // 001B RET 1 R2 + }) + ) +); +/*******************************************************************/ + + /******************************************************************** ** Solidified function: get_ca ********************************************************************/ @@ -1419,9 +1299,9 @@ be_local_closure(Matter_Session_get_ca, /* name */ /******************************************************************** -** Solidified function: get_device_id +** Solidified function: get_mode ********************************************************************/ -be_local_closure(Matter_Session_get_device_id, /* name */ +be_local_closure(Matter_Session_get_mode, /* name */ be_nested_proto( 2, /* nstack */ 1, /* argc */ @@ -1431,345 +1311,14 @@ be_local_closure(Matter_Session_get_device_id, /* name */ 0, /* has sup protos */ NULL, /* no sub protos */ 1, /* has constants */ - ( &(const bvalue[ 2]) { /* constants */ - /* K0 */ be_nested_str_weak(_fabric), - /* K1 */ be_nested_str_weak(device_id), + ( &(const bvalue[ 1]) { /* constants */ + /* K0 */ be_nested_str_weak(mode), }), - be_str_weak(get_device_id), + be_str_weak(get_mode), &be_const_str_solidified, - ( &(const binstruction[ 3]) { /* code */ + ( &(const binstruction[ 2]) { /* code */ 0x88040100, // 0000 GETMBR R1 R0 K0 - 0x88040301, // 0001 GETMBR R1 R1 K1 - 0x80040200, // 0002 RET 1 R1 - }) - ) -); -/*******************************************************************/ - - -/******************************************************************** -** Solidified function: set_keys -********************************************************************/ -be_local_closure(Matter_Session_set_keys, /* name */ - be_nested_proto( - 6, /* nstack */ - 5, /* argc */ - 2, /* varg */ - 0, /* has upvals */ - NULL, /* no upvals */ - 0, /* has sup protos */ - NULL, /* no sub protos */ - 1, /* has constants */ - ( &(const bvalue[ 5]) { /* constants */ - /* K0 */ be_nested_str_weak(i2rkey), - /* K1 */ be_nested_str_weak(_i2r_privacy), - /* K2 */ be_nested_str_weak(r2ikey), - /* K3 */ be_nested_str_weak(attestation_challenge), - /* K4 */ be_nested_str_weak(created), - }), - be_str_weak(set_keys), - &be_const_str_solidified, - ( &(const binstruction[ 7]) { /* code */ - 0x90020001, // 0000 SETMBR R0 K0 R1 - 0x4C140000, // 0001 LDNIL R5 - 0x90020205, // 0002 SETMBR R0 K1 R5 - 0x90020402, // 0003 SETMBR R0 K2 R2 - 0x90020603, // 0004 SETMBR R0 K3 R3 - 0x90020804, // 0005 SETMBR R0 K4 R4 - 0x80000000, // 0006 RET 0 - }) - ) -); -/*******************************************************************/ - - -/******************************************************************** -** Solidified function: get_i2r_privacy -********************************************************************/ -be_local_closure(Matter_Session_get_i2r_privacy, /* name */ - be_nested_proto( - 9, /* nstack */ - 1, /* argc */ - 2, /* varg */ - 0, /* has upvals */ - NULL, /* no upvals */ - 0, /* has sup protos */ - NULL, /* no sub protos */ - 1, /* has constants */ - ( &(const bvalue[ 7]) { /* constants */ - /* K0 */ be_nested_str_weak(_i2r_privacy), - /* K1 */ be_nested_str_weak(crypto), - /* K2 */ be_nested_str_weak(HKDF_SHA256), - /* K3 */ be_nested_str_weak(derive), - /* K4 */ be_nested_str_weak(get_i2r), - /* K5 */ be_nested_str_weak(fromstring), - /* K6 */ be_nested_str_weak(PrivacyKey), - }), - be_str_weak(get_i2r_privacy), - &be_const_str_solidified, - ( &(const binstruction[22]) { /* code */ - 0x88040100, // 0000 GETMBR R1 R0 K0 - 0x4C080000, // 0001 LDNIL R2 - 0x1C040202, // 0002 EQ R1 R1 R2 - 0x7806000F, // 0003 JMPF R1 #0014 - 0xA4060200, // 0004 IMPORT R1 K1 - 0x8C080302, // 0005 GETMET R2 R1 K2 - 0x7C080200, // 0006 CALL R2 1 - 0x8C080503, // 0007 GETMET R2 R2 K3 - 0x8C100104, // 0008 GETMET R4 R0 K4 - 0x7C100200, // 0009 CALL R4 1 - 0x60140015, // 000A GETGBL R5 G21 - 0x7C140000, // 000B CALL R5 0 - 0x60180015, // 000C GETGBL R6 G21 - 0x7C180000, // 000D CALL R6 0 - 0x8C180D05, // 000E GETMET R6 R6 K5 - 0x58200006, // 000F LDCONST R8 K6 - 0x7C180400, // 0010 CALL R6 2 - 0x541E000F, // 0011 LDINT R7 16 - 0x7C080A00, // 0012 CALL R2 5 - 0x90020002, // 0013 SETMBR R0 K0 R2 - 0x88040100, // 0014 GETMBR R1 R0 K0 - 0x80040200, // 0015 RET 1 R1 - }) - ) -); -/*******************************************************************/ - - -/******************************************************************** -** Solidified function: get_ca_pub -********************************************************************/ -be_local_closure(Matter_Session_get_ca_pub, /* name */ - be_nested_proto( - 3, /* nstack */ - 1, /* argc */ - 2, /* varg */ - 0, /* has upvals */ - NULL, /* no upvals */ - 0, /* has sup protos */ - NULL, /* no sub protos */ - 1, /* has constants */ - ( &(const bvalue[ 2]) { /* constants */ - /* K0 */ be_nested_str_weak(_fabric), - /* K1 */ be_nested_str_weak(get_ca_pub), - }), - be_str_weak(get_ca_pub), - &be_const_str_solidified, - ( &(const binstruction[ 4]) { /* code */ - 0x88040100, // 0000 GETMBR R1 R0 K0 - 0x8C040301, // 0001 GETMET R1 R1 K1 - 0x7C040200, // 0002 CALL R1 1 - 0x80040200, // 0003 RET 1 R1 - }) - ) -); -/*******************************************************************/ - - -/******************************************************************** -** Solidified function: set_admin_subject_vendor -********************************************************************/ -be_local_closure(Matter_Session_set_admin_subject_vendor, /* name */ - be_nested_proto( - 4, /* nstack */ - 3, /* argc */ - 2, /* varg */ - 0, /* has upvals */ - NULL, /* no upvals */ - 0, /* has sup protos */ - NULL, /* no sub protos */ - 1, /* has constants */ - ( &(const bvalue[ 3]) { /* constants */ - /* K0 */ be_nested_str_weak(_fabric), - /* K1 */ be_nested_str_weak(admin_subject), - /* K2 */ be_nested_str_weak(admin_vendor), - }), - be_str_weak(set_admin_subject_vendor), - &be_const_str_solidified, - ( &(const binstruction[ 5]) { /* code */ - 0x880C0100, // 0000 GETMBR R3 R0 K0 - 0x900E0201, // 0001 SETMBR R3 K1 R1 - 0x880C0100, // 0002 GETMBR R3 R0 K0 - 0x900E0402, // 0003 SETMBR R3 K2 R2 - 0x80000000, // 0004 RET 0 - }) - ) -); -/*******************************************************************/ - - -/******************************************************************** -** Solidified function: get_pk -********************************************************************/ -be_local_closure(Matter_Session_get_pk, /* name */ - be_nested_proto( - 6, /* nstack */ - 1, /* argc */ - 2, /* varg */ - 0, /* has upvals */ - NULL, /* no upvals */ - 0, /* has sup protos */ - NULL, /* no sub protos */ - 1, /* has constants */ - ( &(const bvalue[ 4]) { /* constants */ - /* K0 */ be_nested_str_weak(_fabric), - /* K1 */ be_nested_str_weak(no_private_key), - /* K2 */ be_nested_str_weak(crypto), - /* K3 */ be_nested_str_weak(random), - }), - be_str_weak(get_pk), - &be_const_str_solidified, - ( &(const binstruction[12]) { /* code */ - 0x88040100, // 0000 GETMBR R1 R0 K0 - 0x88040301, // 0001 GETMBR R1 R1 K1 - 0x74060005, // 0002 JMPT R1 #0009 - 0xA4060400, // 0003 IMPORT R1 K2 - 0x88080100, // 0004 GETMBR R2 R0 K0 - 0x8C0C0303, // 0005 GETMET R3 R1 K3 - 0x5416001F, // 0006 LDINT R5 32 - 0x7C0C0400, // 0007 CALL R3 2 - 0x900A0203, // 0008 SETMBR R2 K1 R3 - 0x88040100, // 0009 GETMBR R1 R0 K0 - 0x88040301, // 000A GETMBR R1 R1 K1 - 0x80040200, // 000B RET 1 R1 - }) - ) -); -/*******************************************************************/ - - -/******************************************************************** -** Solidified function: gen_CSR -********************************************************************/ -be_local_closure(Matter_Session_gen_CSR, /* name */ - be_nested_proto( - 15, /* nstack */ - 1, /* argc */ - 2, /* varg */ - 0, /* has upvals */ - NULL, /* no upvals */ - 0, /* has sup protos */ - NULL, /* no sub protos */ - 1, /* has constants */ - ( &(const bvalue[12]) { /* constants */ - /* K0 */ be_nested_str_weak(get_pk), - /* K1 */ be_nested_str_weak(crypto), - /* K2 */ be_nested_str_weak(EC_P256), - /* K3 */ be_nested_str_weak(public_key), - /* K4 */ be_nested_str_weak(3070020100300E310C300A060355040A0C034353523059301306072A8648CE3D020106082A8648CE3D030107034200), - /* K5 */ be_nested_str_weak(A000), - /* K6 */ be_nested_str_weak(300C06082A8648CE3D0403020500), - /* K7 */ be_nested_str_weak(ecdsa_sign_sha256_asn1), - /* K8 */ be_nested_str_weak(add), - /* K9 */ be_const_int(3), - /* K10 */ be_const_int(1), - /* K11 */ be_const_int(0), - }), - be_str_weak(gen_CSR), - &be_const_str_solidified, - ( &(const binstruction[73]) { /* code */ - 0x8C040100, // 0000 GETMET R1 R0 K0 - 0x7C040200, // 0001 CALL R1 1 - 0xA40A0200, // 0002 IMPORT R2 K1 - 0x8C0C0502, // 0003 GETMET R3 R2 K2 - 0x7C0C0200, // 0004 CALL R3 1 - 0x8C100703, // 0005 GETMET R4 R3 K3 - 0x5C180200, // 0006 MOVE R6 R1 - 0x7C100400, // 0007 CALL R4 2 - 0x60140015, // 0008 GETGBL R5 G21 - 0x58180004, // 0009 LDCONST R6 K4 - 0x7C140200, // 000A CALL R5 1 - 0x40180A04, // 000B CONNECT R6 R5 R4 - 0x60180015, // 000C GETGBL R6 G21 - 0x581C0005, // 000D LDCONST R7 K5 - 0x7C180200, // 000E CALL R6 1 - 0x40180A06, // 000F CONNECT R6 R5 R6 - 0x60180015, // 0010 GETGBL R6 G21 - 0x581C0006, // 0011 LDCONST R7 K6 - 0x7C180200, // 0012 CALL R6 1 - 0x8C1C0707, // 0013 GETMET R7 R3 K7 - 0x5C240200, // 0014 MOVE R9 R1 - 0x5C280A00, // 0015 MOVE R10 R5 - 0x7C1C0600, // 0016 CALL R7 3 - 0x60200015, // 0017 GETGBL R8 G21 - 0x5426007F, // 0018 LDINT R9 128 - 0x7C200200, // 0019 CALL R8 1 - 0x8C241108, // 001A GETMET R9 R8 K8 - 0x582C0009, // 001B LDCONST R11 K9 - 0x5830000A, // 001C LDCONST R12 K10 - 0x7C240600, // 001D CALL R9 3 - 0x8C241108, // 001E GETMET R9 R8 K8 - 0x602C000C, // 001F GETGBL R11 G12 - 0x5C300E00, // 0020 MOVE R12 R7 - 0x7C2C0200, // 0021 CALL R11 1 - 0x002C170A, // 0022 ADD R11 R11 K10 - 0x5830000A, // 0023 LDCONST R12 K10 - 0x7C240600, // 0024 CALL R9 3 - 0x8C241108, // 0025 GETMET R9 R8 K8 - 0x582C000B, // 0026 LDCONST R11 K11 - 0x5830000A, // 0027 LDCONST R12 K10 - 0x7C240600, // 0028 CALL R9 3 - 0x40241007, // 0029 CONNECT R9 R8 R7 - 0x6024000C, // 002A GETGBL R9 G12 - 0x5C280A00, // 002B MOVE R10 R5 - 0x7C240200, // 002C CALL R9 1 - 0x6028000C, // 002D GETGBL R10 G12 - 0x5C2C0C00, // 002E MOVE R11 R6 - 0x7C280200, // 002F CALL R10 1 - 0x0024120A, // 0030 ADD R9 R9 R10 - 0x6028000C, // 0031 GETGBL R10 G12 - 0x5C2C1000, // 0032 MOVE R11 R8 - 0x7C280200, // 0033 CALL R10 1 - 0x0024120A, // 0034 ADD R9 R9 R10 - 0x60280015, // 0035 GETGBL R10 G21 - 0x542E00CF, // 0036 LDINT R11 208 - 0x7C280200, // 0037 CALL R10 1 - 0x8C2C1508, // 0038 GETMET R11 R10 K8 - 0x5436002F, // 0039 LDINT R13 48 - 0x5838000A, // 003A LDCONST R14 K10 - 0x7C2C0600, // 003B CALL R11 3 - 0x8C2C1508, // 003C GETMET R11 R10 K8 - 0x54360080, // 003D LDINT R13 129 - 0x5838000A, // 003E LDCONST R14 K10 - 0x7C2C0600, // 003F CALL R11 3 - 0x8C2C1508, // 0040 GETMET R11 R10 K8 - 0x543600FE, // 0041 LDINT R13 255 - 0x2C34120D, // 0042 AND R13 R9 R13 - 0x5838000A, // 0043 LDCONST R14 K10 - 0x7C2C0600, // 0044 CALL R11 3 - 0x402C1405, // 0045 CONNECT R11 R10 R5 - 0x402C1406, // 0046 CONNECT R11 R10 R6 - 0x402C1408, // 0047 CONNECT R11 R10 R8 - 0x80041400, // 0048 RET 1 R10 - }) - ) -); -/*******************************************************************/ - - -/******************************************************************** -** Solidified function: set_ca -********************************************************************/ -be_local_closure(Matter_Session_set_ca, /* name */ - be_nested_proto( - 3, /* nstack */ - 2, /* argc */ - 2, /* varg */ - 0, /* has upvals */ - NULL, /* no upvals */ - 0, /* has sup protos */ - NULL, /* no sub protos */ - 1, /* has constants */ - ( &(const bvalue[ 2]) { /* constants */ - /* K0 */ be_nested_str_weak(_fabric), - /* K1 */ be_nested_str_weak(root_ca_certificate), - }), - be_str_weak(set_ca), - &be_const_str_solidified, - ( &(const binstruction[ 3]) { /* code */ - 0x88080100, // 0000 GETMBR R2 R0 K0 - 0x900A0201, // 0001 SETMBR R2 K1 R1 - 0x80000000, // 0002 RET 0 + 0x80040200, // 0001 RET 1 R1 }) ) ); @@ -1920,6 +1469,157 @@ be_local_closure(Matter_Session_tojson, /* name */ /*******************************************************************/ +/******************************************************************** +** Solidified function: assign_fabric_index +********************************************************************/ +be_local_closure(Matter_Session_assign_fabric_index, /* name */ + be_nested_proto( + 5, /* nstack */ + 1, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 5]) { /* constants */ + /* K0 */ be_nested_str_weak(_fabric), + /* K1 */ be_nested_str_weak(get_fabric_index), + /* K2 */ be_nested_str_weak(set_fabric_index), + /* K3 */ be_nested_str_weak(_store), + /* K4 */ be_nested_str_weak(next_fabric_idx), + }), + be_str_weak(assign_fabric_index), + &be_const_str_solidified, + ( &(const binstruction[13]) { /* code */ + 0x88040100, // 0000 GETMBR R1 R0 K0 + 0x8C040301, // 0001 GETMET R1 R1 K1 + 0x7C040200, // 0002 CALL R1 1 + 0x4C080000, // 0003 LDNIL R2 + 0x1C040202, // 0004 EQ R1 R1 R2 + 0x78060005, // 0005 JMPF R1 #000C + 0x88040100, // 0006 GETMBR R1 R0 K0 + 0x8C040302, // 0007 GETMET R1 R1 K2 + 0x880C0103, // 0008 GETMBR R3 R0 K3 + 0x8C0C0704, // 0009 GETMET R3 R3 K4 + 0x7C0C0200, // 000A CALL R3 1 + 0x7C040400, // 000B CALL R1 2 + 0x80000000, // 000C RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: gen_CSR +********************************************************************/ +be_local_closure(Matter_Session_gen_CSR, /* name */ + be_nested_proto( + 15, /* nstack */ + 1, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[12]) { /* constants */ + /* K0 */ be_nested_str_weak(get_pk), + /* K1 */ be_nested_str_weak(crypto), + /* K2 */ be_nested_str_weak(EC_P256), + /* K3 */ be_nested_str_weak(public_key), + /* K4 */ be_nested_str_weak(3070020100300E310C300A060355040A0C034353523059301306072A8648CE3D020106082A8648CE3D030107034200), + /* K5 */ be_nested_str_weak(A000), + /* K6 */ be_nested_str_weak(300C06082A8648CE3D0403020500), + /* K7 */ be_nested_str_weak(ecdsa_sign_sha256_asn1), + /* K8 */ be_nested_str_weak(add), + /* K9 */ be_const_int(3), + /* K10 */ be_const_int(1), + /* K11 */ be_const_int(0), + }), + be_str_weak(gen_CSR), + &be_const_str_solidified, + ( &(const binstruction[73]) { /* code */ + 0x8C040100, // 0000 GETMET R1 R0 K0 + 0x7C040200, // 0001 CALL R1 1 + 0xA40A0200, // 0002 IMPORT R2 K1 + 0x8C0C0502, // 0003 GETMET R3 R2 K2 + 0x7C0C0200, // 0004 CALL R3 1 + 0x8C100703, // 0005 GETMET R4 R3 K3 + 0x5C180200, // 0006 MOVE R6 R1 + 0x7C100400, // 0007 CALL R4 2 + 0x60140015, // 0008 GETGBL R5 G21 + 0x58180004, // 0009 LDCONST R6 K4 + 0x7C140200, // 000A CALL R5 1 + 0x40180A04, // 000B CONNECT R6 R5 R4 + 0x60180015, // 000C GETGBL R6 G21 + 0x581C0005, // 000D LDCONST R7 K5 + 0x7C180200, // 000E CALL R6 1 + 0x40180A06, // 000F CONNECT R6 R5 R6 + 0x60180015, // 0010 GETGBL R6 G21 + 0x581C0006, // 0011 LDCONST R7 K6 + 0x7C180200, // 0012 CALL R6 1 + 0x8C1C0707, // 0013 GETMET R7 R3 K7 + 0x5C240200, // 0014 MOVE R9 R1 + 0x5C280A00, // 0015 MOVE R10 R5 + 0x7C1C0600, // 0016 CALL R7 3 + 0x60200015, // 0017 GETGBL R8 G21 + 0x5426007F, // 0018 LDINT R9 128 + 0x7C200200, // 0019 CALL R8 1 + 0x8C241108, // 001A GETMET R9 R8 K8 + 0x582C0009, // 001B LDCONST R11 K9 + 0x5830000A, // 001C LDCONST R12 K10 + 0x7C240600, // 001D CALL R9 3 + 0x8C241108, // 001E GETMET R9 R8 K8 + 0x602C000C, // 001F GETGBL R11 G12 + 0x5C300E00, // 0020 MOVE R12 R7 + 0x7C2C0200, // 0021 CALL R11 1 + 0x002C170A, // 0022 ADD R11 R11 K10 + 0x5830000A, // 0023 LDCONST R12 K10 + 0x7C240600, // 0024 CALL R9 3 + 0x8C241108, // 0025 GETMET R9 R8 K8 + 0x582C000B, // 0026 LDCONST R11 K11 + 0x5830000A, // 0027 LDCONST R12 K10 + 0x7C240600, // 0028 CALL R9 3 + 0x40241007, // 0029 CONNECT R9 R8 R7 + 0x6024000C, // 002A GETGBL R9 G12 + 0x5C280A00, // 002B MOVE R10 R5 + 0x7C240200, // 002C CALL R9 1 + 0x6028000C, // 002D GETGBL R10 G12 + 0x5C2C0C00, // 002E MOVE R11 R6 + 0x7C280200, // 002F CALL R10 1 + 0x0024120A, // 0030 ADD R9 R9 R10 + 0x6028000C, // 0031 GETGBL R10 G12 + 0x5C2C1000, // 0032 MOVE R11 R8 + 0x7C280200, // 0033 CALL R10 1 + 0x0024120A, // 0034 ADD R9 R9 R10 + 0x60280015, // 0035 GETGBL R10 G21 + 0x542E00CF, // 0036 LDINT R11 208 + 0x7C280200, // 0037 CALL R10 1 + 0x8C2C1508, // 0038 GETMET R11 R10 K8 + 0x5436002F, // 0039 LDINT R13 48 + 0x5838000A, // 003A LDCONST R14 K10 + 0x7C2C0600, // 003B CALL R11 3 + 0x8C2C1508, // 003C GETMET R11 R10 K8 + 0x54360080, // 003D LDINT R13 129 + 0x5838000A, // 003E LDCONST R14 K10 + 0x7C2C0600, // 003F CALL R11 3 + 0x8C2C1508, // 0040 GETMET R11 R10 K8 + 0x543600FE, // 0041 LDINT R13 255 + 0x2C34120D, // 0042 AND R13 R9 R13 + 0x5838000A, // 0043 LDCONST R14 K10 + 0x7C2C0600, // 0044 CALL R11 3 + 0x402C1405, // 0045 CONNECT R11 R10 R5 + 0x402C1406, // 0046 CONNECT R11 R10 R6 + 0x402C1408, // 0047 CONNECT R11 R10 R8 + 0x80041400, // 0048 RET 1 R10 + }) + ) +); +/*******************************************************************/ + + /******************************************************************** ** Solidified function: fabric_candidate ********************************************************************/ @@ -1933,24 +1633,27 @@ be_local_closure(Matter_Session_fabric_candidate, /* name */ 0, /* has sup protos */ NULL, /* no sub protos */ 1, /* has constants */ - ( &(const bvalue[ 4]) { /* constants */ + ( &(const bvalue[ 5]) { /* constants */ /* K0 */ be_nested_str_weak(_fabric), /* K1 */ be_nested_str_weak(set_expire_in_seconds), - /* K2 */ be_nested_str_weak(_store), - /* K3 */ be_nested_str_weak(add_fabric), + /* K2 */ be_nested_str_weak(assign_fabric_index), + /* K3 */ be_nested_str_weak(_store), + /* K4 */ be_nested_str_weak(add_fabric), }), be_str_weak(fabric_candidate), &be_const_str_solidified, - ( &(const binstruction[ 9]) { /* code */ + ( &(const binstruction[11]) { /* code */ 0x88040100, // 0000 GETMBR R1 R0 K0 0x8C040301, // 0001 GETMET R1 R1 K1 0x540E0077, // 0002 LDINT R3 120 0x7C040400, // 0003 CALL R1 2 - 0x88040102, // 0004 GETMBR R1 R0 K2 - 0x8C040303, // 0005 GETMET R1 R1 K3 - 0x880C0100, // 0006 GETMBR R3 R0 K0 - 0x7C040400, // 0007 CALL R1 2 - 0x80000000, // 0008 RET 0 + 0x8C040102, // 0004 GETMET R1 R0 K2 + 0x7C040200, // 0005 CALL R1 1 + 0x88040103, // 0006 GETMBR R1 R0 K3 + 0x8C040304, // 0007 GETMET R1 R1 K4 + 0x880C0100, // 0008 GETMBR R3 R0 K0 + 0x7C040400, // 0009 CALL R1 2 + 0x80000000, // 000A RET 0 }) ) ); @@ -1958,11 +1661,11 @@ be_local_closure(Matter_Session_fabric_candidate, /* name */ /******************************************************************** -** Solidified function: counter_snd_next +** Solidified function: close ********************************************************************/ -be_local_closure(Matter_Session_counter_snd_next, /* name */ +be_local_closure(Matter_Session_close, /* name */ be_nested_proto( - 9, /* nstack */ + 8, /* nstack */ 1, /* argc */ 2, /* varg */ 0, /* has upvals */ @@ -1970,54 +1673,403 @@ be_local_closure(Matter_Session_counter_snd_next, /* name */ 0, /* has sup protos */ NULL, /* no sub protos */ 1, /* has constants */ - ( &(const bvalue[15]) { /* constants */ - /* K0 */ be_nested_str_weak(string), - /* K1 */ be_nested_str_weak(_counter_snd_impl), - /* K2 */ be_nested_str_weak(next), - /* K3 */ be_nested_str_weak(tasmota), - /* K4 */ be_nested_str_weak(log), - /* K5 */ be_nested_str_weak(format), - /* K6 */ be_nested_str_weak(MTR_X3A_X20_X2E_X20_X20_X20_X20_X20_X20_X20_X20_X20_X20Counter_snd_X3D_X25i), - /* K7 */ be_const_int(3), - /* K8 */ be_nested_str_weak(matter), - /* K9 */ be_nested_str_weak(Counter), - /* K10 */ be_nested_str_weak(is_greater), - /* K11 */ be_nested_str_weak(counter_snd), - /* K12 */ be_nested_str_weak(_COUNTER_SND_INCR), - /* K13 */ be_nested_str_weak(does_persist), - /* K14 */ be_nested_str_weak(save), + ( &(const bvalue[23]) { /* constants */ + /* K0 */ be_nested_str_weak(local_session_id), + /* K1 */ be_nested_str_weak(__future_local_session_id), + /* K2 */ be_nested_str_weak(initiator_session_id), + /* K3 */ be_nested_str_weak(__future_initiator_session_id), + /* K4 */ be_nested_str_weak(_counter_rcv_impl), + /* K5 */ be_nested_str_weak(reset), + /* K6 */ be_nested_str_weak(_counter_snd_impl), + /* K7 */ be_nested_str_weak(counter_rcv), + /* K8 */ be_const_int(0), + /* K9 */ be_nested_str_weak(counter_snd), + /* K10 */ be_nested_str_weak(next), + /* K11 */ be_nested_str_weak(i2rkey), + /* K12 */ be_nested_str_weak(_i2r_privacy), + /* K13 */ be_nested_str_weak(r2ikey), + /* K14 */ be_nested_str_weak(attestation_challenge), + /* K15 */ be_nested_str_weak(introspect), + /* K16 */ be_nested_str_weak(members), + /* K17 */ be_nested_str_weak(get), + /* K18 */ be_nested_str_weak(function), + /* K19 */ be_nested_str_weak(instance), + /* K20 */ be_nested_str_weak(_), + /* K21 */ be_const_int(1), + /* K22 */ be_nested_str_weak(stop_iteration), }), - be_str_weak(counter_snd_next), + be_str_weak(close), &be_const_str_solidified, - ( &(const binstruction[28]) { /* code */ - 0xA4060000, // 0000 IMPORT R1 K0 - 0x88080101, // 0001 GETMBR R2 R0 K1 - 0x8C080502, // 0002 GETMET R2 R2 K2 - 0x7C080200, // 0003 CALL R2 1 - 0xB80E0600, // 0004 GETNGBL R3 K3 - 0x8C0C0704, // 0005 GETMET R3 R3 K4 - 0x8C140305, // 0006 GETMET R5 R1 K5 - 0x581C0006, // 0007 LDCONST R7 K6 - 0x5C200400, // 0008 MOVE R8 R2 - 0x7C140600, // 0009 CALL R5 3 - 0x58180007, // 000A LDCONST R6 K7 - 0x7C0C0600, // 000B CALL R3 3 - 0xB80E1000, // 000C GETNGBL R3 K8 - 0x880C0709, // 000D GETMBR R3 R3 K9 - 0x8C0C070A, // 000E GETMET R3 R3 K10 - 0x5C140400, // 000F MOVE R5 R2 - 0x8818010B, // 0010 GETMBR R6 R0 K11 - 0x7C0C0600, // 0011 CALL R3 3 - 0x780E0007, // 0012 JMPF R3 #001B - 0x880C010C, // 0013 GETMBR R3 R0 K12 - 0x000C0403, // 0014 ADD R3 R2 R3 - 0x90021603, // 0015 SETMBR R0 K11 R3 - 0x8C0C010D, // 0016 GETMET R3 R0 K13 - 0x7C0C0200, // 0017 CALL R3 1 - 0x780E0001, // 0018 JMPF R3 #001B - 0x8C0C010E, // 0019 GETMET R3 R0 K14 - 0x7C0C0200, // 001A CALL R3 1 - 0x80040400, // 001B RET 1 R2 + ( &(const binstruction[59]) { /* code */ + 0x88040101, // 0000 GETMBR R1 R0 K1 + 0x90020001, // 0001 SETMBR R0 K0 R1 + 0x88040103, // 0002 GETMBR R1 R0 K3 + 0x90020401, // 0003 SETMBR R0 K2 R1 + 0x88040104, // 0004 GETMBR R1 R0 K4 + 0x8C040305, // 0005 GETMET R1 R1 K5 + 0x7C040200, // 0006 CALL R1 1 + 0x88040106, // 0007 GETMBR R1 R0 K6 + 0x8C040305, // 0008 GETMET R1 R1 K5 + 0x7C040200, // 0009 CALL R1 1 + 0x90020F08, // 000A SETMBR R0 K7 K8 + 0x88040106, // 000B GETMBR R1 R0 K6 + 0x8C04030A, // 000C GETMET R1 R1 K10 + 0x7C040200, // 000D CALL R1 1 + 0x90021201, // 000E SETMBR R0 K9 R1 + 0x4C040000, // 000F LDNIL R1 + 0x90021601, // 0010 SETMBR R0 K11 R1 + 0x4C040000, // 0011 LDNIL R1 + 0x90021801, // 0012 SETMBR R0 K12 R1 + 0x4C040000, // 0013 LDNIL R1 + 0x90021A01, // 0014 SETMBR R0 K13 R1 + 0x4C040000, // 0015 LDNIL R1 + 0x90021C01, // 0016 SETMBR R0 K14 R1 + 0xA4061E00, // 0017 IMPORT R1 K15 + 0x60080010, // 0018 GETGBL R2 G16 + 0x8C0C0310, // 0019 GETMET R3 R1 K16 + 0x5C140000, // 001A MOVE R5 R0 + 0x7C0C0400, // 001B CALL R3 2 + 0x7C080200, // 001C CALL R2 1 + 0xA8020018, // 001D EXBLK 0 #0037 + 0x5C0C0400, // 001E MOVE R3 R2 + 0x7C0C0000, // 001F CALL R3 0 + 0x8C100311, // 0020 GETMET R4 R1 K17 + 0x5C180000, // 0021 MOVE R6 R0 + 0x5C1C0600, // 0022 MOVE R7 R3 + 0x7C100600, // 0023 CALL R4 3 + 0x60140004, // 0024 GETGBL R5 G4 + 0x5C180800, // 0025 MOVE R6 R4 + 0x7C140200, // 0026 CALL R5 1 + 0x20140B12, // 0027 NE R5 R5 K18 + 0x7816000C, // 0028 JMPF R5 #0036 + 0x60140004, // 0029 GETGBL R5 G4 + 0x5C180800, // 002A MOVE R6 R4 + 0x7C140200, // 002B CALL R5 1 + 0x20140B13, // 002C NE R5 R5 K19 + 0x78160007, // 002D JMPF R5 #0036 + 0x94140708, // 002E GETIDX R5 R3 K8 + 0x1C140B14, // 002F EQ R5 R5 K20 + 0x78160004, // 0030 JMPF R5 #0036 + 0x94140715, // 0031 GETIDX R5 R3 K21 + 0x1C140B14, // 0032 EQ R5 R5 K20 + 0x78160001, // 0033 JMPF R5 #0036 + 0x4C140000, // 0034 LDNIL R5 + 0x90000605, // 0035 SETMBR R0 R3 R5 + 0x7001FFE6, // 0036 JMP #001E + 0x58080016, // 0037 LDCONST R2 K22 + 0xAC080200, // 0038 CATCH R2 1 0 + 0xB0080000, // 0039 RAISE 2 R0 R0 + 0x80000000, // 003A RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: hydrate_post +********************************************************************/ +be_local_closure(Matter_Session_hydrate_post, /* name */ + be_nested_proto( + 4, /* nstack */ + 1, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 6]) { /* constants */ + /* K0 */ be_nested_str_weak(_counter_snd_impl), + /* K1 */ be_nested_str_weak(reset), + /* K2 */ be_nested_str_weak(counter_snd), + /* K3 */ be_nested_str_weak(_counter_rcv_impl), + /* K4 */ be_nested_str_weak(counter_rcv), + /* K5 */ be_nested_str_weak(val), + }), + be_str_weak(hydrate_post), + &be_const_str_solidified, + ( &(const binstruction[17]) { /* code */ + 0x88040100, // 0000 GETMBR R1 R0 K0 + 0x8C040301, // 0001 GETMET R1 R1 K1 + 0x880C0102, // 0002 GETMBR R3 R0 K2 + 0x7C040400, // 0003 CALL R1 2 + 0x88040103, // 0004 GETMBR R1 R0 K3 + 0x8C040301, // 0005 GETMET R1 R1 K1 + 0x880C0104, // 0006 GETMBR R3 R0 K4 + 0x7C040400, // 0007 CALL R1 2 + 0x88040100, // 0008 GETMBR R1 R0 K0 + 0x8C040305, // 0009 GETMET R1 R1 K5 + 0x7C040200, // 000A CALL R1 1 + 0x90020401, // 000B SETMBR R0 K2 R1 + 0x88040103, // 000C GETMBR R1 R0 K3 + 0x8C040305, // 000D GETMET R1 R1 K5 + 0x7C040200, // 000E CALL R1 1 + 0x90020801, // 000F SETMBR R0 K4 R1 + 0x80000000, // 0010 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: get_r2i +********************************************************************/ +be_local_closure(Matter_Session_get_r2i, /* name */ + be_nested_proto( + 2, /* nstack */ + 1, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 1]) { /* constants */ + /* K0 */ be_nested_str_weak(r2ikey), + }), + be_str_weak(get_r2i), + &be_const_str_solidified, + ( &(const binstruction[ 2]) { /* code */ + 0x88040100, // 0000 GETMBR R1 R0 K0 + 0x80040200, // 0001 RET 1 R1 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: set_mode +********************************************************************/ +be_local_closure(Matter_Session_set_mode, /* name */ + be_nested_proto( + 2, /* nstack */ + 2, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 1]) { /* constants */ + /* K0 */ be_nested_str_weak(mode), + }), + be_str_weak(set_mode), + &be_const_str_solidified, + ( &(const binstruction[ 2]) { /* code */ + 0x90020001, // 0000 SETMBR R0 K0 R1 + 0x80000000, // 0001 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: set_mode_CASE +********************************************************************/ +be_local_closure(Matter_Session_set_mode_CASE, /* name */ + be_nested_proto( + 4, /* nstack */ + 1, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 2]) { /* constants */ + /* K0 */ be_nested_str_weak(set_mode), + /* K1 */ be_nested_str_weak(_CASE), + }), + be_str_weak(set_mode_CASE), + &be_const_str_solidified, + ( &(const binstruction[ 4]) { /* code */ + 0x8C040100, // 0000 GETMET R1 R0 K0 + 0x880C0101, // 0001 GETMBR R3 R0 K1 + 0x7C040400, // 0002 CALL R1 2 + 0x80000000, // 0003 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: set_fabric_label +********************************************************************/ +be_local_closure(Matter_Session_set_fabric_label, /* name */ + be_nested_proto( + 4, /* nstack */ + 2, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 3]) { /* constants */ + /* K0 */ be_nested_str_weak(string), + /* K1 */ be_nested_str_weak(_fabric), + /* K2 */ be_nested_str_weak(fabric_label), + }), + be_str_weak(set_fabric_label), + &be_const_str_solidified, + ( &(const binstruction[ 8]) { /* code */ + 0x60080004, // 0000 GETGBL R2 G4 + 0x5C0C0200, // 0001 MOVE R3 R1 + 0x7C080200, // 0002 CALL R2 1 + 0x1C080500, // 0003 EQ R2 R2 K0 + 0x780A0001, // 0004 JMPF R2 #0007 + 0x88080101, // 0005 GETMBR R2 R0 K1 + 0x900A0401, // 0006 SETMBR R2 K2 R1 + 0x80000000, // 0007 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: get_fabric_label +********************************************************************/ +be_local_closure(Matter_Session_get_fabric_label, /* name */ + be_nested_proto( + 2, /* nstack */ + 1, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 2]) { /* constants */ + /* K0 */ be_nested_str_weak(_fabric), + /* K1 */ be_nested_str_weak(fabric_label), + }), + be_str_weak(get_fabric_label), + &be_const_str_solidified, + ( &(const binstruction[ 3]) { /* code */ + 0x88040100, // 0000 GETMBR R1 R0 K0 + 0x88040301, // 0001 GETMBR R1 R1 K1 + 0x80040200, // 0002 RET 1 R1 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: save +********************************************************************/ +be_local_closure(Matter_Session_save, /* name */ + be_nested_proto( + 3, /* nstack */ + 1, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 2]) { /* constants */ + /* K0 */ be_nested_str_weak(_store), + /* K1 */ be_nested_str_weak(save_fabrics), + }), + be_str_weak(save), + &be_const_str_solidified, + ( &(const binstruction[ 4]) { /* code */ + 0x88040100, // 0000 GETMBR R1 R0 K0 + 0x8C040301, // 0001 GETMET R1 R1 K1 + 0x7C040200, // 0002 CALL R1 1 + 0x80000000, // 0003 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: get_ac +********************************************************************/ +be_local_closure(Matter_Session_get_ac, /* name */ + be_nested_proto( + 2, /* nstack */ + 1, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 1]) { /* constants */ + /* K0 */ be_nested_str_weak(attestation_challenge), + }), + be_str_weak(get_ac), + &be_const_str_solidified, + ( &(const binstruction[ 2]) { /* code */ + 0x88040100, // 0000 GETMBR R1 R0 K0 + 0x80040200, // 0001 RET 1 R1 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: get_device_id +********************************************************************/ +be_local_closure(Matter_Session_get_device_id, /* name */ + be_nested_proto( + 2, /* nstack */ + 1, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 2]) { /* constants */ + /* K0 */ be_nested_str_weak(_fabric), + /* K1 */ be_nested_str_weak(device_id), + }), + be_str_weak(get_device_id), + &be_const_str_solidified, + ( &(const binstruction[ 3]) { /* code */ + 0x88040100, // 0000 GETMBR R1 R0 K0 + 0x88040301, // 0001 GETMBR R1 R1 K1 + 0x80040200, // 0002 RET 1 R1 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: set_ipk_epoch_key +********************************************************************/ +be_local_closure(Matter_Session_set_ipk_epoch_key, /* name */ + be_nested_proto( + 3, /* nstack */ + 2, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 2]) { /* constants */ + /* K0 */ be_nested_str_weak(_fabric), + /* K1 */ be_nested_str_weak(ipk_epoch_key), + }), + be_str_weak(set_ipk_epoch_key), + &be_const_str_solidified, + ( &(const binstruction[ 3]) { /* code */ + 0x88080100, // 0000 GETMBR R2 R0 K0 + 0x900A0201, // 0001 SETMBR R2 K1 R1 + 0x80000000, // 0002 RET 0 }) ) ); @@ -2141,131 +2193,94 @@ be_local_closure(Matter_Session_fromjson, /* name */ /******************************************************************** -** Solidified function: fabric_completed +** Solidified function: init ********************************************************************/ -be_local_closure(Matter_Session_fabric_completed, /* name */ +be_local_closure(Matter_Session_init, /* name */ be_nested_proto( - 5, /* nstack */ - 1, /* argc */ + 10, /* nstack */ + 5, /* argc */ 2, /* varg */ 0, /* has upvals */ NULL, /* no upvals */ 0, /* has sup protos */ NULL, /* no sub protos */ 1, /* has constants */ - ( &(const bvalue[ 8]) { /* constants */ - /* K0 */ be_nested_str_weak(_fabric), - /* K1 */ be_nested_str_weak(set_no_expiration), - /* K2 */ be_nested_str_weak(set_persist), - /* K3 */ be_nested_str_weak(get_fabric_index), - /* K4 */ be_nested_str_weak(set_fabric_index), - /* K5 */ be_nested_str_weak(_store), - /* K6 */ be_nested_str_weak(next_fabric_idx), - /* K7 */ be_nested_str_weak(add_fabric), + ( &(const bvalue[24]) { /* constants */ + /* K0 */ be_nested_str_weak(crypto), + /* K1 */ be_nested_str_weak(_store), + /* K2 */ be_nested_str_weak(mode), + /* K3 */ be_const_int(0), + /* K4 */ be_nested_str_weak(local_session_id), + /* K5 */ be_nested_str_weak(initiator_session_id), + /* K6 */ be_nested_str_weak(_counter_snd_impl), + /* K7 */ be_nested_str_weak(matter), + /* K8 */ be_nested_str_weak(Counter), + /* K9 */ be_nested_str_weak(_counter_rcv_impl), + /* K10 */ be_nested_str_weak(counter_rcv), + /* K11 */ be_nested_str_weak(counter_snd), + /* K12 */ be_nested_str_weak(next), + /* K13 */ be_nested_str_weak(_COUNTER_SND_INCR), + /* K14 */ be_nested_str_weak(_counter_insecure_rcv), + /* K15 */ be_nested_str_weak(_counter_insecure_snd), + /* K16 */ be_nested_str_weak(_breadcrumb), + /* K17 */ be_nested_str_weak(_exchange_id), + /* K18 */ be_nested_str_weak(random), + /* K19 */ be_const_int(2), + /* K20 */ be_nested_str_weak(get), + /* K21 */ be_nested_str_weak(_fabric), + /* K22 */ be_nested_str_weak(create_fabric), + /* K23 */ be_nested_str_weak(update), }), - be_str_weak(fabric_completed), + be_str_weak(init), &be_const_str_solidified, - ( &(const binstruction[24]) { /* code */ - 0x88040100, // 0000 GETMBR R1 R0 K0 - 0x8C040301, // 0001 GETMET R1 R1 K1 - 0x7C040200, // 0002 CALL R1 1 - 0x88040100, // 0003 GETMBR R1 R0 K0 - 0x8C040302, // 0004 GETMET R1 R1 K2 - 0x500C0200, // 0005 LDBOOL R3 1 0 - 0x7C040400, // 0006 CALL R1 2 - 0x88040100, // 0007 GETMBR R1 R0 K0 - 0x8C040303, // 0008 GETMET R1 R1 K3 - 0x7C040200, // 0009 CALL R1 1 - 0x4C080000, // 000A LDNIL R2 - 0x1C040202, // 000B EQ R1 R1 R2 - 0x78060005, // 000C JMPF R1 #0013 - 0x88040100, // 000D GETMBR R1 R0 K0 - 0x8C040304, // 000E GETMET R1 R1 K4 - 0x880C0105, // 000F GETMBR R3 R0 K5 - 0x8C0C0706, // 0010 GETMET R3 R3 K6 - 0x7C0C0200, // 0011 CALL R3 1 - 0x7C040400, // 0012 CALL R1 2 - 0x88040105, // 0013 GETMBR R1 R0 K5 - 0x8C040307, // 0014 GETMET R1 R1 K7 - 0x880C0100, // 0015 GETMBR R3 R0 K0 - 0x7C040400, // 0016 CALL R1 2 - 0x80000000, // 0017 RET 0 - }) - ) -); -/*******************************************************************/ - - -/******************************************************************** -** Solidified function: hydrate_post -********************************************************************/ -be_local_closure(Matter_Session_hydrate_post, /* name */ - be_nested_proto( - 4, /* nstack */ - 1, /* argc */ - 2, /* varg */ - 0, /* has upvals */ - NULL, /* no upvals */ - 0, /* has sup protos */ - NULL, /* no sub protos */ - 1, /* has constants */ - ( &(const bvalue[ 6]) { /* constants */ - /* K0 */ be_nested_str_weak(_counter_snd_impl), - /* K1 */ be_nested_str_weak(reset), - /* K2 */ be_nested_str_weak(counter_snd), - /* K3 */ be_nested_str_weak(_counter_rcv_impl), - /* K4 */ be_nested_str_weak(counter_rcv), - /* K5 */ be_nested_str_weak(val), - }), - be_str_weak(hydrate_post), - &be_const_str_solidified, - ( &(const binstruction[17]) { /* code */ - 0x88040100, // 0000 GETMBR R1 R0 K0 - 0x8C040301, // 0001 GETMET R1 R1 K1 - 0x880C0102, // 0002 GETMBR R3 R0 K2 - 0x7C040400, // 0003 CALL R1 2 - 0x88040103, // 0004 GETMBR R1 R0 K3 - 0x8C040301, // 0005 GETMET R1 R1 K1 - 0x880C0104, // 0006 GETMBR R3 R0 K4 - 0x7C040400, // 0007 CALL R1 2 - 0x88040100, // 0008 GETMBR R1 R0 K0 - 0x8C040305, // 0009 GETMET R1 R1 K5 - 0x7C040200, // 000A CALL R1 1 - 0x90020401, // 000B SETMBR R0 K2 R1 - 0x88040103, // 000C GETMBR R1 R0 K3 - 0x8C040305, // 000D GETMET R1 R1 K5 - 0x7C040200, // 000E CALL R1 1 - 0x90020801, // 000F SETMBR R0 K4 R1 - 0x80000000, // 0010 RET 0 - }) - ) -); -/*******************************************************************/ - - -/******************************************************************** -** Solidified function: set_ipk_epoch_key -********************************************************************/ -be_local_closure(Matter_Session_set_ipk_epoch_key, /* name */ - be_nested_proto( - 3, /* nstack */ - 2, /* argc */ - 2, /* varg */ - 0, /* has upvals */ - NULL, /* no upvals */ - 0, /* has sup protos */ - NULL, /* no sub protos */ - 1, /* has constants */ - ( &(const bvalue[ 2]) { /* constants */ - /* K0 */ be_nested_str_weak(_fabric), - /* K1 */ be_nested_str_weak(ipk_epoch_key), - }), - be_str_weak(set_ipk_epoch_key), - &be_const_str_solidified, - ( &(const binstruction[ 3]) { /* code */ - 0x88080100, // 0000 GETMBR R2 R0 K0 - 0x900A0201, // 0001 SETMBR R2 K1 R1 - 0x80000000, // 0002 RET 0 + ( &(const binstruction[47]) { /* code */ + 0xA4160000, // 0000 IMPORT R5 K0 + 0x90020201, // 0001 SETMBR R0 K1 R1 + 0x90020503, // 0002 SETMBR R0 K2 K3 + 0x90020802, // 0003 SETMBR R0 K4 R2 + 0x90020A03, // 0004 SETMBR R0 K5 R3 + 0xB81A0E00, // 0005 GETNGBL R6 K7 + 0x8C180D08, // 0006 GETMET R6 R6 K8 + 0x7C180200, // 0007 CALL R6 1 + 0x90020C06, // 0008 SETMBR R0 K6 R6 + 0xB81A0E00, // 0009 GETNGBL R6 K7 + 0x8C180D08, // 000A GETMET R6 R6 K8 + 0x7C180200, // 000B CALL R6 1 + 0x90021206, // 000C SETMBR R0 K9 R6 + 0x90021503, // 000D SETMBR R0 K10 K3 + 0x88180106, // 000E GETMBR R6 R0 K6 + 0x8C180D0C, // 000F GETMET R6 R6 K12 + 0x7C180200, // 0010 CALL R6 1 + 0x881C010D, // 0011 GETMBR R7 R0 K13 + 0x00180C07, // 0012 ADD R6 R6 R7 + 0x90021606, // 0013 SETMBR R0 K11 R6 + 0xB81A0E00, // 0014 GETNGBL R6 K7 + 0x8C180D08, // 0015 GETMET R6 R6 K8 + 0x7C180200, // 0016 CALL R6 1 + 0x90021C06, // 0017 SETMBR R0 K14 R6 + 0xB81A0E00, // 0018 GETNGBL R6 K7 + 0x8C180D08, // 0019 GETMET R6 R6 K8 + 0x7C180200, // 001A CALL R6 1 + 0x90021E06, // 001B SETMBR R0 K15 R6 + 0x90022103, // 001C SETMBR R0 K16 K3 + 0x8C180B12, // 001D GETMET R6 R5 K18 + 0x58200013, // 001E LDCONST R8 K19 + 0x7C180400, // 001F CALL R6 2 + 0x8C180D14, // 0020 GETMET R6 R6 K20 + 0x58200003, // 0021 LDCONST R8 K3 + 0x58240013, // 0022 LDCONST R9 K19 + 0x7C180600, // 0023 CALL R6 3 + 0x90022206, // 0024 SETMBR R0 K17 R6 + 0x78120001, // 0025 JMPF R4 #0028 + 0x5C180800, // 0026 MOVE R6 R4 + 0x70020002, // 0027 JMP #002B + 0x88180101, // 0028 GETMBR R6 R0 K1 + 0x8C180D16, // 0029 GETMET R6 R6 K22 + 0x7C180200, // 002A CALL R6 1 + 0x90022A06, // 002B SETMBR R0 K21 R6 + 0x8C180117, // 002C GETMET R6 R0 K23 + 0x7C180200, // 002D CALL R6 1 + 0x80000000, // 002E RET 0 }) ) ); @@ -2307,9 +2322,39 @@ be_local_closure(Matter_Session_update, /* name */ /******************************************************************** -** Solidified function: get_fabric_compressed +** Solidified function: is_PASE ********************************************************************/ -be_local_closure(Matter_Session_get_fabric_compressed, /* name */ +be_local_closure(Matter_Session_is_PASE, /* name */ + be_nested_proto( + 3, /* nstack */ + 1, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 2]) { /* constants */ + /* K0 */ be_nested_str_weak(mode), + /* K1 */ be_nested_str_weak(_PASE), + }), + be_str_weak(is_PASE), + &be_const_str_solidified, + ( &(const binstruction[ 4]) { /* code */ + 0x88040100, // 0000 GETMBR R1 R0 K0 + 0x88080101, // 0001 GETMBR R2 R0 K1 + 0x1C040202, // 0002 EQ R1 R1 R2 + 0x80040200, // 0003 RET 1 R1 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: get_i2r +********************************************************************/ +be_local_closure(Matter_Session_get_i2r, /* name */ be_nested_proto( 2, /* nstack */ 1, /* argc */ @@ -2319,16 +2364,14 @@ be_local_closure(Matter_Session_get_fabric_compressed, /* name */ 0, /* has sup protos */ NULL, /* no sub protos */ 1, /* has constants */ - ( &(const bvalue[ 2]) { /* constants */ - /* K0 */ be_nested_str_weak(_fabric), - /* K1 */ be_nested_str_weak(fabric_compressed), + ( &(const bvalue[ 1]) { /* constants */ + /* K0 */ be_nested_str_weak(i2rkey), }), - be_str_weak(get_fabric_compressed), + be_str_weak(get_i2r), &be_const_str_solidified, - ( &(const binstruction[ 3]) { /* code */ + ( &(const binstruction[ 2]) { /* code */ 0x88040100, // 0000 GETMBR R1 R0 K0 - 0x88040301, // 0001 GETMBR R1 R1 K1 - 0x80040200, // 0002 RET 1 R1 + 0x80040200, // 0001 RET 1 R1 }) ) ); @@ -2365,11 +2408,43 @@ be_local_closure(Matter_Session_get_ipk_epoch_key, /* name */ /******************************************************************** -** Solidified function: is_PASE +** Solidified function: set_admin_subject_vendor ********************************************************************/ -be_local_closure(Matter_Session_is_PASE, /* name */ +be_local_closure(Matter_Session_set_admin_subject_vendor, /* name */ be_nested_proto( - 3, /* nstack */ + 4, /* nstack */ + 3, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 3]) { /* constants */ + /* K0 */ be_nested_str_weak(_fabric), + /* K1 */ be_nested_str_weak(admin_subject), + /* K2 */ be_nested_str_weak(admin_vendor), + }), + be_str_weak(set_admin_subject_vendor), + &be_const_str_solidified, + ( &(const binstruction[ 5]) { /* code */ + 0x880C0100, // 0000 GETMBR R3 R0 K0 + 0x900E0201, // 0001 SETMBR R3 K1 R1 + 0x880C0100, // 0002 GETMBR R3 R0 K0 + 0x900E0402, // 0003 SETMBR R3 K2 R2 + 0x80000000, // 0004 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: get_fabric_id +********************************************************************/ +be_local_closure(Matter_Session_get_fabric_id, /* name */ + be_nested_proto( + 2, /* nstack */ 1, /* argc */ 2, /* varg */ 0, /* has upvals */ @@ -2378,16 +2453,79 @@ be_local_closure(Matter_Session_is_PASE, /* name */ NULL, /* no sub protos */ 1, /* has constants */ ( &(const bvalue[ 2]) { /* constants */ - /* K0 */ be_nested_str_weak(mode), - /* K1 */ be_nested_str_weak(_PASE), + /* K0 */ be_nested_str_weak(_fabric), + /* K1 */ be_nested_str_weak(fabric_id), }), - be_str_weak(is_PASE), + be_str_weak(get_fabric_id), &be_const_str_solidified, - ( &(const binstruction[ 4]) { /* code */ + ( &(const binstruction[ 3]) { /* code */ 0x88040100, // 0000 GETMBR R1 R0 K0 - 0x88080101, // 0001 GETMBR R2 R0 K1 - 0x1C040202, // 0002 EQ R1 R1 R2 - 0x80040200, // 0003 RET 1 R1 + 0x88040301, // 0001 GETMBR R1 R1 K1 + 0x80040200, // 0002 RET 1 R1 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: set_ca +********************************************************************/ +be_local_closure(Matter_Session_set_ca, /* name */ + be_nested_proto( + 3, /* nstack */ + 2, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 2]) { /* constants */ + /* K0 */ be_nested_str_weak(_fabric), + /* K1 */ be_nested_str_weak(root_ca_certificate), + }), + be_str_weak(set_ca), + &be_const_str_solidified, + ( &(const binstruction[ 3]) { /* code */ + 0x88080100, // 0000 GETMBR R2 R0 K0 + 0x900A0201, // 0001 SETMBR R2 K1 R1 + 0x80000000, // 0002 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: set_fabric_device +********************************************************************/ +be_local_closure(Matter_Session_set_fabric_device, /* name */ + be_nested_proto( + 5, /* nstack */ + 4, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 4]) { /* constants */ + /* K0 */ be_nested_str_weak(_fabric), + /* K1 */ be_nested_str_weak(fabric_id), + /* K2 */ be_nested_str_weak(device_id), + /* K3 */ be_nested_str_weak(fabric_compressed), + }), + be_str_weak(set_fabric_device), + &be_const_str_solidified, + ( &(const binstruction[ 7]) { /* code */ + 0x88100100, // 0000 GETMBR R4 R0 K0 + 0x90120201, // 0001 SETMBR R4 K1 R1 + 0x88100100, // 0002 GETMBR R4 R0 K0 + 0x90120402, // 0003 SETMBR R4 K2 R2 + 0x88100100, // 0004 GETMBR R4 R0 K0 + 0x90120603, // 0005 SETMBR R4 K3 R3 + 0x80000000, // 0006 RET 0 }) ) ); @@ -2423,470 +2561,6 @@ be_local_closure(Matter_Session_get_icac, /* name */ /*******************************************************************/ -/******************************************************************** -** Solidified function: close -********************************************************************/ -be_local_closure(Matter_Session_close, /* name */ - be_nested_proto( - 8, /* nstack */ - 1, /* argc */ - 2, /* varg */ - 0, /* has upvals */ - NULL, /* no upvals */ - 0, /* has sup protos */ - NULL, /* no sub protos */ - 1, /* has constants */ - ( &(const bvalue[23]) { /* constants */ - /* K0 */ be_nested_str_weak(local_session_id), - /* K1 */ be_nested_str_weak(__future_local_session_id), - /* K2 */ be_nested_str_weak(initiator_session_id), - /* K3 */ be_nested_str_weak(__future_initiator_session_id), - /* K4 */ be_nested_str_weak(_counter_rcv_impl), - /* K5 */ be_nested_str_weak(reset), - /* K6 */ be_nested_str_weak(_counter_snd_impl), - /* K7 */ be_nested_str_weak(counter_rcv), - /* K8 */ be_const_int(0), - /* K9 */ be_nested_str_weak(counter_snd), - /* K10 */ be_nested_str_weak(next), - /* K11 */ be_nested_str_weak(i2rkey), - /* K12 */ be_nested_str_weak(_i2r_privacy), - /* K13 */ be_nested_str_weak(r2ikey), - /* K14 */ be_nested_str_weak(attestation_challenge), - /* K15 */ be_nested_str_weak(introspect), - /* K16 */ be_nested_str_weak(members), - /* K17 */ be_nested_str_weak(get), - /* K18 */ be_nested_str_weak(function), - /* K19 */ be_nested_str_weak(instance), - /* K20 */ be_nested_str_weak(_), - /* K21 */ be_const_int(1), - /* K22 */ be_nested_str_weak(stop_iteration), - }), - be_str_weak(close), - &be_const_str_solidified, - ( &(const binstruction[59]) { /* code */ - 0x88040101, // 0000 GETMBR R1 R0 K1 - 0x90020001, // 0001 SETMBR R0 K0 R1 - 0x88040103, // 0002 GETMBR R1 R0 K3 - 0x90020401, // 0003 SETMBR R0 K2 R1 - 0x88040104, // 0004 GETMBR R1 R0 K4 - 0x8C040305, // 0005 GETMET R1 R1 K5 - 0x7C040200, // 0006 CALL R1 1 - 0x88040106, // 0007 GETMBR R1 R0 K6 - 0x8C040305, // 0008 GETMET R1 R1 K5 - 0x7C040200, // 0009 CALL R1 1 - 0x90020F08, // 000A SETMBR R0 K7 K8 - 0x88040106, // 000B GETMBR R1 R0 K6 - 0x8C04030A, // 000C GETMET R1 R1 K10 - 0x7C040200, // 000D CALL R1 1 - 0x90021201, // 000E SETMBR R0 K9 R1 - 0x4C040000, // 000F LDNIL R1 - 0x90021601, // 0010 SETMBR R0 K11 R1 - 0x4C040000, // 0011 LDNIL R1 - 0x90021801, // 0012 SETMBR R0 K12 R1 - 0x4C040000, // 0013 LDNIL R1 - 0x90021A01, // 0014 SETMBR R0 K13 R1 - 0x4C040000, // 0015 LDNIL R1 - 0x90021C01, // 0016 SETMBR R0 K14 R1 - 0xA4061E00, // 0017 IMPORT R1 K15 - 0x60080010, // 0018 GETGBL R2 G16 - 0x8C0C0310, // 0019 GETMET R3 R1 K16 - 0x5C140000, // 001A MOVE R5 R0 - 0x7C0C0400, // 001B CALL R3 2 - 0x7C080200, // 001C CALL R2 1 - 0xA8020018, // 001D EXBLK 0 #0037 - 0x5C0C0400, // 001E MOVE R3 R2 - 0x7C0C0000, // 001F CALL R3 0 - 0x8C100311, // 0020 GETMET R4 R1 K17 - 0x5C180000, // 0021 MOVE R6 R0 - 0x5C1C0600, // 0022 MOVE R7 R3 - 0x7C100600, // 0023 CALL R4 3 - 0x60140004, // 0024 GETGBL R5 G4 - 0x5C180800, // 0025 MOVE R6 R4 - 0x7C140200, // 0026 CALL R5 1 - 0x20140B12, // 0027 NE R5 R5 K18 - 0x7816000C, // 0028 JMPF R5 #0036 - 0x60140004, // 0029 GETGBL R5 G4 - 0x5C180800, // 002A MOVE R6 R4 - 0x7C140200, // 002B CALL R5 1 - 0x20140B13, // 002C NE R5 R5 K19 - 0x78160007, // 002D JMPF R5 #0036 - 0x94140708, // 002E GETIDX R5 R3 K8 - 0x1C140B14, // 002F EQ R5 R5 K20 - 0x78160004, // 0030 JMPF R5 #0036 - 0x94140715, // 0031 GETIDX R5 R3 K21 - 0x1C140B14, // 0032 EQ R5 R5 K20 - 0x78160001, // 0033 JMPF R5 #0036 - 0x4C140000, // 0034 LDNIL R5 - 0x90000605, // 0035 SETMBR R0 R3 R5 - 0x7001FFE6, // 0036 JMP #001E - 0x58080016, // 0037 LDCONST R2 K22 - 0xAC080200, // 0038 CATCH R2 1 0 - 0xB0080000, // 0039 RAISE 2 R0 R0 - 0x80000000, // 003A RET 0 - }) - ) -); -/*******************************************************************/ - - -/******************************************************************** -** Solidified function: set_fabric_label -********************************************************************/ -be_local_closure(Matter_Session_set_fabric_label, /* name */ - be_nested_proto( - 4, /* nstack */ - 2, /* argc */ - 2, /* varg */ - 0, /* has upvals */ - NULL, /* no upvals */ - 0, /* has sup protos */ - NULL, /* no sub protos */ - 1, /* has constants */ - ( &(const bvalue[ 3]) { /* constants */ - /* K0 */ be_nested_str_weak(string), - /* K1 */ be_nested_str_weak(_fabric), - /* K2 */ be_nested_str_weak(fabric_label), - }), - be_str_weak(set_fabric_label), - &be_const_str_solidified, - ( &(const binstruction[ 8]) { /* code */ - 0x60080004, // 0000 GETGBL R2 G4 - 0x5C0C0200, // 0001 MOVE R3 R1 - 0x7C080200, // 0002 CALL R2 1 - 0x1C080500, // 0003 EQ R2 R2 K0 - 0x780A0001, // 0004 JMPF R2 #0007 - 0x88080101, // 0005 GETMBR R2 R0 K1 - 0x900A0401, // 0006 SETMBR R2 K2 R1 - 0x80000000, // 0007 RET 0 - }) - ) -); -/*******************************************************************/ - - -/******************************************************************** -** Solidified function: get_mode -********************************************************************/ -be_local_closure(Matter_Session_get_mode, /* name */ - be_nested_proto( - 2, /* nstack */ - 1, /* argc */ - 2, /* varg */ - 0, /* has upvals */ - NULL, /* no upvals */ - 0, /* has sup protos */ - NULL, /* no sub protos */ - 1, /* has constants */ - ( &(const bvalue[ 1]) { /* constants */ - /* K0 */ be_nested_str_weak(mode), - }), - be_str_weak(get_mode), - &be_const_str_solidified, - ( &(const binstruction[ 2]) { /* code */ - 0x88040100, // 0000 GETMBR R1 R0 K0 - 0x80040200, // 0001 RET 1 R1 - }) - ) -); -/*******************************************************************/ - - -/******************************************************************** -** Solidified function: set_mode -********************************************************************/ -be_local_closure(Matter_Session_set_mode, /* name */ - be_nested_proto( - 2, /* nstack */ - 2, /* argc */ - 2, /* varg */ - 0, /* has upvals */ - NULL, /* no upvals */ - 0, /* has sup protos */ - NULL, /* no sub protos */ - 1, /* has constants */ - ( &(const bvalue[ 1]) { /* constants */ - /* K0 */ be_nested_str_weak(mode), - }), - be_str_weak(set_mode), - &be_const_str_solidified, - ( &(const binstruction[ 2]) { /* code */ - 0x90020001, // 0000 SETMBR R0 K0 R1 - 0x80000000, // 0001 RET 0 - }) - ) -); -/*******************************************************************/ - - -/******************************************************************** -** Solidified function: get_i2r -********************************************************************/ -be_local_closure(Matter_Session_get_i2r, /* name */ - be_nested_proto( - 2, /* nstack */ - 1, /* argc */ - 2, /* varg */ - 0, /* has upvals */ - NULL, /* no upvals */ - 0, /* has sup protos */ - NULL, /* no sub protos */ - 1, /* has constants */ - ( &(const bvalue[ 1]) { /* constants */ - /* K0 */ be_nested_str_weak(i2rkey), - }), - be_str_weak(get_i2r), - &be_const_str_solidified, - ( &(const binstruction[ 2]) { /* code */ - 0x88040100, // 0000 GETMBR R1 R0 K0 - 0x80040200, // 0001 RET 1 R1 - }) - ) -); -/*******************************************************************/ - - -/******************************************************************** -** Solidified function: get_fabric -********************************************************************/ -be_local_closure(Matter_Session_get_fabric, /* name */ - be_nested_proto( - 2, /* nstack */ - 1, /* argc */ - 2, /* varg */ - 0, /* has upvals */ - NULL, /* no upvals */ - 0, /* has sup protos */ - NULL, /* no sub protos */ - 1, /* has constants */ - ( &(const bvalue[ 1]) { /* constants */ - /* K0 */ be_nested_str_weak(_fabric), - }), - be_str_weak(get_fabric), - &be_const_str_solidified, - ( &(const binstruction[ 2]) { /* code */ - 0x88040100, // 0000 GETMBR R1 R0 K0 - 0x80040200, // 0001 RET 1 R1 - }) - ) -); -/*******************************************************************/ - - -/******************************************************************** -** Solidified function: persist_to_fabric -********************************************************************/ -be_local_closure(Matter_Session_persist_to_fabric, /* name */ - be_nested_proto( - 4, /* nstack */ - 1, /* argc */ - 2, /* varg */ - 0, /* has upvals */ - NULL, /* no upvals */ - 0, /* has sup protos */ - NULL, /* no sub protos */ - 1, /* has constants */ - ( &(const bvalue[ 2]) { /* constants */ - /* K0 */ be_nested_str_weak(_fabric), - /* K1 */ be_nested_str_weak(add_session), - }), - be_str_weak(persist_to_fabric), - &be_const_str_solidified, - ( &(const binstruction[ 5]) { /* code */ - 0x88040100, // 0000 GETMBR R1 R0 K0 - 0x8C040301, // 0001 GETMET R1 R1 K1 - 0x5C0C0000, // 0002 MOVE R3 R0 - 0x7C040400, // 0003 CALL R1 2 - 0x80000000, // 0004 RET 0 - }) - ) -); -/*******************************************************************/ - - -/******************************************************************** -** Solidified function: get_fabric_label -********************************************************************/ -be_local_closure(Matter_Session_get_fabric_label, /* name */ - be_nested_proto( - 2, /* nstack */ - 1, /* argc */ - 2, /* varg */ - 0, /* has upvals */ - NULL, /* no upvals */ - 0, /* has sup protos */ - NULL, /* no sub protos */ - 1, /* has constants */ - ( &(const bvalue[ 2]) { /* constants */ - /* K0 */ be_nested_str_weak(_fabric), - /* K1 */ be_nested_str_weak(fabric_label), - }), - be_str_weak(get_fabric_label), - &be_const_str_solidified, - ( &(const binstruction[ 3]) { /* code */ - 0x88040100, // 0000 GETMBR R1 R0 K0 - 0x88040301, // 0001 GETMBR R1 R1 K1 - 0x80040200, // 0002 RET 1 R1 - }) - ) -); -/*******************************************************************/ - - -/******************************************************************** -** Solidified function: is_CASE -********************************************************************/ -be_local_closure(Matter_Session_is_CASE, /* name */ - be_nested_proto( - 3, /* nstack */ - 1, /* argc */ - 2, /* varg */ - 0, /* has upvals */ - NULL, /* no upvals */ - 0, /* has sup protos */ - NULL, /* no sub protos */ - 1, /* has constants */ - ( &(const bvalue[ 2]) { /* constants */ - /* K0 */ be_nested_str_weak(mode), - /* K1 */ be_nested_str_weak(_CASE), - }), - be_str_weak(is_CASE), - &be_const_str_solidified, - ( &(const binstruction[ 4]) { /* code */ - 0x88040100, // 0000 GETMBR R1 R0 K0 - 0x88080101, // 0001 GETMBR R2 R0 K1 - 0x1C040202, // 0002 EQ R1 R1 R2 - 0x80040200, // 0003 RET 1 R1 - }) - ) -); -/*******************************************************************/ - - -/******************************************************************** -** Solidified function: get_admin_subject -********************************************************************/ -be_local_closure(Matter_Session_get_admin_subject, /* name */ - be_nested_proto( - 2, /* nstack */ - 1, /* argc */ - 2, /* varg */ - 0, /* has upvals */ - NULL, /* no upvals */ - 0, /* has sup protos */ - NULL, /* no sub protos */ - 1, /* has constants */ - ( &(const bvalue[ 2]) { /* constants */ - /* K0 */ be_nested_str_weak(_fabric), - /* K1 */ be_nested_str_weak(admin_subject), - }), - be_str_weak(get_admin_subject), - &be_const_str_solidified, - ( &(const binstruction[ 3]) { /* code */ - 0x88040100, // 0000 GETMBR R1 R0 K0 - 0x88040301, // 0001 GETMBR R1 R1 K1 - 0x80040200, // 0002 RET 1 R1 - }) - ) -); -/*******************************************************************/ - - -/******************************************************************** -** Solidified function: counter_rcv_validate -********************************************************************/ -be_local_closure(Matter_Session_counter_rcv_validate, /* name */ - be_nested_proto( - 7, /* nstack */ - 3, /* argc */ - 2, /* varg */ - 0, /* has upvals */ - NULL, /* no upvals */ - 0, /* has sup protos */ - NULL, /* no sub protos */ - 1, /* has constants */ - ( &(const bvalue[ 4]) { /* constants */ - /* K0 */ be_nested_str_weak(_counter_rcv_impl), - /* K1 */ be_nested_str_weak(validate), - /* K2 */ be_nested_str_weak(counter_rcv), - /* K3 */ be_nested_str_weak(val), - }), - be_str_weak(counter_rcv_validate), - &be_const_str_solidified, - ( &(const binstruction[11]) { /* code */ - 0x880C0100, // 0000 GETMBR R3 R0 K0 - 0x8C0C0701, // 0001 GETMET R3 R3 K1 - 0x5C140200, // 0002 MOVE R5 R1 - 0x5C180400, // 0003 MOVE R6 R2 - 0x7C0C0600, // 0004 CALL R3 3 - 0x780E0003, // 0005 JMPF R3 #000A - 0x88100100, // 0006 GETMBR R4 R0 K0 - 0x8C100903, // 0007 GETMET R4 R4 K3 - 0x7C100200, // 0008 CALL R4 1 - 0x90020404, // 0009 SETMBR R0 K2 R4 - 0x80040600, // 000A RET 1 R3 - }) - ) -); -/*******************************************************************/ - - -/******************************************************************** -** Solidified function: get_r2i -********************************************************************/ -be_local_closure(Matter_Session_get_r2i, /* name */ - be_nested_proto( - 2, /* nstack */ - 1, /* argc */ - 2, /* varg */ - 0, /* has upvals */ - NULL, /* no upvals */ - 0, /* has sup protos */ - NULL, /* no sub protos */ - 1, /* has constants */ - ( &(const bvalue[ 1]) { /* constants */ - /* K0 */ be_nested_str_weak(r2ikey), - }), - be_str_weak(get_r2i), - &be_const_str_solidified, - ( &(const binstruction[ 2]) { /* code */ - 0x88040100, // 0000 GETMBR R1 R0 K0 - 0x80040200, // 0001 RET 1 R1 - }) - ) -); -/*******************************************************************/ - - -/******************************************************************** -** Solidified function: save -********************************************************************/ -be_local_closure(Matter_Session_save, /* name */ - be_nested_proto( - 3, /* nstack */ - 1, /* argc */ - 2, /* varg */ - 0, /* has upvals */ - NULL, /* no upvals */ - 0, /* has sup protos */ - NULL, /* no sub protos */ - 1, /* has constants */ - ( &(const bvalue[ 2]) { /* constants */ - /* K0 */ be_nested_str_weak(_store), - /* K1 */ be_nested_str_weak(save_fabrics), - }), - be_str_weak(save), - &be_const_str_solidified, - ( &(const binstruction[ 4]) { /* code */ - 0x88040100, // 0000 GETMBR R1 R0 K0 - 0x8C040301, // 0001 GETMET R1 R1 K1 - 0x7C040200, // 0002 CALL R1 1 - 0x80000000, // 0003 RET 0 - }) - ) -); -/*******************************************************************/ - - /******************************************************************** ** Solidified function: set_mode_PASE ********************************************************************/ @@ -2918,9 +2592,9 @@ be_local_closure(Matter_Session_set_mode_PASE, /* name */ /******************************************************************** -** Solidified function: get_noc +** Solidified function: get_admin_subject ********************************************************************/ -be_local_closure(Matter_Session_get_noc, /* name */ +be_local_closure(Matter_Session_get_admin_subject, /* name */ be_nested_proto( 2, /* nstack */ 1, /* argc */ @@ -2932,9 +2606,9 @@ be_local_closure(Matter_Session_get_noc, /* name */ 1, /* has constants */ ( &(const bvalue[ 2]) { /* constants */ /* K0 */ be_nested_str_weak(_fabric), - /* K1 */ be_nested_str_weak(noc), + /* K1 */ be_nested_str_weak(admin_subject), }), - be_str_weak(get_noc), + be_str_weak(get_admin_subject), &be_const_str_solidified, ( &(const binstruction[ 3]) { /* code */ 0x88040100, // 0000 GETMBR R1 R0 K0 @@ -2946,38 +2620,6 @@ be_local_closure(Matter_Session_get_noc, /* name */ /*******************************************************************/ -/******************************************************************** -** Solidified function: set_noc -********************************************************************/ -be_local_closure(Matter_Session_set_noc, /* name */ - be_nested_proto( - 4, /* nstack */ - 3, /* argc */ - 2, /* varg */ - 0, /* has upvals */ - NULL, /* no upvals */ - 0, /* has sup protos */ - NULL, /* no sub protos */ - 1, /* has constants */ - ( &(const bvalue[ 3]) { /* constants */ - /* K0 */ be_nested_str_weak(_fabric), - /* K1 */ be_nested_str_weak(noc), - /* K2 */ be_nested_str_weak(icac), - }), - be_str_weak(set_noc), - &be_const_str_solidified, - ( &(const binstruction[ 5]) { /* code */ - 0x880C0100, // 0000 GETMBR R3 R0 K0 - 0x900E0201, // 0001 SETMBR R3 K1 R1 - 0x880C0100, // 0002 GETMBR R3 R0 K0 - 0x900E0402, // 0003 SETMBR R3 K2 R2 - 0x80000000, // 0004 RET 0 - }) - ) -); -/*******************************************************************/ - - /******************************************************************** ** Solidified function: get_ipk_group_key ********************************************************************/ @@ -3038,6 +2680,397 @@ be_local_closure(Matter_Session_get_ipk_group_key, /* name */ /*******************************************************************/ +/******************************************************************** +** Solidified function: get_ca_pub +********************************************************************/ +be_local_closure(Matter_Session_get_ca_pub, /* name */ + be_nested_proto( + 3, /* nstack */ + 1, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 2]) { /* constants */ + /* K0 */ be_nested_str_weak(_fabric), + /* K1 */ be_nested_str_weak(get_ca_pub), + }), + be_str_weak(get_ca_pub), + &be_const_str_solidified, + ( &(const binstruction[ 4]) { /* code */ + 0x88040100, // 0000 GETMBR R1 R0 K0 + 0x8C040301, // 0001 GETMET R1 R1 K1 + 0x7C040200, // 0002 CALL R1 1 + 0x80040200, // 0003 RET 1 R1 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: is_CASE +********************************************************************/ +be_local_closure(Matter_Session_is_CASE, /* name */ + be_nested_proto( + 3, /* nstack */ + 1, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 2]) { /* constants */ + /* K0 */ be_nested_str_weak(mode), + /* K1 */ be_nested_str_weak(_CASE), + }), + be_str_weak(is_CASE), + &be_const_str_solidified, + ( &(const binstruction[ 4]) { /* code */ + 0x88040100, // 0000 GETMBR R1 R0 K0 + 0x88080101, // 0001 GETMBR R2 R0 K1 + 0x1C040202, // 0002 EQ R1 R1 R2 + 0x80040200, // 0003 RET 1 R1 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: get_fabric_compressed +********************************************************************/ +be_local_closure(Matter_Session_get_fabric_compressed, /* name */ + be_nested_proto( + 2, /* nstack */ + 1, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 2]) { /* constants */ + /* K0 */ be_nested_str_weak(_fabric), + /* K1 */ be_nested_str_weak(fabric_compressed), + }), + be_str_weak(get_fabric_compressed), + &be_const_str_solidified, + ( &(const binstruction[ 3]) { /* code */ + 0x88040100, // 0000 GETMBR R1 R0 K0 + 0x88040301, // 0001 GETMBR R1 R1 K1 + 0x80040200, // 0002 RET 1 R1 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: counter_rcv_validate +********************************************************************/ +be_local_closure(Matter_Session_counter_rcv_validate, /* name */ + be_nested_proto( + 7, /* nstack */ + 3, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 4]) { /* constants */ + /* K0 */ be_nested_str_weak(_counter_rcv_impl), + /* K1 */ be_nested_str_weak(validate), + /* K2 */ be_nested_str_weak(counter_rcv), + /* K3 */ be_nested_str_weak(val), + }), + be_str_weak(counter_rcv_validate), + &be_const_str_solidified, + ( &(const binstruction[11]) { /* code */ + 0x880C0100, // 0000 GETMBR R3 R0 K0 + 0x8C0C0701, // 0001 GETMET R3 R3 K1 + 0x5C140200, // 0002 MOVE R5 R1 + 0x5C180400, // 0003 MOVE R6 R2 + 0x7C0C0600, // 0004 CALL R3 3 + 0x780E0003, // 0005 JMPF R3 #000A + 0x88100100, // 0006 GETMBR R4 R0 K0 + 0x8C100903, // 0007 GETMET R4 R4 K3 + 0x7C100200, // 0008 CALL R4 1 + 0x90020404, // 0009 SETMBR R0 K2 R4 + 0x80040600, // 000A RET 1 R3 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: set_noc +********************************************************************/ +be_local_closure(Matter_Session_set_noc, /* name */ + be_nested_proto( + 4, /* nstack */ + 3, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 3]) { /* constants */ + /* K0 */ be_nested_str_weak(_fabric), + /* K1 */ be_nested_str_weak(noc), + /* K2 */ be_nested_str_weak(icac), + }), + be_str_weak(set_noc), + &be_const_str_solidified, + ( &(const binstruction[ 5]) { /* code */ + 0x880C0100, // 0000 GETMBR R3 R0 K0 + 0x900E0201, // 0001 SETMBR R3 K1 R1 + 0x880C0100, // 0002 GETMBR R3 R0 K0 + 0x900E0402, // 0003 SETMBR R3 K2 R2 + 0x80000000, // 0004 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: get_i2r_privacy +********************************************************************/ +be_local_closure(Matter_Session_get_i2r_privacy, /* name */ + be_nested_proto( + 9, /* nstack */ + 1, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 7]) { /* constants */ + /* K0 */ be_nested_str_weak(_i2r_privacy), + /* K1 */ be_nested_str_weak(crypto), + /* K2 */ be_nested_str_weak(HKDF_SHA256), + /* K3 */ be_nested_str_weak(derive), + /* K4 */ be_nested_str_weak(get_i2r), + /* K5 */ be_nested_str_weak(fromstring), + /* K6 */ be_nested_str_weak(PrivacyKey), + }), + be_str_weak(get_i2r_privacy), + &be_const_str_solidified, + ( &(const binstruction[22]) { /* code */ + 0x88040100, // 0000 GETMBR R1 R0 K0 + 0x4C080000, // 0001 LDNIL R2 + 0x1C040202, // 0002 EQ R1 R1 R2 + 0x7806000F, // 0003 JMPF R1 #0014 + 0xA4060200, // 0004 IMPORT R1 K1 + 0x8C080302, // 0005 GETMET R2 R1 K2 + 0x7C080200, // 0006 CALL R2 1 + 0x8C080503, // 0007 GETMET R2 R2 K3 + 0x8C100104, // 0008 GETMET R4 R0 K4 + 0x7C100200, // 0009 CALL R4 1 + 0x60140015, // 000A GETGBL R5 G21 + 0x7C140000, // 000B CALL R5 0 + 0x60180015, // 000C GETGBL R6 G21 + 0x7C180000, // 000D CALL R6 0 + 0x8C180D05, // 000E GETMET R6 R6 K5 + 0x58200006, // 000F LDCONST R8 K6 + 0x7C180400, // 0010 CALL R6 2 + 0x541E000F, // 0011 LDINT R7 16 + 0x7C080A00, // 0012 CALL R2 5 + 0x90020002, // 0013 SETMBR R0 K0 R2 + 0x88040100, // 0014 GETMBR R1 R0 K0 + 0x80040200, // 0015 RET 1 R1 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: set_keys +********************************************************************/ +be_local_closure(Matter_Session_set_keys, /* name */ + be_nested_proto( + 6, /* nstack */ + 5, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 5]) { /* constants */ + /* K0 */ be_nested_str_weak(i2rkey), + /* K1 */ be_nested_str_weak(_i2r_privacy), + /* K2 */ be_nested_str_weak(r2ikey), + /* K3 */ be_nested_str_weak(attestation_challenge), + /* K4 */ be_nested_str_weak(created), + }), + be_str_weak(set_keys), + &be_const_str_solidified, + ( &(const binstruction[ 7]) { /* code */ + 0x90020001, // 0000 SETMBR R0 K0 R1 + 0x4C140000, // 0001 LDNIL R5 + 0x90020205, // 0002 SETMBR R0 K1 R5 + 0x90020402, // 0003 SETMBR R0 K2 R2 + 0x90020603, // 0004 SETMBR R0 K3 R3 + 0x90020804, // 0005 SETMBR R0 K4 R4 + 0x80000000, // 0006 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: get_admin_vendor +********************************************************************/ +be_local_closure(Matter_Session_get_admin_vendor, /* name */ + be_nested_proto( + 2, /* nstack */ + 1, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 2]) { /* constants */ + /* K0 */ be_nested_str_weak(_fabric), + /* K1 */ be_nested_str_weak(admin_vendor), + }), + be_str_weak(get_admin_vendor), + &be_const_str_solidified, + ( &(const binstruction[ 3]) { /* code */ + 0x88040100, // 0000 GETMBR R1 R0 K0 + 0x88040301, // 0001 GETMBR R1 R1 K1 + 0x80040200, // 0002 RET 1 R1 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: fabric_completed +********************************************************************/ +be_local_closure(Matter_Session_fabric_completed, /* name */ + be_nested_proto( + 4, /* nstack */ + 1, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 6]) { /* constants */ + /* K0 */ be_nested_str_weak(_fabric), + /* K1 */ be_nested_str_weak(set_no_expiration), + /* K2 */ be_nested_str_weak(set_persist), + /* K3 */ be_nested_str_weak(assign_fabric_index), + /* K4 */ be_nested_str_weak(_store), + /* K5 */ be_nested_str_weak(add_fabric), + }), + be_str_weak(fabric_completed), + &be_const_str_solidified, + ( &(const binstruction[14]) { /* code */ + 0x88040100, // 0000 GETMBR R1 R0 K0 + 0x8C040301, // 0001 GETMET R1 R1 K1 + 0x7C040200, // 0002 CALL R1 1 + 0x88040100, // 0003 GETMBR R1 R0 K0 + 0x8C040302, // 0004 GETMET R1 R1 K2 + 0x500C0200, // 0005 LDBOOL R3 1 0 + 0x7C040400, // 0006 CALL R1 2 + 0x8C040103, // 0007 GETMET R1 R0 K3 + 0x7C040200, // 0008 CALL R1 1 + 0x88040104, // 0009 GETMBR R1 R0 K4 + 0x8C040305, // 000A GETMET R1 R1 K5 + 0x880C0100, // 000B GETMBR R3 R0 K0 + 0x7C040400, // 000C CALL R1 2 + 0x80000000, // 000D RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: get_pk +********************************************************************/ +be_local_closure(Matter_Session_get_pk, /* name */ + be_nested_proto( + 6, /* nstack */ + 1, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 4]) { /* constants */ + /* K0 */ be_nested_str_weak(_fabric), + /* K1 */ be_nested_str_weak(no_private_key), + /* K2 */ be_nested_str_weak(crypto), + /* K3 */ be_nested_str_weak(random), + }), + be_str_weak(get_pk), + &be_const_str_solidified, + ( &(const binstruction[12]) { /* code */ + 0x88040100, // 0000 GETMBR R1 R0 K0 + 0x88040301, // 0001 GETMBR R1 R1 K1 + 0x74060005, // 0002 JMPT R1 #0009 + 0xA4060400, // 0003 IMPORT R1 K2 + 0x88080100, // 0004 GETMBR R2 R0 K0 + 0x8C0C0303, // 0005 GETMET R3 R1 K3 + 0x5416001F, // 0006 LDINT R5 32 + 0x7C0C0400, // 0007 CALL R3 2 + 0x900A0203, // 0008 SETMBR R2 K1 R3 + 0x88040100, // 0009 GETMBR R1 R0 K0 + 0x88040301, // 000A GETMBR R1 R1 K1 + 0x80040200, // 000B RET 1 R1 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: get_noc +********************************************************************/ +be_local_closure(Matter_Session_get_noc, /* name */ + be_nested_proto( + 2, /* nstack */ + 1, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 2]) { /* constants */ + /* K0 */ be_nested_str_weak(_fabric), + /* K1 */ be_nested_str_weak(noc), + }), + be_str_weak(get_noc), + &be_const_str_solidified, + ( &(const binstruction[ 3]) { /* code */ + 0x88040100, // 0000 GETMBR R1 R0 K0 + 0x88040301, // 0001 GETMBR R1 R1 K1 + 0x80040200, // 0002 RET 1 R1 + }) + ) +); +/*******************************************************************/ + + /******************************************************************** ** Solidified class: Matter_Session ********************************************************************/ @@ -3045,88 +3078,89 @@ extern const bclass be_class_Matter_Expirable; be_local_class(Matter_Session, 31, &be_class_Matter_Expirable, - be_nested_map(80, + be_nested_map(81, ( (struct bmapnode*) &(const bmapnode[]) { - { be_const_key_weak(initiator_session_id, -1), be_const_var(4) }, - { be_const_key_weak(set_keys, -1), be_const_closure(Matter_Session_set_keys_closure) }, - { be_const_key_weak(set_noc, 1), be_const_closure(Matter_Session_set_noc_closure) }, - { be_const_key_weak(attestation_challenge, -1), be_const_var(23) }, - { be_const_key_weak(set_mode_CASE, 31), be_const_closure(Matter_Session_set_mode_CASE_closure) }, - { be_const_key_weak(local_session_id, 11), be_const_var(3) }, - { be_const_key_weak(get_admin_vendor, 62), be_const_closure(Matter_Session_get_admin_vendor_closure) }, - { be_const_key_weak(get_fabric_id, -1), be_const_closure(Matter_Session_get_fabric_id_closure) }, - { be_const_key_weak(get_ac, 36), be_const_closure(Matter_Session_get_ac_closure) }, - { be_const_key_weak(_port, 68), be_const_var(16) }, - { be_const_key_weak(tojson, -1), be_const_closure(Matter_Session_tojson_closure) }, - { be_const_key_weak(_COUNTER_SND_INCR, 56), be_const_int(1024) }, - { be_const_key_weak(set_mode_PASE, -1), be_const_closure(Matter_Session_set_mode_PASE_closure) }, - { be_const_key_weak(_exchange_id, -1), be_const_var(14) }, - { be_const_key_weak(peer_node_id, -1), be_const_var(24) }, - { be_const_key_weak(before_remove, 58), be_const_closure(Matter_Session_before_remove_closure) }, - { be_const_key_weak(get_ca, 2), be_const_closure(Matter_Session_get_ca_closure) }, - { be_const_key_weak(resumption_id, 75), be_const_var(26) }, - { be_const_key_weak(mode, 21), be_const_var(1) }, - { be_const_key_weak(_PASE, 32), be_const_int(1) }, - { be_const_key_weak(get_i2r_privacy, -1), be_const_closure(Matter_Session_get_i2r_privacy_closure) }, - { be_const_key_weak(__Msg2, -1), be_const_var(29) }, - { be_const_key_weak(_message_handler, -1), be_const_var(17) }, - { be_const_key_weak(set_admin_subject_vendor, 54), be_const_closure(Matter_Session_set_admin_subject_vendor_closure) }, + { be_const_key_weak(_counter_insecure_snd, -1), be_const_var(19) }, { be_const_key_weak(_source_node_id, -1), be_const_var(7) }, + { be_const_key_weak(get_fabric, -1), be_const_closure(Matter_Session_get_fabric_closure) }, + { be_const_key_weak(_i2r_privacy, -1), be_const_var(22) }, { be_const_key_weak(get_pk, -1), be_const_closure(Matter_Session_get_pk_closure) }, - { be_const_key_weak(get_device_id, 77), be_const_closure(Matter_Session_get_device_id_closure) }, - { be_const_key_weak(__future_initiator_session_id, -1), be_const_var(8) }, - { be_const_key_weak(set_ca, -1), be_const_closure(Matter_Session_set_ca_closure) }, - { be_const_key_weak(counter_rcv, -1), be_const_var(10) }, - { be_const_key_weak(fabric_candidate, -1), be_const_closure(Matter_Session_fabric_candidate_closure) }, - { be_const_key_weak(update, -1), be_const_closure(Matter_Session_update_closure) }, - { be_const_key_weak(_counter_rcv_impl, 53), be_const_var(12) }, { be_const_key_weak(counter_snd_next, -1), be_const_closure(Matter_Session_counter_snd_next_closure) }, - { be_const_key_weak(_CASE, -1), be_const_int(2) }, - { be_const_key_weak(init, 74), be_const_closure(Matter_Session_init_closure) }, - { be_const_key_weak(get_admin_subject, -1), be_const_closure(Matter_Session_get_admin_subject_closure) }, - { be_const_key_weak(r2ikey, -1), be_const_var(21) }, - { be_const_key_weak(fabric_completed, -1), be_const_closure(Matter_Session_fabric_completed_closure) }, - { be_const_key_weak(hydrate_post, -1), be_const_closure(Matter_Session_hydrate_post_closure) }, - { be_const_key_weak(set_ipk_epoch_key, -1), be_const_closure(Matter_Session_set_ipk_epoch_key_closure) }, - { be_const_key_weak(i2rkey, 29), be_const_var(20) }, - { be_const_key_weak(_GROUP_KEY, -1), be_nested_str_weak(GroupKey_X20v1_X2E0) }, - { be_const_key_weak(get_fabric_compressed, -1), be_const_closure(Matter_Session_get_fabric_compressed_closure) }, - { be_const_key_weak(get_ca_pub, 69), be_const_closure(Matter_Session_get_ca_pub_closure) }, - { be_const_key_weak(_counter_insecure_rcv, -1), be_const_var(18) }, - { be_const_key_weak(get_mode, -1), be_const_closure(Matter_Session_get_mode_closure) }, - { be_const_key_weak(counter_snd, -1), be_const_var(11) }, - { be_const_key_weak(set_fabric_device, 61), be_const_closure(Matter_Session_set_fabric_device_closure) }, - { be_const_key_weak(__chunked_attr_reports, -1), be_const_var(30) }, - { be_const_key_weak(_store, 41), be_const_var(0) }, - { be_const_key_weak(fromjson, 60), be_const_static_closure(Matter_Session_fromjson_closure) }, - { be_const_key_weak(set_fabric_label, -1), be_const_closure(Matter_Session_set_fabric_label_closure) }, - { be_const_key_weak(__future_local_session_id, -1), be_const_var(9) }, - { be_const_key_weak(persist_to_fabric, -1), be_const_closure(Matter_Session_persist_to_fabric_closure) }, - { be_const_key_weak(set_mode, 12), be_const_closure(Matter_Session_set_mode_closure) }, - { be_const_key_weak(shared_secret, -1), be_const_var(27) }, - { be_const_key_weak(_breadcrumb, 46), be_const_var(25) }, - { be_const_key_weak(_ip, -1), be_const_var(15) }, - { be_const_key_weak(created, 57), be_const_var(5) }, + { be_const_key_weak(attestation_challenge, -1), be_const_var(23) }, { be_const_key_weak(close, -1), be_const_closure(Matter_Session_close_closure) }, - { be_const_key_weak(get_icac, -1), be_const_closure(Matter_Session_get_icac_closure) }, - { be_const_key_weak(_i2r_privacy, 10), be_const_var(22) }, - { be_const_key_weak(_fabric, 50), be_const_var(2) }, - { be_const_key_weak(get_fabric_label, -1), be_const_closure(Matter_Session_get_fabric_label_closure) }, - { be_const_key_weak(get_fabric, 42), be_const_closure(Matter_Session_get_fabric_closure) }, - { be_const_key_weak(is_CASE, -1), be_const_closure(Matter_Session_is_CASE_closure) }, - { be_const_key_weak(get_i2r, 37), be_const_closure(Matter_Session_get_i2r_closure) }, - { be_const_key_weak(is_PASE, -1), be_const_closure(Matter_Session_is_PASE_closure) }, - { be_const_key_weak(get_ipk_epoch_key, -1), be_const_closure(Matter_Session_get_ipk_epoch_key_closure) }, - { be_const_key_weak(counter_rcv_validate, -1), be_const_closure(Matter_Session_counter_rcv_validate_closure) }, - { be_const_key_weak(get_r2i, -1), be_const_closure(Matter_Session_get_r2i_closure) }, + { be_const_key_weak(before_remove, 0), be_const_closure(Matter_Session_before_remove_closure) }, + { be_const_key_weak(initiator_session_id, 69), be_const_var(4) }, + { be_const_key_weak(_exchange_id, 33), be_const_var(14) }, + { be_const_key_weak(get_ca, -1), be_const_closure(Matter_Session_get_ca_closure) }, { be_const_key_weak(save, -1), be_const_closure(Matter_Session_save_closure) }, - { be_const_key_weak(_counter_insecure_snd, 19), be_const_var(19) }, - { be_const_key_weak(last_used, -1), be_const_var(6) }, - { be_const_key_weak(_counter_snd_impl, -1), be_const_var(13) }, - { be_const_key_weak(get_noc, -1), be_const_closure(Matter_Session_get_noc_closure) }, + { be_const_key_weak(get_admin_vendor, -1), be_const_closure(Matter_Session_get_admin_vendor_closure) }, + { be_const_key_weak(tojson, -1), be_const_closure(Matter_Session_tojson_closure) }, + { be_const_key_weak(assign_fabric_index, -1), be_const_closure(Matter_Session_assign_fabric_index_closure) }, { be_const_key_weak(gen_CSR, -1), be_const_closure(Matter_Session_gen_CSR_closure) }, + { be_const_key_weak(peer_node_id, -1), be_const_var(24) }, + { be_const_key_weak(fabric_candidate, 74), be_const_closure(Matter_Session_fabric_candidate_closure) }, + { be_const_key_weak(_GROUP_KEY, -1), be_nested_str_weak(GroupKey_X20v1_X2E0) }, + { be_const_key_weak(resumption_id, -1), be_const_var(26) }, + { be_const_key_weak(_fabric, 7), be_const_var(2) }, + { be_const_key_weak(set_keys, -1), be_const_closure(Matter_Session_set_keys_closure) }, + { be_const_key_weak(get_i2r_privacy, 40), be_const_closure(Matter_Session_get_i2r_privacy_closure) }, + { be_const_key_weak(hydrate_post, 46), be_const_closure(Matter_Session_hydrate_post_closure) }, + { be_const_key_weak(set_ipk_epoch_key, 79), be_const_closure(Matter_Session_set_ipk_epoch_key_closure) }, + { be_const_key_weak(set_mode, 35), be_const_closure(Matter_Session_set_mode_closure) }, + { be_const_key_weak(__future_local_session_id, 12), be_const_var(9) }, + { be_const_key_weak(set_mode_CASE, 70), be_const_closure(Matter_Session_set_mode_CASE_closure) }, + { be_const_key_weak(set_fabric_label, -1), be_const_closure(Matter_Session_set_fabric_label_closure) }, + { be_const_key_weak(get_fabric_label, 44), be_const_closure(Matter_Session_get_fabric_label_closure) }, + { be_const_key_weak(init, -1), be_const_closure(Matter_Session_init_closure) }, + { be_const_key_weak(update, -1), be_const_closure(Matter_Session_update_closure) }, + { be_const_key_weak(get_fabric_compressed, -1), be_const_closure(Matter_Session_get_fabric_compressed_closure) }, + { be_const_key_weak(get_ac, 32), be_const_closure(Matter_Session_get_ac_closure) }, + { be_const_key_weak(_CASE, 41), be_const_int(2) }, + { be_const_key_weak(get_device_id, -1), be_const_closure(Matter_Session_get_device_id_closure) }, + { be_const_key_weak(persist_to_fabric, 25), be_const_closure(Matter_Session_persist_to_fabric_closure) }, + { be_const_key_weak(fromjson, -1), be_const_static_closure(Matter_Session_fromjson_closure) }, + { be_const_key_weak(local_session_id, 4), be_const_var(3) }, + { be_const_key_weak(set_admin_subject_vendor, -1), be_const_closure(Matter_Session_set_admin_subject_vendor_closure) }, + { be_const_key_weak(get_fabric_id, -1), be_const_closure(Matter_Session_get_fabric_id_closure) }, + { be_const_key_weak(is_PASE, -1), be_const_closure(Matter_Session_is_PASE_closure) }, + { be_const_key_weak(get_icac, -1), be_const_closure(Matter_Session_get_icac_closure) }, + { be_const_key_weak(shared_secret, -1), be_const_var(27) }, + { be_const_key_weak(_breadcrumb, -1), be_const_var(25) }, + { be_const_key_weak(get_ca_pub, 31), be_const_closure(Matter_Session_get_ca_pub_closure) }, + { be_const_key_weak(_PASE, -1), be_const_int(1) }, + { be_const_key_weak(get_ipk_epoch_key, -1), be_const_closure(Matter_Session_get_ipk_epoch_key_closure) }, + { be_const_key_weak(get_i2r, 23), be_const_closure(Matter_Session_get_i2r_closure) }, + { be_const_key_weak(r2ikey, 65), be_const_var(21) }, + { be_const_key_weak(__Msg1, -1), be_const_var(28) }, + { be_const_key_weak(counter_rcv, -1), be_const_var(10) }, + { be_const_key_weak(_port, -1), be_const_var(16) }, + { be_const_key_weak(set_ca, -1), be_const_closure(Matter_Session_set_ca_closure) }, + { be_const_key_weak(_COUNTER_SND_INCR, -1), be_const_int(1024) }, + { be_const_key_weak(set_fabric_device, -1), be_const_closure(Matter_Session_set_fabric_device_closure) }, + { be_const_key_weak(get_r2i, 43), be_const_closure(Matter_Session_get_r2i_closure) }, + { be_const_key_weak(get_admin_subject, -1), be_const_closure(Matter_Session_get_admin_subject_closure) }, + { be_const_key_weak(__Msg2, -1), be_const_var(29) }, + { be_const_key_weak(_counter_insecure_rcv, 64), be_const_var(18) }, + { be_const_key_weak(_message_handler, 58), be_const_var(17) }, { be_const_key_weak(get_ipk_group_key, -1), be_const_closure(Matter_Session_get_ipk_group_key_closure) }, - { be_const_key_weak(__Msg1, 0), be_const_var(28) }, + { be_const_key_weak(_ip, 53), be_const_var(15) }, + { be_const_key_weak(set_mode_PASE, -1), be_const_closure(Matter_Session_set_mode_PASE_closure) }, + { be_const_key_weak(_store, -1), be_const_var(0) }, + { be_const_key_weak(mode, -1), be_const_var(1) }, + { be_const_key_weak(is_CASE, -1), be_const_closure(Matter_Session_is_CASE_closure) }, + { be_const_key_weak(__future_initiator_session_id, -1), be_const_var(8) }, + { be_const_key_weak(i2rkey, -1), be_const_var(20) }, + { be_const_key_weak(counter_snd, -1), be_const_var(11) }, + { be_const_key_weak(counter_rcv_validate, -1), be_const_closure(Matter_Session_counter_rcv_validate_closure) }, + { be_const_key_weak(last_used, -1), be_const_var(6) }, + { be_const_key_weak(set_noc, -1), be_const_closure(Matter_Session_set_noc_closure) }, + { be_const_key_weak(_counter_snd_impl, -1), be_const_var(13) }, + { be_const_key_weak(_counter_rcv_impl, 22), be_const_var(12) }, + { be_const_key_weak(get_mode, 13), be_const_closure(Matter_Session_get_mode_closure) }, + { be_const_key_weak(__chunked_attr_reports, -1), be_const_var(30) }, + { be_const_key_weak(fabric_completed, -1), be_const_closure(Matter_Session_fabric_completed_closure) }, + { be_const_key_weak(created, -1), be_const_var(5) }, + { be_const_key_weak(get_noc, -1), be_const_closure(Matter_Session_get_noc_closure) }, })), be_str_weak(Matter_Session) ); diff --git a/lib/libesp32/berry_matter/src/solidify/solidified_Matter_UI.h b/lib/libesp32/berry_matter/src/solidify/solidified_Matter_UI.h index 90a72084c..2a634d20c 100644 --- a/lib/libesp32/berry_matter/src/solidify/solidified_Matter_UI.h +++ b/lib/libesp32/berry_matter/src/solidify/solidified_Matter_UI.h @@ -186,7 +186,7 @@ be_local_closure(Matter_UI_web_sensor, /* name */ /* K12 */ be_nested_str_weak(content_send), /* K13 */ be_nested_str_weak(format), /* K14 */ be_nested_str_weak(_X3Cdiv_X20style_X3D_X27text_X2Dalign_X3Aright_X3Bfont_X2Dsize_X3A11px_X3Bcolor_X3A_X23aaa_X3B_X27_X3E_X25s_X3C_X2Fdiv_X3E), - /* K15 */ be_nested_str_weak(No_X20active_X20associaition), + /* K15 */ be_nested_str_weak(No_X20active_X20association), /* K16 */ be_const_int(1), /* K17 */ be_nested_str_weak(_X20active_X20association), /* K18 */ be_nested_str_weak(s), @@ -907,7 +907,7 @@ be_local_closure(Matter_UI_show_commissioning_info, /* name */ 0, /* has sup protos */ NULL, /* no sub protos */ 1, /* has constants */ - ( &(const bvalue[18]) { /* constants */ + ( &(const bvalue[20]) { /* constants */ /* K0 */ be_nested_str_weak(webserver), /* K1 */ be_nested_str_weak(string), /* K2 */ be_nested_str_weak(device), @@ -917,19 +917,21 @@ be_local_closure(Matter_UI_show_commissioning_info, /* name */ /* K6 */ be_const_int(0), /* K7 */ be_nested_str_weak(content_send), /* K8 */ be_nested_str_weak(format), - /* K9 */ be_nested_str_weak(_X3Cfieldset_X3E_X3Clegend_X3E_X3Cb_X3E_X26nbsp_X3B_X5B_X20Commissioning_X20open_X20for_X20_X25i_X20min_X20_X5D_X26nbsp_X3B_X3C_X2Fb_X3E_X3C_X2Flegend_X3E_X3Cp_X3E_X3C_X2Fp_X3E), + /* K9 */ be_nested_str_weak(_X3Cfieldset_X3E_X3Clegend_X3E_X3Cb_X3E_X26nbsp_X3BCommissioning_X20open_X20for_X20_X25i_X20min_X26nbsp_X3B_X3C_X2Fb_X3E_X3C_X2Flegend_X3E_X3Cp_X3E_X3C_X2Fp_X3E), /* K10 */ be_nested_str_weak(compute_manual_pairing_code), /* K11 */ be_nested_str_weak(_X3Cp_X3EManual_X20pairing_X20code_X3A_X3Cbr_X3E_X3Cb_X3E_X25s_X2D_X25s_X2D_X25s_X3C_X2Fb_X3E_X3C_X2Fp_X3E_X3Chr_X3E), /* K12 */ be_const_int(3), /* K13 */ be_const_int(2147483647), - /* K14 */ be_nested_str_weak(compute_qrcode_content), - /* K15 */ be_nested_str_weak(show_qrcode), - /* K16 */ be_nested_str_weak(_X3Cp_X3E_X20_X25s_X3C_X2Fp_X3E), - /* K17 */ be_nested_str_weak(_X3Cp_X3E_X3C_X2Fp_X3E_X3C_X2Ffieldset_X3E_X3Cp_X3E_X3C_X2Fp_X3E), + /* K14 */ be_nested_str_weak(_X3Cdiv_X3E_X3Ccenter_X3E), + /* K15 */ be_nested_str_weak(compute_qrcode_content), + /* K16 */ be_nested_str_weak(show_qrcode), + /* K17 */ be_nested_str_weak(_X3Cp_X3E_X20_X25s_X3C_X2Fp_X3E), + /* K18 */ be_nested_str_weak(_X3C_X2Fdiv_X3E), + /* K19 */ be_nested_str_weak(_X3Cp_X3E_X3C_X2Fp_X3E_X3C_X2Ffieldset_X3E_X3Cp_X3E_X3C_X2Fp_X3E), }), be_str_weak(show_commissioning_info), &be_const_str_solidified, - ( &(const binstruction[56]) { /* code */ + ( &(const binstruction[66]) { /* code */ 0xA4060000, // 0000 IMPORT R1 K0 0xA40A0200, // 0001 IMPORT R2 K1 0x880C0102, // 0002 GETMBR R3 R0 K2 @@ -970,22 +972,32 @@ be_local_closure(Matter_UI_show_commissioning_info, /* name */ 0x94340A0D, // 0025 GETIDX R13 R5 R13 0x7C200A00, // 0026 CALL R8 5 0x7C180400, // 0027 CALL R6 2 - 0x88180102, // 0028 GETMBR R6 R0 K2 - 0x8C180D0E, // 0029 GETMET R6 R6 K14 - 0x7C180200, // 002A CALL R6 1 - 0x8C1C010F, // 002B GETMET R7 R0 K15 - 0x5C240C00, // 002C MOVE R9 R6 - 0x7C1C0400, // 002D CALL R7 2 - 0x8C1C0307, // 002E GETMET R7 R1 K7 - 0x8C240508, // 002F GETMET R9 R2 K8 - 0x582C0010, // 0030 LDCONST R11 K16 - 0x5C300C00, // 0031 MOVE R12 R6 - 0x7C240600, // 0032 CALL R9 3 - 0x7C1C0400, // 0033 CALL R7 2 - 0x8C1C0307, // 0034 GETMET R7 R1 K7 - 0x58240011, // 0035 LDCONST R9 K17 - 0x7C1C0400, // 0036 CALL R7 2 - 0x80000000, // 0037 RET 0 + 0x8C180307, // 0028 GETMET R6 R1 K7 + 0x8C200508, // 0029 GETMET R8 R2 K8 + 0x5828000E, // 002A LDCONST R10 K14 + 0x7C200400, // 002B CALL R8 2 + 0x7C180400, // 002C CALL R6 2 + 0x88180102, // 002D GETMBR R6 R0 K2 + 0x8C180D0F, // 002E GETMET R6 R6 K15 + 0x7C180200, // 002F CALL R6 1 + 0x8C1C0110, // 0030 GETMET R7 R0 K16 + 0x5C240C00, // 0031 MOVE R9 R6 + 0x7C1C0400, // 0032 CALL R7 2 + 0x8C1C0307, // 0033 GETMET R7 R1 K7 + 0x8C240508, // 0034 GETMET R9 R2 K8 + 0x582C0011, // 0035 LDCONST R11 K17 + 0x5C300C00, // 0036 MOVE R12 R6 + 0x7C240600, // 0037 CALL R9 3 + 0x7C1C0400, // 0038 CALL R7 2 + 0x8C1C0307, // 0039 GETMET R7 R1 K7 + 0x8C240508, // 003A GETMET R9 R2 K8 + 0x582C0012, // 003B LDCONST R11 K18 + 0x7C240400, // 003C CALL R9 2 + 0x7C1C0400, // 003D CALL R7 2 + 0x8C1C0307, // 003E GETMET R7 R1 K7 + 0x58240013, // 003F LDCONST R9 K19 + 0x7C1C0400, // 0040 CALL R7 2 + 0x80000000, // 0041 RET 0 }) ) ); diff --git a/tasmota/tasmota_xdrv_driver/xdrv_52_3_berry_crypto.ino b/tasmota/tasmota_xdrv_driver/xdrv_52_3_berry_crypto.ino index cc1f278a5..bec624546 100644 --- a/tasmota/tasmota_xdrv_driver/xdrv_52_3_berry_crypto.ino +++ b/tasmota/tasmota_xdrv_driver/xdrv_52_3_berry_crypto.ino @@ -232,7 +232,9 @@ extern "C" { int ret = br_ccm_reset(ccm_ctx, nonce, nonce_len, aad_len, data_len, tag_len); if (ret == 0) { be_raise(vm, "value_error", "br_ccm_reset failed"); } - br_ccm_aad_inject(ccm_ctx, aad, aad_len); + if (aad_len > 0) { + br_ccm_aad_inject(ccm_ctx, aad, aad_len); + } br_ccm_flip(ccm_ctx); be_return_nil(vm);