ko-isobe / tamproto

BSD 2-Clause "Simplified" License
8 stars 3 forks source link

Encoding error while Update message with large size SUIT manifest #15

Open kentakayama opened 1 year ago

kentakayama commented 1 year ago

https://github.com/ko-isobe/tamproto/blob/master/teep-p.js#L387

        case TEEP_TYPE_update: // TrustedAppUpdate
            logger.debug(obj);
            let TAUpdateOption = new cbor.Map();
            if (obj.hasOwnProperty("manifest-list")) { // 10: manifest-list (ref.CBORLabels)
                TAUpdateOption.set(cborLtoI['manifest-list'], obj["manifest-list"]);
            }
            TAUpdateOption.set(cborLtoI['token'], obj.TOKEN); // 20: token * this token is not neccessary
            if (obj.hasOwnProperty("TC_LIST")) { // 8: tc-list (unneeded and deleting TC-LIST)
                TAUpdateOption.set(cborLtoI['tc-list'], obj.TC_LIST);
            }
            // * $$update-extensions and * $$teep-option-extensions added if needed.
            cborArray.push(TAUpdateOption);

may cause Stream API overflow, originally reported here.