Skip to content

Commit c40e6cb

Browse files
umbynosper1234
andcommitted
Apply suggestions from code review
Co-authored-by: per1234 <accounts@perglass.com>
1 parent d480ae5 commit c40e6cb

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

docs/platform-specification.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,13 +155,17 @@ the name of the architecture is set as well.
155155

156156
There are some other **{build.xxx}** properties available, that are explained in the boards.txt section of this guide.
157157

158+
#### Security credential properties
159+
158160
Some of them allow specifying trusted security credentials (signing and encryption keys) that can be used by a
159161
["secure boot" system](guides/secure-boot.md):
160162

161163
- `build.keys.keychain`: for the directory containing the keys
162164
- `build.keys.sign_key`: for the signing key
163165
- `build.keys.encrypt_key`: for the encryption key
164166

167+
If any of these properties are defined, the others are required.
168+
165169
These properties can be overwritten respectively with `--keys-keychain`, `--sign-key`, `--encrypt-key`
166170
[compile](commands/arduino-cli_compile.md) flags in the Arduino CLI.
167171

legacy/builder/setup_build_properties.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,8 +131,8 @@ func (s *SetupBuildProperties) Run(ctx *types.Context) error {
131131
signProp := buildProperties.ContainsKey("build.keys.sign_key")
132132
encryptProp := buildProperties.ContainsKey("build.keys.encrypt_key")
133133
// we verify that all the properties for the secure boot keys are defined or none of them is defined.
134-
if !(keychainProp || signProp || encryptProp) && (keychainProp && signProp && encryptProp) {
135-
return errors.Errorf("%s core does not specify correctly default sign and encryption keys", ctx.BuildCore)
134+
if (keychainProp || signProp || encryptProp) && !(keychainProp && signProp && encryptProp) {
135+
return errors.Errorf("%s platform does not specify correctly default sign and encryption keys", targetPlatform.Platform)
136136
}
137137

138138
ctx.BuildProperties = buildProperties

0 commit comments

Comments
 (0)