File tree 1 file changed +12
-0
lines changed
1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -26,6 +26,7 @@ import (
26
26
"github.com/arduino/arduino-cli/legacy/builder/types"
27
27
properties "github.com/arduino/go-properties-orderedmap"
28
28
timeutils "github.com/arduino/go-timeutils"
29
+ "github.com/pkg/errors"
29
30
)
30
31
31
32
type SetupBuildProperties struct {}
@@ -126,6 +127,17 @@ func (s *SetupBuildProperties) Run(ctx *types.Context) error {
126
127
127
128
buildProperties .Merge (ctx .PackageManager .CustomGlobalProperties )
128
129
130
+ // we check if the properties referring to secure boot 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
+
129
141
ctx .BuildProperties = buildProperties
130
142
131
143
return nil
You can’t perform that action at this time.
0 commit comments