-
Notifications
You must be signed in to change notification settings - Fork 44
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Run DPE verification tests against Caliptra
Use HwModel and libcaliptra to run DPE's verification tests (written in Go) against Caliptra. This suite tests conformance with the DPE spec as well as related X.509 and PKCS#10 specs.
- Loading branch information
Showing
12 changed files
with
491 additions
and
50 deletions.
There are no files selected for viewing
Submodule dpe
updated
46 files
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
LIBCALIPTRA_DIR = ../../libcaliptra | ||
HW_MODEL_C_DIR = ../../hw-model/c-binding | ||
TARGET_DIR = ../../target | ||
BUILDER_DIR = ../../builder | ||
|
||
ROM_FILE = /tmp/caliptra_rom.bin | ||
FW_FILE = /tmp/image_bundle.bin | ||
|
||
LIBCALIPTRA = $(LIBCALIPTRA_DIR)/libcaliptra.a | ||
LIB_HW_MODEL = $(TARGET_DIR)/debug/libcaliptra_hw_model_c_binding.a | ||
|
||
EXTRA_CARGO_CONFIG = target.'cfg(all())'.rustflags = [\"-Dwarnings\"] | ||
|
||
.PHONY: $(LIBCALIPTRA) $(LIB_HW_MODEL) $(ROM_FILE) $(FW_FILE) | ||
|
||
$(LIBCALIPTRA): | ||
# For some reason, libcaliptra doesn't get rebuilt when the code changes. | ||
# That will need to be fixed in the libcaliptra Makefile. | ||
make -C $(LIBCALIPTRA_DIR) clean | ||
make -C $(LIBCALIPTRA_DIR) | ||
|
||
$(LIB_HW_MODEL): | ||
cargo build --config="$(EXTRA_CARGO_CONFIG)" --manifest-path $(HW_MODEL_C_DIR)/Cargo.toml | ||
|
||
$(FW_FILE) $(ROM_FILE): | ||
cargo --config="$(EXTRA_CARGO_CONFIG)" run --manifest-path=$(BUILDER_DIR)/Cargo.toml --bin image -- --fw $(FW_FILE) --rom-no-log=$(ROM_FILE) | ||
|
||
run: $(LIBCALIPTRA) $(LIB_HW_MODEL) $(FW_FILE) $(ROM_FILE) | ||
ROM_PATH=$(ROM_FILE) FW_PATH=$(FW_FILE) go test -v |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package dpe | ||
|
||
import ( | ||
"github.com/chipsalliance/caliptra-dpe/verification" | ||
"os" | ||
"testing" | ||
) | ||
|
||
func TestRunAll(t *testing.T) { | ||
for _, test := range verification.TestCases { | ||
t.Run(test.Name, func(t *testing.T) { | ||
var d verification.TestDPEInstance = &CptraModel{exe_path: ""} | ||
|
||
if !verification.HasSupportNeeded(d, test.SupportNeeded) { | ||
t.Skipf("Warning: Target does not have required support, skipping test.") | ||
} | ||
|
||
test.Run(d, t) | ||
}) | ||
} | ||
} | ||
|
||
func TestMain(m *testing.M) { | ||
exitVal := m.Run() | ||
os.Exit(exitVal) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
module dpe | ||
|
||
go 1.22 | ||
|
||
replace github.com/chipsalliance/caliptra-dpe/verification => ../../dpe/verification | ||
|
||
require github.com/chipsalliance/caliptra-dpe/verification v0.0.0-20231002193428-bb19016edf87 | ||
|
||
require ( | ||
github.com/pelletier/go-toml v1.9.3 // indirect | ||
github.com/weppos/publicsuffix-go v0.30.1-0.20230422193905-8fecedd899db // indirect | ||
github.com/zmap/zcrypto v0.0.0-20230422215203-9a665e1e9968 // indirect | ||
github.com/zmap/zlint/v3 v3.4.1 // indirect | ||
golang.org/x/crypto v0.7.0 // indirect | ||
golang.org/x/exp v0.0.0-20230817173708-d852ddb80c63 // indirect | ||
golang.org/x/net v0.8.0 // indirect | ||
golang.org/x/text v0.8.0 // indirect | ||
) |
Oops, something went wrong.