Commit graph

3274 commits

Author SHA1 Message Date
Vladimir Diaz
22aeff2c6a Update README.md
Add purpose section header.
Consistent snapshot section: file attributes (archive, hidden, access?) -> file hash.
2014-02-26 08:38:22 -05:00
vladdd
784b3bcf46 Update modules reviewed by Monzur.
Update keys.py and pycrypto_keys.py following Monzur's code review.
Update affected modules.
2014-02-25 20:33:48 -05:00
vladdd
595b6ae81f Merge branch 'repository-tools' of https://github.com/theupdateframework/tuf into repository-tools 2014-02-24 23:09:02 -05:00
vladdd
6207d62db3 Update repository_tool.py.
Properly strip (again) the digest prepended to 'digest.filename' files.
The required '+1' appears to have been accidentally deleted in a recent commit:
298f52ddb8 (diff-59d384d80d746c800b16c8387756c0ccL2750)
Thanks to Santiago for locating the bug.
2014-02-24 23:08:29 -05:00
Vladimir Diaz
511382be36 Update README.md
Add Table of Contents.
Add documentation for the Consistent Snapshots section.
2014-02-24 16:35:57 -05:00
vladdd
a73dbaa395 Merge branch 'repository-tools' of https://github.com/theupdateframework/tuf into repository-tools 2014-02-24 12:14:45 -05:00
vladdd
512d24dadc Modify load_signing_key() exception message.
The previous exception raised when a non-signing key is loaded may be misinterpreted:
tuf.Error: The private key is unavailable.

Changed to: This is not a private key.
2014-02-24 12:14:24 -05:00
Vladimir Diaz
08c41bd946 Update README.md
Lines 204-213: Update comments for get_filepaths_in_directory() and add_targets() examples.
2014-02-24 11:59:38 -05:00
Vladimir Diaz
643ab34b31 Update README.md
Fix write() parameter in the Consistent Snapshots section.
consistent_snapshots -> consistent_snapshot
2014-02-24 10:54:17 -05:00
vladdd
77dfbc34bc Raise exception if key not found in the key-removal methods.
Santiago's request:  The key-removal methods in repository_tool.py should raise an exception if the key argument has not been previously loaded.  They previously returned silently if the key was not found.
2014-02-21 12:16:56 -05:00
Vladimir Diaz
b22b769d41 Merge branch 'repository-tools' of https://github.com/theupdateframework/tuf into repository-tools 2014-02-19 09:13:20 -05:00
Vladimir Diaz
73adff9edf Update format_rsakey_from_pem() in keys.py.
Update repository_tool.py and keys.py functions that import rsa publickey files.  Perform a simple check of the PEM string so that an improperly formatted PEMis detected sooner.  Reported by Santiago.
2014-02-19 09:13:01 -05:00
Santiago Torres
982704cf07 Clean up of some commented lines 2014-02-18 11:36:23 -05:00
Santiago Torres
9b5a18527d Added the layout_type variable, fixed some stability issues
The layout_type flag is used to decide whether a regular directory
structure is going to be used. This means, that if the targets folder is
under the metadata_directory tree or not. This flag lets the project
module decide in which places to locate metadata (i.e. if it needs a
metadata subdirectory or not).

Also fixed stability issues, in which the delegated target files didn't
lose their prefix.
2014-02-17 23:50:42 -05:00
Santiago Torres
3329428041 Merge branch 'repository-tools' of github.com:theupdateframework/tuf into developer-tools 2014-02-14 15:52:20 -05:00
Santiago Torres
b48741e1d7 Added thin wrappers for the key and delegation management functions 2014-02-13 17:10:15 -05:00
Vladimir Diaz
3e9ac96454 Update README.md
Modify the exception raised by repository.write() in the `Create Root` section.
2014-02-13 13:16:16 -05:00
Vladimir Diaz
636dfefce0 Update repository_tool.py.
Exclude the invalid metadata object included when a repository.write() exception is raised.
2014-02-13 13:15:35 -05:00
Vladimir Diaz
637d7af5a2 Merge branch 'repository-tools' of https://github.com/theupdateframework/tuf into repository-tools 2014-02-13 12:10:28 -05:00
Vladimir Diaz
00c69116aa Implement key format requested in issue #171.
Exclude the 'private' attribute from metadata key objects, and when calculating keyids.
2014-02-13 12:10:12 -05:00
Vladimir Diaz
a6c3b447d4 Update tuf-spec.txt 2014-02-13 12:10:08 -05:00
Vladimir Diaz
a357859919 Update repository_tool.py.
Raise exception if signature not found in remove_signature().
Minor edits to comments and whitespace.
2014-02-13 10:03:25 -05:00
Vladimir Diaz
9078814fe5 Update repository_tool.py.
Add missing comments for three of the arguments in generate_snapshot_metadata()'s docstring.
Expand docstring comment in non-public function and mention that temporary metadata is generated to a temporary location.
Minor cosmetic changes.
2014-02-13 08:56:54 -05:00
Santiago Torres
5e25deb859 Added a soft wrapper for the add_target
Added the 'project.add_target()' function, that points to the
project._targets.add_target() method.
2014-02-11 22:02:43 -05:00
Santiago Torres
086c3134e8 Fixed some format issues with the docstrings 2014-02-11 21:39:14 -05:00
vladdd
cdaacb9da3 Update tuf-spec.txt.
Incorporate recent design changes, such as a role name change, supported signature schemes, and expected metadata extension.
Fix for issue #171.
2014-02-07 22:39:41 -05:00
vladdd
57e42f0072 Fix updater.py typo. 2014-02-05 09:47:32 -05:00
Vladimir Diaz
b84225f3e7 Add disclaimer for deprecated latex documents. 2014-02-04 08:37:33 -05:00
Vladimir Diaz
0e100a9aac Update README.md.
Update the expected use of the repository_tool.py module and list the modules that may be used in TUF integrations, which the repository tool does not handle.Rewrite the sentence that mentions the integration tools so that it does not appear to be out of context.
2014-02-04 08:24:21 -05:00
vladdd
75c7ea5138 Update test_extraneous_dependencies_attack.py.
Remove text inserted and improperly removed from a previous merge conflict.
2014-02-03 12:45:17 -05:00
vladdd
e92cf75f5a Update METADATA.md.
Re-word sentence and update outdated rolenames.  Add note about out-of-date metadata content and names in the listed examples.
2014-02-03 12:43:10 -05:00
Santiago Torres
2ab9be71a9 Added the load project function
Load_project(path) now loads a projects metadata and builds the
corresponding object. Methods to save supporting metadata in the
project.cfg file were also refined
2014-01-31 22:02:28 -05:00
vladdd
a22099699e Resolve remaining unit test failures.
Update the remaining unit tests following the many design changes.  The unit tests should next be factored to use repository_tool.py, avoid pseudo repositories and repository objects, monkey patching, etc.
2014-01-31 14:47:48 -05:00
Santiago Torres
5d641ef4db Merge branch 'repository-tools' of github.com:theupdateframework/tuf into developer-tools 2014-01-30 19:24:06 -05:00
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