@@ -30,6 +30,8 @@ const (
30
30
flagReset = "reset"
31
31
flagPulsar = "pulsar"
32
32
flagCustomRegistrationService = "registration-service"
33
+ flag_no_epid = "no-epid"
34
+ flag_no_dcap = "no-dcap"
33
35
)
34
36
35
37
const (
@@ -95,14 +97,19 @@ blockchain. Writes the certificate in DER format to ~/attestation_cert
95
97
return fmt .Errorf ("failed to initialize enclave: %w" , err )
96
98
}
97
99
98
- _ , err = api .CreateAttestationReport (apiKeyFile )
100
+ no_epid , _ := cmd .Flags ().GetBool (flag_no_epid )
101
+ no_dcap , _ := cmd .Flags ().GetBool (flag_no_dcap )
102
+
103
+ _ , err = api .CreateAttestationReport (apiKeyFile , no_epid , no_dcap )
99
104
if err != nil {
100
105
return fmt .Errorf ("failed to create attestation report: %w" , err )
101
106
}
102
107
return nil
103
108
},
104
109
}
105
110
cmd .Flags ().Bool (flagReset , false , "Optional flag to regenerate the enclave registration key" )
111
+ cmd .Flags ().Bool (flag_no_epid , false , "Optional flag to disable EPID attestation" )
112
+ cmd .Flags ().Bool (flag_no_dcap , false , "Optional flag to disable DCAP attestation" )
106
113
107
114
return cmd
108
115
}
@@ -247,6 +254,47 @@ func ParseCert() *cobra.Command {
247
254
return cmd
248
255
}
249
256
257
+ func DumpBin () * cobra.Command {
258
+ cmd := & cobra.Command {
259
+ Use : "dump [binary file]" ,
260
+ Short : "Dump a binary file" ,
261
+ Long : "Helper to display the contents of a binary file, and extract the public key of the secret node, which is used to" +
262
+ "register the node, during node initialization" ,
263
+ Args : cobra .ExactArgs (1 ),
264
+ RunE : func (cmd * cobra.Command , args []string ) error {
265
+ data , err := os .ReadFile (args [0 ])
266
+ if err != nil {
267
+ return err
268
+ }
269
+
270
+ fmt .Printf ("%s\n " , hex .EncodeToString (data ))
271
+ return nil
272
+ },
273
+ }
274
+
275
+ return cmd
276
+ }
277
+
278
+ func MigrateSealings () * cobra.Command {
279
+ cmd := & cobra.Command {
280
+ Use : "migrate_sealing" ,
281
+ Short : "Migrate sealed files to the current format" ,
282
+ Long : "Re-create SGX-sealed files according to the current format" ,
283
+ Args : cobra .ExactArgs (0 ),
284
+ RunE : func (cmd * cobra.Command , args []string ) error {
285
+ _ , err := api .MigrateSealing ()
286
+ if err != nil {
287
+ return fmt .Errorf ("failed to start enclave. Enclave returned: %s" , err )
288
+ }
289
+
290
+ fmt .Printf ("Migration succeeded\n " )
291
+ return nil
292
+ },
293
+ }
294
+
295
+ return cmd
296
+ }
297
+
250
298
func ConfigureSecret () * cobra.Command {
251
299
cmd := & cobra.Command {
252
300
Use : "configure-secret [master-key] [seed]" ,
@@ -436,7 +484,10 @@ Please report any issues with this command
436
484
return fmt .Errorf ("failed to initialize enclave: %w" , err )
437
485
}
438
486
439
- _ , err = api .CreateAttestationReport (apiKeyFile )
487
+ no_epid , _ := cmd .Flags ().GetBool (flag_no_epid )
488
+ no_dcap , _ := cmd .Flags ().GetBool (flag_no_dcap )
489
+
490
+ _ , err = api .CreateAttestationReport (apiKeyFile , no_epid , no_dcap )
440
491
if err != nil {
441
492
return fmt .Errorf ("failed to create attestation report: %w" , err )
442
493
}
@@ -582,5 +633,8 @@ Please report any issues with this command
582
633
cmd .Flags ().String (flagLegacyBootstrapNode , "" , "DEPRECATED: This flag is no longer required or in use" )
583
634
cmd .Flags ().String (flagLegacyRegistrationNode , "" , "DEPRECATED: This flag is no longer required or in use" )
584
635
636
+ cmd .Flags ().Bool (flag_no_epid , false , "Optional flag to disable EPID attestation" )
637
+ cmd .Flags ().Bool (flag_no_dcap , false , "Optional flag to disable DCAP attestation" )
638
+
585
639
return cmd
586
640
}
0 commit comments