File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed
Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -26,6 +26,7 @@ import (
2626 "github.com/arduino/arduino-cli/legacy/builder/types"
2727 properties "github.com/arduino/go-properties-orderedmap"
2828 timeutils "github.com/arduino/go-timeutils"
29+ "github.com/pkg/errors"
2930)
3031
3132type SetupBuildProperties struct {}
@@ -126,6 +127,17 @@ func (s *SetupBuildProperties) Run(ctx *types.Context) error {
126127
127128 buildProperties .Merge (ctx .PackageManager .CustomGlobalProperties )
128129
130+ // we check if the properties referring to secureboot have been set correctly.
131+ if buildProperties .ContainsKey ("build.keys.type" ) {
132+ if buildProperties .Get ("build.keys.type" ) == "public_keys" {
133+ if ! buildProperties .ContainsKey ("build.keys.keychain" ) || ! buildProperties .ContainsKey ("build.keys.sign_key" ) || ! buildProperties .ContainsKey ("build.keys.encrypt_key" ) {
134+ return errors .Errorf ("%s core does not specify correctly default sign and encryption keys" , ctx .BuildCore )
135+ }
136+ } else {
137+ return errors .New ("\" build.keys.type\" key only supports \" public_keys\" value for now" )
138+ }
139+ }
140+
129141 ctx .BuildProperties = buildProperties
130142
131143 return nil
You can’t perform that action at this time.
0 commit comments