Skip to content

Commit ac9cc70

Browse files
committed
sbchooser: test with a padded security directory
This test submits the following shims, each listed twice, in a random order: shim-16.1-6.x64.onesig.efi shim-16.1-6.x64.onesig.efi Against a "db" which includes: The 2011 UEFI CA cert and a "dbx" which includes: nothing This should produce the following output: shim-16.1-6.x64.onesig.efi is trusted because cert "/C=US/ST=Washington/L=Redmond/O=Microsoft Corporation/CN=Microsoft Windows UEFI Driver Publisher" is trusted by "/C=US/ST=Washington/L=Redmond/O=Microsoft Corporation/CN=Microsoft Corporation UEFI CA 2011" in db shim-16.1-6.x64.onesig.efi is trusted because cert "/C=US/ST=Washington/L=Redmond/O=Microsoft Corporation/CN=Microsoft Windows UEFI Driver Publisher" is trusted by "/C=US/ST=Washington/L=Redmond/O=Microsoft Corporation/CN=Microsoft Corporation UEFI CA 2011" in db Signed-off-by: Peter Jones <pjones@redhat.com>
1 parent 3050f5f commit ac9cc70

3 files changed

Lines changed: 22 additions & 0 deletions

File tree

tests/Makefile

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ TESTS = test.dmpstore.export \
3131
test.sbchooser.identical.secbits.explain \
3232
test.sbchooser.first.sig.only \
3333
test.sbchooser.first.sig.only.explain \
34+
test.sbchooser.padded.secdir.explain \
3435

3536
all: clean $(TESTS)
3637

@@ -632,6 +633,25 @@ test.sbchooser.first.sig.only.explain:
632633
$(quiet)rm -f test.sbchooser.first.sig.only.explain.result
633634
$(quiet)echo passed
634635

636+
test.sbchooser.padded.secdir.explain.result:
637+
$(quiet)ls -1 shim-16.1-6.x64.onesig.efi shim-16.1-6.x64.onesig.efi \
638+
| sort -R | MALLOC_PERTURB_=$(MALLOC_PERTURB_) LD_LIBRARY_PATH=../src \
639+
../src/sbchooser --explain \
640+
-d db.msft2011 \
641+
--no-system-dbx \
642+
> "$@"
643+
644+
test.sbchooser.padded.secdir.explain:
645+
$(quiet)echo testing sbchooser explanation with a padded security directory
646+
$(quiet)$(MAKE) $(makequiet) test.sbchooser.padded.secdir.explain.result
647+
$(quiet)if ! cmp test.sbchooser.padded.secdir.explain.goal.txt test.sbchooser.padded.secdir.explain.result ; then \
648+
diff -U 200 test.sbchooser.padded.secdir.explain.goal.txt test.sbchooser.padded.secdir.explain.result ; \
649+
exit 1 ; \
650+
fi
651+
$(quiet)cmp test.sbchooser.padded.secdir.explain.goal.txt test.sbchooser.padded.secdir.explain.result
652+
$(quiet)rm -f test.sbchooser.padded.secdir.explain.result
653+
$(quiet)echo passed
654+
635655
.PHONY: all clean $(TESTS)
636656

637657
# vim:ft=make

tests/shim-16.1-6.x64.onesig.efi

1000 KB
Binary file not shown.
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
shim-16.1-6.x64.onesig.efi is trusted because cert "/C=US/ST=Washington/L=Redmond/O=Microsoft Corporation/CN=Microsoft Windows UEFI Driver Publisher" is trusted by "/C=US/ST=Washington/L=Redmond/O=Microsoft Corporation/CN=Microsoft Corporation UEFI CA 2011" in db
2+
shim-16.1-6.x64.onesig.efi is trusted because cert "/C=US/ST=Washington/L=Redmond/O=Microsoft Corporation/CN=Microsoft Windows UEFI Driver Publisher" is trusted by "/C=US/ST=Washington/L=Redmond/O=Microsoft Corporation/CN=Microsoft Corporation UEFI CA 2011" in db

0 commit comments

Comments
 (0)