eif_reader: Parse eif sections according to EifHeader #26
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Issue #, if available: #25
Description of changes:
** Testing done:**
I ran a cli picking up these changes (See https://github.com/foersleo/aws-nitro-enclaves-cli/tree/test_image_format_issue25) on both architectures and ran the test suite in
scripts/run_tests.shsuccessfully. All tests passed.In addition I ran a custom EIF I generated in the following way:
hello.eiffrom the aws-nitro-enclaves-cli/examplesEifHeader::section_offsets[0..(EifHeader::num_sections - 1)]Using a hacky script to display info on an EIF we can observe the changes in the header (See same section order and sizes, but notice difference in offsets and crc):
Original file:
File with gap:
Both files share the same
PCR0,PCR1andPCR2values as both share the same functional components (kernel, ramdisks, cmdline):Running
hello_with_gap.eifwith the original nitro-cli will successfully start the enclave and in debug mode we can observe the expected behavior throughnitro-cli consolecommand. However, as soon as we runnitro-cli describe-enclavescommand we get an error (See below) and our enclave will be terminated:Running the same commands on the nitro-cli with this fix yields working results:
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.