Commit graph

1590 commits

Author SHA1 Message Date
Vladimir Diaz
7b27fcec64 Continue unit test updates. 2014-01-30 13:06:33 -05:00
Vladimir Diaz
36b59f922e Continue updating unit tests and modify ROOT_SCHEMA. 2014-01-30 08:11:35 -05:00
Vladimir Diaz
009ddd9f37 Rename top-level role and functions of repository_tool.py. Update documentation and diagram.
add_key() -> add_verification_key()
remove_key() -> remove_verification_key()
release.json -> snapshot.json
Update repository_tool-diagram.png
Update README following the renamed functions and release role changes.
Minor edits, such as removing lint left over from a previous merge conflict.
2014-01-29 11:26:56 -05:00
Santiago Torres
724248556b Merge branch 'repository-tools' of github.com:theupdateframework/tuf into developer-tools 2014-01-28 22:47:58 -05:00
Santiago Torres
940142b2dc Prefix property handling
Updated the module so it prepends the prefix property by prepending it
to the filenames before signing the metadata on the write method.
2014-01-28 22:46:10 -05:00
Vladimir Diaz
aacf74129e Merge branch 'repository-tools' of https://github.com/theupdateframework/tuf into repository-tools 2014-01-27 13:35:30 -05:00
Vladimir Diaz
3b5e0c0814 Merge 'develop' and resolve conflicts. 2014-01-27 13:35:11 -05:00
Vladimir Diaz
7b535812d1 Update README.md
Reorganize sections and update the "delegate to hashed bins" section.
2014-01-27 13:17:27 -05:00
Vladimir Diaz
d380997b75 Minor edits, merge, and resolve conflicts. 2014-01-27 13:15:03 -05:00
Vladimir Diaz
2c55b94a8b Modify the extension of rolename files.
rolename.txt -> rolename.json.
2014-01-27 11:35:38 -05:00
Vladimir Diaz
8712099953 Verify delegated target paths in repository_tool.py.
repository_tool.py verified that valid metadata was written, properly signed, hashes all matched, and required roles created.  The only check missing was verification of delegated target paths according the parent's delegations.  Now, target paths are validated before write() is called for both 'path' and 'path_hash_prefixes'.  updater.py has always properly verified paths, only repository_tool.py needed the support.  If any of the delegated paths are not allowed, write()
raises the following exception:
tuf.ForbiddenTargetError: Role 'targets/unclaimed' specifies target '/simple/bad_file.txt', which is not an allowed path according to the delegations set by its parent role.
2014-01-27 10:55:14 -05:00
vladdd
298f52ddb8 Modify format of paths in metadata and minor fixes.
Allow leading os.sep for target and restricted paths listed in metadata.  Previously, '{repository directory}/targets/file.txt' was listed as 'file.txt' and unsuccessfully compared against '/', or the root-most targets directory.  Now, '/file.txt' & '/' and similar examples may be compared and verified.

Fix issue where a hashed bin with empty targets was flagged as invalid because its targets did not produce a path hash prefix that matched any of those listed in the parent role.  Uncovered with _ensure_all_targets_allowed().

Minor edits to code that compared paths and and used path separators.
2014-01-25 16:40:53 -05:00
Santiago Torres
e4de851d28 Fixed the status and write methods on devtools.py
I need to review the whole code and refactor some sections to meet
the specifications, optimize performance and minimize filesize.

Thorough checking of this module is needed. Expect unused variables
and functions.
2014-01-25 12:04:56 -05:00
Santiago Torres
44d4acdd77 updated devtools file to include repository tools instead of libtuf 2014-01-24 17:24:03 -05:00
Santiago Torres
d24e01c624 Merge branch 'repository-tools' of github.com:theupdateframework/tuf into developer-tools 2014-01-24 16:55:47 -05:00
Vladimir Diaz
7f8a7e78a6 Refactor and fix status() in repository_tool.py.
Update and refactor status() following the changes to how metadata is written.
Minor comment change to conf.py.
Example output:
'root' role contains 1 / 1 signatures.
'targets' role contains 1 / 1 signatures.
'release' role contains 1 / 1 signatures.
'timestamp' role contains 1 / 1 signatures.

# Verify invalid number of public and private keys.
'timestamp' role contains 0 / 1 signing keys.

# Determine the delegated roles with invalid metadata.
Delegated roles with insufficient keys:
['targets/unclaimed/1', 'targets/unclaimed/0', 'targets/unclaimed/2', 'targets/unclaimed/5', 'targets/unclaimed/4', 'targets/unclaimed/7', 'targets/unclaimed/6', 'targets/unclaimed/9', 'targets/unclaimed/f', 'targets/unclaimed/3', 'targets/unclaimed/a', 'targets/unclaimed/c', 'targets/unclaimed/b', 'targets/unclaimed/e', 'targets/unclaimed/d', 'targets/unclaimed/8']
2014-01-24 10:54:10 -05:00
Vladimir Diaz
761c83f717 Remove outdated module name from repository_tool.py diagram. 2014-01-24 07:26:57 -05:00
Vladimir Diaz
ffa4bbe4be Update README.md
Initial documentation of delegation to hashed bins and consistent snapshots.
2014-01-23 13:14:08 -05:00
Vladimir Diaz
570640898d Update repository tool diagram and README. 2014-01-23 12:34:59 -05:00
Vladimir Diaz
973d3a23a3 Address Issue #137 and update repository_tool.py.
Add the add_restricted_paths() method.
Rename libtuf.py
Update README.
Update delegate_hashed_bins() docstring.
More testing of hashed bins and consistent snapshots.
Remove old scripts from setup.py.
2014-01-23 12:03:31 -05:00
Santiago Torres
81f235de8a Added the base skeleton for the tuf developer tools file.
This version is not a working one, and breaks on the status() call. Some
dependencies are not met yet
2014-01-22 21:03:23 -05:00
Santiago Torres
eefc7f2054 Merge branch 'repository-tools' of github.com:theupdateframework/tuf into developer-tools 2014-01-22 17:17:35 -05:00
Vladimir Diaz
96f6152fbf Update issue #137.
Modify format of hash bin delegations.
Test implementation.
2014-01-22 12:52:55 -05:00
Santiago Torres
47ab2bef05 Merge branch 'repository-tools' of github.com:theupdateframework/tuf into repository-tools 2014-01-21 17:55:47 -05:00
Vladimir Diaz
5d1906a239 Update issues #151 and #137.
Update docstrings and comments and complete the initial implementation of issue 151.
Adjust logger level for tuf.download._check_downloaded_length().
Initial implementation of issue 137.
2014-01-21 14:42:28 -05:00
Vladimir Diaz
44231f249e Merge pull request #166 from dachshund/consistent-snapshots-specification
Consistent snapshots specification
2014-01-21 04:27:40 -08:00
vladdd
52fdb2ea5f Adjust logger level for compressed and uncompressed metadata. 2014-01-18 20:45:21 -05:00
vladdd
fbd7b147e8 Address Issues #151 and #156.
Adjust logger messages and levels.
Update use of tuf.conf variable so that it can be updated in code.
Update updater.py comments.
2014-01-18 18:37:27 -05:00
Vladimir Diaz
98cb21282e Update README.md
Update the libtuf README following the fix for Issue #167.
Add ed25519 examples and update comments.
2014-01-18 17:10:03 -05:00
vladdd
b2e220f598 Fix Issue #167. 2014-01-18 17:09:32 -05:00
dachshund
a0a51d6f5e Slightly change filename modification. 2014-01-17 15:31:42 -05:00
Vladimir Diaz
a9d90e7ce0 Finish initial implementation of Issue #151 and reading consistent snapshots.
Support multiple hash algorithms, where the generated digests of metadata and
target files is included in metadata (and filenames if 'consistent_snapshots'
is True).  Previously, only a single hash algorithm was supported, and it was
set by default to 'sha256' in code.  Repository maintainers may now choose any,
and/or multiple, hash algorithms from those supported by TUF.  By default,
'sha256' is used when generating digests.

Support the recent change to the TUF specification, where writing consistent
snapshots may include N versions of identical metadata and targets, if N hash
algorithms is used by the repository when generating metadata.

Update code affected by the recent changes to the specification, such as
targets that may include digests in their filename.

Support consistent snapshots of compressed metadata, including repositories
that provide multiple versions of metadata with different digests included
in their filenames.

The repository tools can now load repositories that include consistent snapshots
of metadata and targets, including those with multiple (i.e., multiple digests
prepended to filenames) consistent snapshots of files.

The client code may now read repositories with 'consistent_snapshots': true in
Root metadata, and properly request and update files with digests included.
2014-01-17 11:05:40 -05:00
dachshund
9dbb3a7815 A few clarifications to the spec on consistent snapshots. 2014-01-14 20:11:35 -05:00
Vladimir Diaz
85a120f0b7 Initial implementation of Issue #151.
Initial implementation of writing consistent snapshots

Update Root schema
Support writing metadata in rolename.ext and digest.rolename.ext formats.
Modify libtuf.py methods that walk and extract metadata to recognize the digest.rolename.ext format.
Write root.txt and timestamp.txt if consistent_snapshots is True.
Support automatic version increments of delegated metadata.
2014-01-14 10:01:17 -05:00
Vladimir Diaz
04221d3f0d Address issue #163.
Changed behavior:
Write metadata only if the uncompressed version has not been written, has changed, or if
compressed versions are missing (if requested).  Not only is re-saving unmodified metadata not ideal, it also forces a new version of the release file if compressed metadata is rewritten.  gzip attaches a timestamp to compressed files, which may cause compressed content to generate different digests if independently written.

Update libtuf.py comments.
Minor edit to docstrings of previous commit that addressed interposition issues.
2014-01-13 09:34:21 -05:00
Vladimir Diaz
08f894f741 Update README.md
Fix typos.
2014-01-09 17:29:42 -05:00
Vladimir Diaz
08c8f04fbb Merge branch 'repository-tools' of https://github.com/theupdateframework/tuf into repository-tools 2014-01-09 10:55:34 -05:00
Vladimir Diaz
cd60d6dfb6 Address issue #164.
Backup client and server spec pdfs
Add missing .sh code to tex document
Change code listing formatting
Fix minor issues
2014-01-09 10:55:05 -05:00
Vladimir Diaz
780480a21d Update README.md
Removed the outdated client and server specs linked.
2014-01-09 10:27:40 -05:00
Vladimir Diaz
1e69c9583a Remove linked+outdated client and server specs 2014-01-09 10:26:52 -05:00
Vladimir Diaz
32d4ae0339 Merge branch 'repository-tools' of https://github.com/theupdateframework/tuf into repository-tools 2014-01-09 10:11:02 -05:00
Vladimir Diaz
b73393c214 Resolve issues #149 and #155.
Move 'tuf.client.updater.Updater.refresh()' call in interposition to its updater's __init__().  The refresh() was previously executed on every target request.

Add tuf.interposition.refresh() for integrations that may require a manual refresh of top-level metadata (rare).
2014-01-09 09:48:37 -05:00
dachshund
e645ff69d7 Adjust spec to carefully rename downloaded files. 2014-01-08 16:06:31 -05:00
zanefisher
43eb5633c4 Modify test code following review from Vladimir 2014-01-07 14:20:20 -05:00
dachshund
3cee44ec6f First cut of specification for consistent snapshots. 2014-01-06 19:40:54 -05:00
dachshund
c546616c1a Merge branch 'develop' into consistent-snapshots-specification 2014-01-06 16:34:50 -05:00
dachshund
4e75ead4d4 Merge remote-tracking branch 'upstream/develop' into develop 2014-01-06 16:34:17 -05:00
dachshund
8d90f3ce43 Merge branch 'develop' into consistent-snapshots-specification 2014-01-06 16:32:47 -05:00
Vladimir Diaz
cbf85fb7b8 Update README.md
Give libtuf.py's documentation a title so that it can be referenced in other documents.
2014-01-06 12:58:24 -05:00
Vladimir Diaz
4d92ea644d Update README.md 2014-01-06 12:45:39 -05:00