Commit graph

3274 commits

Author SHA1 Message Date
Vladimir Diaz
25e800a59c Re-generate 'tests/repository_data' to include metadata unix timestamps. 2014-04-15 12:43:12 -04:00
Vladimir Diaz
973e8d1297 Merge pull request #203 from vladimir-v-diaz/develop
Add test_repository_tool.py
2014-04-11 07:55:42 -04:00
vladdd
6a4c82cc81 Finish test case for write(). 2014-04-11 07:35:02 -04:00
Vladimir Diaz
19bc1f326e [WIP] Add test case for repository.write(). 2014-04-10 12:59:42 -04:00
Vladimir Diaz
e018c76c1e Finish test cases for the methods of Targets(). 2014-04-10 11:34:40 -04:00
Vladimir Diaz
4ddd5a417c Update repository tool diagram.
Add missing 'repository_tool.Metadata.signatures' to the diagram.
2014-04-09 12:52:20 -04:00
Vladimir Diaz
666bb7ba9e Update repository_tool.py.
Add remaining test cases for the methods of repository_tool.Metadata().
Add test case for repository_tool.Repository.get_filepaths_in_directory().
2014-04-09 12:43:31 -04:00
Vladimir Diaz
81c2748859 Add test cases (skeleton) for remaining methods of test_repository_tool.py. 2014-04-08 15:19:40 -04:00
Vladimir Diaz
af8d2fb98e Finish remaining test cases for repository_tool.py functions. 2014-04-08 14:56:39 -04:00
Vladimir Diaz
4ad679062f Continue updating test_repository_tool.py.
Add test cases for the generate_*_metadata() functions.
2014-04-08 12:31:06 -04:00
vladdd
0f3cdd9f61 Continue updating test_repository_tool.py.
Add test cases for the crypto funtions (e.g., generate_and_write_ed25519_keypair()).
Add test case for get_metadata_filenames().
Add test case for get_metadata_fileinfo().
Add setUpClass() and tearDownClass().
Update affected functions that failed testing, and any that needed modifying (such as util.py).
2014-04-07 20:21:39 -04:00
vladdd
ddd8b6bfd0 Add test_repository_tool.py
Add 'test_repository_tool.py' (initial incomplete commit)
Add test cases for the top-level metadata objects (Root(), Targets(), etc.)
Add test case for Repository()
Add test case for get_target_hash()
Minor update to 'repository_tool.py': add default rolename for Targets() and call tuf.util.get_target_hash() in the
repository tool's get_target_hash()
2014-04-07 15:28:46 -04:00
Vladimir Diaz
77fd5e8efa Merge pull request #202 from vladimir-v-diaz/develop
Refactor test_extraneous_dependencies_attack.py.
2014-04-06 21:34:25 -04:00
vladdd
5755207fae Refactor test_extraneous_dependencies_attack.py.
Refactored to use the 'unittest' module (test conditions in code, rather
than verifying text output), use pre-generated repository files, and
discontinue use of the old repository tools.  Modify the previous scenario
simulated for the mix-and-match attack.  The metadata that specified the
dependencies of a project modified (previously a text file.)
2014-04-06 21:28:42 -04:00
Vladimir Diaz
47959e6871 Merge pull request #201 from vladimir-v-diaz/develop
Refactor test_mix_and_match_attack.py
2014-04-06 16:19:57 -04:00
vladdd
75a7124bb1 Refactor test_mix_and_match_attack.py.
Refactored to use the 'unittest' module (test conditions in code, rather
than verifying text output), use pre-generated repository files, and
discontinue use of the old repository tools.  Modify the previous scenario
simulated for the mix-and-match attack.
2014-04-06 16:17:14 -04:00
Vladimir Diaz
31464663d9 Merge pull request #200 from vladimir-v-diaz/refactor_test_slow_retrieval_attack
Refactor test_slow_retrieval_server.py.
2014-04-05 21:23:33 -04:00
vladdd
714df40e2d Refactor test_slow_retrieval_server.py.
Refactored to use the 'unittest' module (test conditions in code, rather
than verifying text output), use pre-generated repository files, and
discontinue use of the old repository tools. Expanded comments and modified
previous setup.

Minor edits to slow_retrieval_server.py.

Add missing else clauses (to detect when TUF fails to prevent an attack) for a couple of the integrations tests.
2014-04-05 21:21:10 -04:00
Vladimir Diaz
29bd2d8569 Merge pull request #199 from vladimir-v-diaz/refactor_test_replay_attack
Refactor test_replay_attack.py
2014-04-05 15:30:21 -04:00
vladdd
ba19cd7b72 Refactor test_replay_attack.py.
Refactored to use the 'unittest' module (test conditions in code, rather
than verifying text output), use pre-generated repository files, and
discontinue use of the old repository tools. Expanded comments.
2014-04-05 15:27:27 -04:00
vladdd
48bd9f7040 Update formats.py and repository_tool.py.
repository_tool.targets.delegate_hashed_bins():

Edit comments, add logging information, and rename 'max_number_of_bins' (now 'total_hash_prefixes') for clarity.
Fix expected value of 'number_of_bins' (power of 2 instead of multiple of 16.)
Remove the 'self' argument in get_filepaths_in_directory() (now a staticmethod.)

formats.py:
NUMBINS_SCHEMA may now start from 1 (allow the creation of 1 delegated hashed bin.)
2014-04-04 18:03:27 -04:00
SantiagoTorres
c35d50e310 Update README-developer-tools.md
Updated the document with mentions to project names and to fix general redaction issues.
2014-04-04 17:27:47 -04:00
Santiago Torres
ab765d6c85 Ran a spellchecker on the readme document
Also did a minor proofreading effort. A more thorough proofread will me
made after finishing the whole document.
2014-04-04 14:36:01 -04:00
Santiago Torres
30b97a8a7a Changed the logger tag
tuf.devtools -> tuf.developer_tool
2014-04-04 14:08:17 -04:00
Trishank Karthik Kuppusamy
d52150e187 Merge pull request #197 from vladimir-v-diaz/develop
Add error message for clients that lack a required crypto library.
2014-04-03 19:42:20 -04:00
Santiago Torres
e220669357 Merge branch 'develop' of github.com:theupdateframework/tuf into developer-tools 2014-04-03 14:01:24 -04:00
Santiago Torres
1a353c08d4 Added support for project names.
Project name is now an argument of the project constructor and the
create_new project function.

The project_name field defines the rolename to add to the roledb, the
filename to create and adds a new field to the project.cfg file.
2014-04-03 14:00:33 -04:00
Vladimir Diaz
7314f782aa Add error message for clients that lack a required crypto library.
TUF's crypto dependencies was recently changed: ED25519 signatures supported by default, and require PyCrypto or tuf[tools] to verify RSASSA-PSS signatures.
The error returned for clients that tried to verify rsassa-pss signatures without the required library was bad.  Error message returned now:

$ basic_client.py --repo http://localhost:8001
Error: No working mirror was found:
  localhost:8001: Metadata downloaded from the remote repository specified an RSA signature.  Verifying RSA signatures requires PyCrypto.
$ pip install PyCrypto, or pip install tuf[tools].
2014-04-03 13:18:58 -04:00
Vladimir Diaz
c35c5f0076 Merge pull request #196 from vladimir-v-diaz/develop
Edits to test_indefinite_freeze_attack.py
2014-04-03 12:38:41 -04:00
Vladimir Diaz
9d2a5e2927 Minor edit to comment in test_indefinite_freeze_attack.py. 2014-04-03 12:35:16 -04:00
Vladimir Diaz
053e2b0ebe Update test_indefinite_freeze_attack.py
Minor edit to comment.
Disable console log messages enabled by the repository tool, which this unit tests needs.
Sleep for at least 1 minute before checking for an expired metadata error, and ensure the function supplied to self.assertraises() is a callable.
2014-04-03 12:30:43 -04:00
Vladimir Diaz
be69684323 Merge pull request #195 from vladimir-v-diaz/refactor_test_endless_data_attack
Refactor test_endless_data_attack.py
2014-04-03 12:05:19 -04:00
Vladimir Diaz
b52194cdf4 Refactor test_endless_data_attack.py
Refactored 'test_endless_data_attack.py' to use the 'unittest' module (test
conditions in code, rather than verifying text output), use pre-generated
repository files, and discontinue use of the old repository tools. Minor
edits to the test cases.
2014-04-03 11:59:50 -04:00
Vladimir Diaz
9cbd3f1d21 Merge pull request #194 from vladimir-v-diaz/refactor_test_indefinite_freeze_attack
Refactor test indefinite freeze attack
2014-04-03 08:57:52 -04:00
Vladimir Diaz
63afb1e99f Re-add repository data for the tests. 2014-04-03 08:52:16 -04:00
Vladimir Diaz
c44c7de280 Merge branch 'develop' of https://github.com/theupdateframework/tuf into refactor_test_indefinite_freeze_attack 2014-04-03 08:48:57 -04:00
Vladimir Diaz
e0027a4887 Merge pull request #191 from vladimir-v-diaz/add_test_cases_to_test_util
Add missing test cases to test_util.py.
2014-04-03 08:35:10 -04:00
Vladimir Diaz
6f7ac62ac4 Resolve Merge. 2014-04-03 08:32:45 -04:00
Vladimir Diaz
685187eae1 Remove old 'tuf/tests/unit/test_repository' directory. 2014-04-03 08:19:29 -04:00
Vladimir Diaz
2112816f97 Merge pull request #192 from vladimir-v-diaz/refactor_test_arbitrary_package_attacks
Refactor test_arbitrary_package_attack.
2014-04-03 08:15:52 -04:00
Vladimir Diaz
0bdb1b85af Merge pull request #189 from vladimir-v-diaz/develop
Refactor test_updater.py
2014-04-03 08:13:38 -04:00
Santiago Torres
a16dd6095e file open is now done with the "with" statement
The with statement is a more "native" way to do the same thing, it is
done that way not.
2014-04-02 23:12:38 -04:00
Santiago Torres
99b2ad40a7 release_signable was renamed to project_signable
release_signable didn't make too much sense in such context and was
renamed to a more accurate and descriptive variable name.
2014-04-02 23:11:29 -04:00
Santiago Torres
9cb1181bc3 Updated constant definitions, they are imported from tuf.developer_tool
This makes it easier to propagate design changes through the two
different tools.

A tuf.constants module would be a good addition to this.
2014-04-02 23:09:35 -04:00
Vladimir Diaz
92905345e4 Minor edits to comments. 2014-04-02 11:50:48 -04:00
Santiago Torres
561e85959b Removed a local definition of the prompt and get_password methods
The local _prompt and _get_password methods were deleted in order to use
the version contained in the tuf.repository_tools. The main motivation
of this change is to provide code reutilization
2014-04-01 23:43:24 -04:00
Vladimir Diaz
1ca98367d6 Initial refactor of test_indefinite_freeze_attack.py 2014-04-01 15:30:59 -04:00
Santiago Torres
1a9f9eb0be updated method descriptions in the comment blocks 2014-04-01 14:53:08 -04:00
Santiago Torres
4a35d53d2f Added a comment block describing the project.cfg file 2014-04-01 14:52:23 -04:00
Santiago Torres
6337f59a2e Fixed whitespace errors between methods. 2014-04-01 14:48:06 -04:00