Skip to content
This repository has been archived by the owner on Mar 29, 2022. It is now read-only.

Partial verification secondary #190

Open
wants to merge 19 commits into
base: develop
Choose a base branch
from

Conversation

tanishqjasoria
Copy link

Purpose of the PR:

Implement and demonstrate the partial verification Secondary.
Addressing the issue #48

Summary of Changes:

  • Update the structure of the partial metadata distributed by the Primary
  • Update demo file to comply with the partial verification Secondary also
  • Add function to verify the partial metadata, compling to the latest Uptane standard
  • Update sample metadata to include an update for the new partial verification secondary
  • Update test_secondary to perform tests for the partial verification Secondary also
    • Verifying metadata and retrieving the target fileinfo
    • Validating the image for the partial verifying secondary

Further Requirements:

The Readme files needed to be updated

Now metadata distributed to the partial verification secondaries
would be in the form of a archive with the structure almost
similar to that of the distributed archive for full verification.
Here only director repo would be present and it would only have
the targets metadata.

This is done so that the secondary could obtain, save and expand
the metadata recieved from primary in a similar fashion as that
of full verification. It would further help in simplifying the
partial verification process
Now primary is sending archive for partial verification
metadata as well.
Used various tuf low level functions to verify the targets metadata
supplied by the director repository. It complies with the latest
Uptane standard for design.
Earlier even if no target_info was provided the
validated_targets_for_this_ecu would be emptied.

Now if new target info is present, then the list
validated_targets_for_this_ecu would be updated
Earlier the test data was stores in seperate lists like
TEMP_CLIENT_DIRS, vins, ecu_serials and secondary_instances

Now all the data corresponding to a particular secondary is
stored in a dictionary and all the dictionaries are further
stored in a list TEST_INSTANCES
Update the function get_partial_metadata_fname to
get_partial_metadata_archive_fname
Earlier the partial metadata supplied by the primary was
just director_targets file but now the primary provides a
archive with the structure similar to that of full metadata
Modified metadata files to include a possible update
for the newly included partial verifying secondary ECU.
…t the update

This included fileinfo corresponds to the info of the
update that the partial verifying ECU would donwnload
as per the new metadata.
The tests for partial verification ECU are carried out in the
similar fashion as that of the full verification ECU.
Due to some discrepency in json and der metadata
the tests failed while working with der formats
Copy link
Collaborator

@lukpueh lukpueh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this PR, @tanishqjasoria! This looks mostly good, judging from #48 and the corresponding parts in the Uptane Standard. I left requests for clarification, where I wasn't sure, and raised a few minor concerns here and there. Note that I did not review any metadata.

Please let me know when you think this is ready for another round of review.

tests/test_secondary.py Outdated Show resolved Hide resolved
'partial_verifying': True,
'vin': '000',
'ecu_serial': 'pv_00000',
'instance': None}]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor: These test instances are often addressed by their index. For the sake of readability, would it make sense to make TEST_INSTANCES a dictionary (ordered, if necessary), so each instance can be addressed by a descriptive name (if such a name is available)?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can keep their name as that of their client_directory?

tests/test_secondary.py Show resolved Hide resolved
tests/test_secondary.py Outdated Show resolved Hide resolved
uptane/clients/secondary.py Outdated Show resolved Hide resolved
uptane/clients/secondary.py Show resolved Hide resolved
uptane/clients/secondary.py Outdated Show resolved Hide resolved
uptane/clients/primary.py Outdated Show resolved Hide resolved
uptane/clients/primary.py Outdated Show resolved Hide resolved
demo/demo_secondary.py Show resolved Hide resolved
Earlier all the 6 test instances were stored
as list. Now all the test instances are stored
as a dictionaries indexed by their client directory
names
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants