1 // Copyright 2021 The Pigweed Authors 2 // 3 // Licensed under the Apache License, Version 2.0 (the "License"); you may not 4 // use this file except in compliance with the License. You may obtain a copy of 5 // the License at 6 // 7 // https://www.apache.org/licenses/LICENSE-2.0 8 // 9 // Unless required by applicable law or agreed to in writing, software 10 // distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 11 // WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 12 // License for the specific language governing permissions and limitations under 13 // the License. 14 #pragma once 15 16 // The size of the buffer to create on stack for streaming manifest data from 17 // the bundle reader. 18 #define WRITE_MANIFEST_STREAM_PIPE_BUFFER_SIZE 8 19 20 // The maximum allowed length of a target name. 21 #define MAX_TARGET_NAME_LENGTH 32 22 23 // The maximum allowed payload size in bytes. This is used to mitigate DoS 24 // attacks. 25 #ifndef PW_SOFTWARE_UPDATE_MAX_TARGET_PAYLOAD_SIZE 26 #define PW_SOFTWARE_UPDATE_MAX_TARGET_PAYLOAD_SIZE (100 * 1024 * 1024) 27 #endif // PW_SOFTWARE_UPDATE_MAX_TARGET_PAYLOAD_SIZE 28 29 // Not recommended. Disable compilation of bundle verification. 30 #ifndef PW_SOFTWARE_UPDATE_DISABLE_BUNDLE_VERIFICATION 31 #define PW_SOFTWARE_UPDATE_DISABLE_BUNDLE_VERIFICATION (false) 32 #endif // PW_SOFTWARE_UPDATE_DISABLE_BUNDLE_VERIFICATION 33 34 // Whether to support bundle "personalization", which is a feature that 35 // strips some or all target files that a device claims to already have from an 36 // incoming bundle in order to improve performance. 37 #ifndef PW_SOFTWARE_UPDATE_WITH_PERSONALIZATION 38 #define PW_SOFTWARE_UPDATE_WITH_PERSONALIZATION (true) 39 #endif // PW_SOFTWARE_UPDATE_WITH_PERSONALIZATION