Commit graph

63 commits

Author SHA1 Message Date
vladdd
7711649469 Merge branch 'develop' of https://github.com/vladimir-v-diaz/tuf into develop 2014-06-30 14:06:27 -04:00
vladdd
7be31965e7 Minor edits. 2014-06-29 21:33:22 -04:00
Vladimir Diaz
d5c56e550d Add test condition for repository_tool.Target().add_target() custom data. 2014-06-24 08:58:29 -04:00
vladdd
88d686b258 Initial implementation of custom FILEINFO 2014-06-23 13:33:01 -04:00
vladdd
4e3b40cd95 Minor edits to repository_tool.py. 2014-06-22 20:01:28 -04:00
vladdd
c22a3a5307 Fix expected format of the 'method_name' argument. 2014-06-18 15:17:38 -04:00
Vladimir Diaz
9a90a808e9 Update comments and add missing docstrings in PR #216.
Update add_target_to_bin() and remove_target_from_bin().
2014-06-18 12:39:01 -04:00
Vladimir Diaz
fd60208782 Merge branch 'remove_target_from_bin' of https://github.com/dachshund/tuf into dachshund-remove_target_from_bin 2014-06-18 09:22:42 -04:00
Vladimir Diaz
cbde52c0f7 Allow partial metadata to be properly loaded with zero good signatures.
Previously, the repository tool allowed partial metadata to be written with zero good signatues and later successfully loaded.  However, the partial metadata was not properly marked by load_repository().  The 'partial_loaded' flag is now set (if partial metadata is written with zero good signatures) and matches the behavior of partial_write().
2014-06-10 08:47:10 -04:00
vladdd
744be00cbc Initial implementation of authoritative delegations. 2014-06-07 20:29:18 -04:00
Vladimir Diaz
fbb10a36c9 Refactor repository_tool.py and improve test coverage.
Created repository_lib.py.
2014-06-03 14:32:44 -04:00
Vladimir Diaz
65f30a7bd8 Improve test coverage.
Update unit tests for pycrypto_keys, schema, ed25519_keys, and affected modules.
2014-05-30 12:47:33 -04:00
Vladimir Diaz
dc167e4a27 Address Python 3.2 byte-string compatibility issues. 2014-05-29 12:59:36 -04:00
Vladimir Diaz
71b1d38c1b Update slow retrieval server and fix integration tests.
Update the slow retrieval server, integration tests, and the download module to address issues with unexpected exceptions and bytes.
2014-05-28 12:11:31 -04:00
vladdd
6b8b2399a2 Finish unit tests for Python2 + 3 support.
All unit tests updated / running for Python 2 + 3.
TODO: Fix non-Python 3 issue with util.py.
2014-05-27 13:55:48 -04:00
vladdd
e4bd9a7ba2 [WIP] Refactor download.py 2014-05-11 22:59:42 -04:00
vladdd
c5fd17ab3e Merge branch 'develop' of https://github.com/theupdateframework/tuf into develop
Conflicts:
	tests/test_hash.py
	tests/test_keydb.py
	tuf/formats.py
	tuf/keydb.py
	tuf/repository_tool.py
2014-05-10 20:26:06 -04:00
Vladimir Diaz
3e2bcb1089 Merge pull request #213 from SantiagoTorres/expiration_timedelta_fix
Fixes wrong schema when adding an expiration that contains microseconds
2014-05-06 09:12:24 -04:00
dachshund
e063447f1e Minor edits. 2014-05-05 11:50:58 -04:00
Santiago Torres
13da4c5b4a Updated side effects in the repository tool expiration setter
The expiration setter's docstring now mentions the fact that the
microseconds value in the given datetime object will be discarded if it
is non-zero.
2014-05-05 11:12:23 -04:00
dachshund
b1f85310de Prototype on removing targets from bins. 2014-05-05 03:22:55 -04:00
vladdd
c9e3b6046e Address Issue #214.
Allow validation of specific libraries rather than checking all of them in check_crypto_libraries().
Log warning if the repository tool is imported but has not been properly installed: $ pip install tuf[tools].
Modify format string of console log messages.
2014-05-03 18:03:25 -04:00
Santiago Torres
46fbfb3bc2 Fixes wrong schema when adding an expiration that contains microseconds
In the case we want a different expiration date on any role, we are
adviced to do this:

  repo.role.expiration = datetime.datetime(some value).

In the case we want to use a date somewhere in the future, a normal
approach would be to use time deltas:

  repo.role.expiration = datetime.today() + timedelta(weeks=x)

If we use this method we won't be able to set the value since we are
most probably producing a datetime object that contains *microseconds*.
According to the python specification, the timestamp produced will
contain the microseconds value unless it is 0.

The simple fix for this issue is to force the microseconds value to be 0
before working with the datetime object.
2014-05-02 19:30:02 -04:00
Vladimir Diaz
d831187949 Improve test coverage. 2014-05-01 12:59:34 -04:00
Vladimir Diaz
a8406604d7 Implement add_target_to_bin(), outlined in Issue #180. 2014-04-30 12:46:37 -04:00
Vladimir Diaz
ab95a4b3aa [WIP] Python 2+3 support.
Python 2+3 unicode.
libraries.
The following modules (and their tests) work in PY2.7+3.3:
keydb, hash, formats, mirrors
2014-04-29 14:27:34 -04:00
Vladimir Diaz
a7f28b9af4 [WIP] Python 2+3 support.
Add six, convert PY <=2.5 exception handling, dictionary iteration, libraries, 1/2 the tests.
2014-04-22 15:03:42 -04:00
vladdd
5f94d5be0d Support ISO 8601, vendor iso8601, clean codebase. 2014-04-19 14:27:53 -04:00
Vladimir Diaz
919fb0ff8f Log warning if top-level metadata expires soon. 2014-04-17 12:27:28 -04:00
Vladimir Diaz
1935b1de2b Update TUF modules affected by the change to the 'expires' format. 2014-04-15 12:52:35 -04:00
vladdd
6a4c82cc81 Finish test case for write(). 2014-04-11 07:35:02 -04:00
Vladimir Diaz
e018c76c1e Finish test cases for the methods of Targets(). 2014-04-10 11:34:40 -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
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
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
Vladimir Diaz
ee2ff3e415 Re-add comment about disabling password confirmation in repository_tool.py. 2014-04-01 09:04:14 -04:00
Vladimir Diaz
e0b5412eb0 Merge branch 'develop' of https://github.com/theupdateframework/tuf into develop 2014-04-01 07:35:28 -04:00
vladdd
3d6e0f67f8 Fix repository_tool.py issues reported.
Reported Issues:
1. Fix 'files_directory' variable name typo in comment.  Convert get_filepaths_in_directory() to a static method.

2. add_targets() declares 'absolute_list_of_targets' but only appends files to it.  Get rid of this variable.

3. The roleinfo dict of delegated roles was not fully set by load_repository().  Writing new metadata after it had been tried to access a non-existent 'partial_loaded' dict key.  Non-public function that decided whether a metadata file was partially loaded renamed to _metadata_is_partially_loaded(), and now returns a Boolean.

Minor edits to comments related to the fixes above.
2014-03-31 20:58:11 -04:00
Vladimir Diaz
eaee52e14e [WIP] Refactor test_updater.py
Continue refactoring the test cases of test_updater.py.
Fix issue where repository_tool.py was not writing new compressed metadata.
Minor edits to TUF modules.
2014-03-13 12:31:36 -04:00
Vladimir Diaz
5e7713a93f [WIP] Refactor test_updater.py and repository_setup.py.
Add generate.py script and pre-generated repository files used by Unit tests (replacing repository_setup.py).
Refactor test_updater.py (10 test cases remaining).
2014-03-11 09:08:53 -04:00
Vladimir Diaz
4e09fe29f8 Update comments following Trishank's review of the #186 pull request. 2014-03-11 08:07:18 -04:00
vladdd
845b98fda1 Modify installation setup.
Support the following installation setup:
# Minimal install intended for clients (pure Python, only ed25519 signatures).
pip install tuf

# Optional installation required by the TUF repository tools (RSA keys and rsassa-pss
# signatures, faster ed25519 cryptographic computations, general-purpose cryptography, etc.)
pip install tuf[tools]

Re-implement the fix for issue #167.

Update comments and docstrings related to the fixes above.
2014-03-08 17:56:40 -05:00
vladdd
e9da58328b Update repository_tool-diagram.png and comments.
Minor updates to comments of the previous repository_tool.py commit.
Update repository_tool-diagram.png to list disable_console_log_messages().
Rename disable_console_messages().
2014-03-05 19:40:05 -05:00
Vladimir Diaz
c1f9c86ad7 Log warning messages when sharing keys.
repository_tool.py methods that add keys to roles should also log a warning if it detects a shared key.
Add a console handler, and a function to disable it, to repository_tool.py.
Update _delete_obsolete_metatadata() docstring and comments in repository_tool.py.
2014-03-05 11:38:23 -05:00
vladdd
1a17ac9db2 Update repository_tool.py and util.py.
Rename the unused 'json_object' variable in util.py.

Roles are allowed to share verification keys.  Update repository_tool.py so that the targets role can successfully load an already recognized key when loading a repository.  Reported by Santiago.
2014-03-03 14:53:21 -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
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