Commit graph

48 commits

Author SHA1 Message Date
Vladimir Diaz
091cfe9aeb Increase sleep time after starting simple server in affected tests. 2014-06-06 07:32:03 -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
Vladimir Diaz
8684253675 [WIP] Python 2+3.
Mostly unicode-related changes for crypto modules.
2014-05-06 15:24:39 -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
e23b4e5eae Merge branch 'develop' of https://github.com/theupdateframework/tuf into develop
Conflicts:
	tuf/__init__.py
	tuf/client/updater.py
2014-04-29 08:31:29 -04:00
vladdd
1e360846bf Reject expired metadata without loading.
Reject downloaded metadata as early as possible.  The top-level roles were all downloaded as a group and then their
expiration inspected.  All metadata provided by a mirror that has already expired is discarded immediately and the next mirror tried.  The update process stops if a requested role cannot be successfully validated, or one of its parents.

[2014-04-29 02:00:32,308 UTC] [tuf.download] [INFO] [_download_file:745@download.py]
Downloading: http://localhost:8001/metadata/timestamp.json

[2014-04-29 02:00:32,324 UTC] [tuf.download] [INFO] [_check_downloaded_length:676@download.py]
Downloaded 544 bytes out of an upper limit of 16384 bytes.

[2014-04-29 02:00:32,324 UTC] [tuf.client.updater] [INFO] [_get_file:1189@updater.py]
Not decompressing http://localhost:8001/metadata/timestamp.json

[2014-04-29 02:00:32,331 UTC] [tuf.download] [INFO] [_download_file:745@download.py]
Downloading: http://localhost:8001/metadata/snapshot.json

[2014-04-29 02:00:32,333 UTC] [tuf.download] [INFO] [_check_downloaded_length:654@download.py]
Downloaded 1003 bytes out of the expected 1003 bytes.

[2014-04-29 02:00:32,334 UTC] [tuf.client.updater] [INFO] [_get_file:1189@updater.py]
Not decompressing http://localhost:8001/metadata/snapshot.json

[2014-04-29 02:00:32,334 UTC] [tuf.client.updater] [INFO] [_check_hashes:696@updater.py]
The file's sha256 hash is correct: 5b3aec7cf295a25e4b39d875c7474511da9645bc6d27f9e86fb7e439c82e0ec7

[2014-04-29 02:00:32,335 UTC] [tuf.client.updater] [ERROR] [_ensure_not_expired:1789@updater.py]
Metadata 'snapshot' expired on Tue Apr 29 01:59:01 2014 (UTC).

Do not request, download, and install top-level roles if the root of trust has already expired after the inital load. If requested, update an expired root role:

[2014-04-29 01:18:02,457 UTC] [tuf.client.updater] [ERROR] [_ensure_not_expired:1789@updater.py]
Metadata 'root' expired on Mon Apr 28 23:23:57 2014 (UTC).

[2014-04-29 01:18:02,458 UTC] [tuf.client.updater] [INFO] [refresh:628@updater.py]
Expired Root metadata was loaded from disk.  Try to update it now.

[2014-04-29 01:18:02,458 UTC] [tuf.download] [INFO] [_download_file:745@download.py]
Downloading: http://localhost:8001/metadata/root.json

[2014-04-29 01:18:02,461 UTC] [tuf.download] [INFO] [_check_downloaded_length:676@download.py]
Downloaded 1198 bytes out of an upper limit of 512000 bytes.

[2014-04-29 01:18:02,461 UTC] [tuf.client.updater] [INFO] [_get_file:1189@updater.py]
Not decompressing http://localhost:8001/metadata/root.json

[2014-04-29 01:18:02,462 UTC] [tuf.client.updater] [ERROR] [_ensure_not_expired:1789@updater.py]
Metadata 'root' expired on Mon Apr 28 23:23:57 2014 (UTC).

Note: An expired 'root' was provided by the server.  The requested root must also be signed by keys trusted by the client.
2014-04-28 22:31:42 -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
08a2bad2c0 Add Travis CI, coveralls, and coverage-related updates. 2014-04-20 16:15:19 -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
Vladimir Diaz
45c65c9178 Merge branch 'develop' into repository-tools 2013-12-16 14:22:31 -05:00
dachshund
ed4fe44530 Fix #150. 2013-11-28 11:22:50 -05:00
PandaSPUR
17924213fd Update SlowRetrievalError
Updating on behalf of "Red Team" of App. Sec.
Undescriptive error found while testing gemsontuf.
2013-11-27 15:30:41 -05:00
Vladimir Diaz
e437dbaf14 Update comments & docstrings, fix bug, and address issues #135 and #138
Issue #135: Duplicate signatures, rather than keys, was previously saved to metadata.  libtuf.py should now store one signature per keyid.  It should be noted that these duplicates were not identical, as PSS incorporates random salts and able to generate two valid signatures (and not equal) with the same key.

Issue #138: The write_partial() method added to libtuf.Repository.

Fixed a bug in load_repository() that did not properly detect some compressed delegated roles and failed to update the 'compressions' field of the Targets object.
2013-11-22 11:13:11 -05:00
vladdd
01deddfd18 Initial implementation of the repository tools.
Delegations and repository loading now implemented.  Updates to comments, docstrings, and a unit test needed.
2013-11-12 15:00:26 -05:00
vladdd
7ae7f2ddc2 Add new tuf.formats.py schema for pycrypto_keys.py
Remove extra whitespace in __init__.py
2013-10-17 12:54:08 -04:00
vladdd
7d691011e5 Resolve conflicts from demo 2 updates 2013-09-23 13:38:18 -04:00
dachshund
d7899e536b Fix typo. 2013-09-18 03:18:51 -04:00
dachshund
85125c4a4f Better error formatting. 2013-09-18 03:12:39 -04:00
dachshund
a0f437b2e4 Better string representation of NoWorkingMirrorError. 2013-09-17 23:36:48 -04:00
dachshund
8187be5232 Simplify exception text in console handler. 2013-09-13 23:47:37 -04:00
dachshund
26551b95c9 Fix #102. 2013-09-11 17:46:29 -04:00
dachshund
f026a998a9 Fix #102. 2013-09-11 17:46:29 -04:00
dachshund
9ddd2617f5 Redundantly verify file length in updater.
You may argue that the redundancy is unnecessary (pun intended), but it
is there because redundancy means one safety check will work where
another fails. I introduced this redundant file length check because the
updater unit test is mocking the download functions, which means that
file length checks in the download functions are being bypassed.
Redundancy is a good thing for safety.
2013-09-09 21:21:32 -04:00
dachshund
f72f5751d1 Redundantly verify file length in updater.
You may argue that the redundancy is unnecessary (pun intended), but it
is there because redundancy means one safety check will work where
another fails. I introduced this redundant file length check because the
updater unit test is mocking the download functions, which means that
file length checks in the download functions are being bypassed.
Redundancy is a good thing for safety.
2013-09-09 21:21:32 -04:00
dachshund
5bc997117f Fix #42. 2013-09-09 11:39:39 -04:00
dachshund
9a3820bfcf Fix #42. 2013-09-09 11:39:39 -04:00
dachshund
6d8b539f2b Recognize a possible endless data attack in the form of invalid JSON metadata. 2013-09-08 02:31:50 -04:00
dachshund
3d340de4e8 Recognize a possible endless data attack in the form of invalid JSON metadata. 2013-09-08 02:31:50 -04:00
dachshund
a96169d42a Address comments from 01db53dac6. 2013-09-08 02:14:22 -04:00
dachshund
9f1e4f60e9 Address comments from 01db53dac6. 2013-09-08 02:14:22 -04:00
dachshund
882bb95646 A way to mitigate #42. 2013-09-08 00:32:09 -04:00
dachshund
01db53dac6 A way to mitigate #42. 2013-09-08 00:32:09 -04:00
dachshund
561ad496b7 Rename UpdateError exception to NoWorkingMirrorError. 2013-09-06 16:58:18 -04:00
dachshund
e7704355a9 Rename UpdateError exception to NoWorkingMirrorError. 2013-09-06 16:58:18 -04:00
dachshund
fa9b7ab632 Document new functions in updater. 2013-09-06 16:34:27 -04:00
dachshund
54cab17f0a Document new functions in updater. 2013-09-06 16:34:27 -04:00
dachshund
8d271bbb50 Better metadata verification. 2013-09-06 13:25:46 -04:00
dachshund
6b58670d28 Better metadata verification. 2013-09-06 13:25:46 -04:00
dachshund
be749877dd Remove MetadataNotAvailableError. 2013-09-06 11:17:33 -04:00
dachshund
7ab75fa531 Remove MetadataNotAvailableError. 2013-09-06 11:17:33 -04:00
dachshund
d5272cfc7c Add some exceptions for more fine-grained exception handling. 2013-09-04 16:48:38 -04:00
dachshund
16d971da0e Add some exceptions for more fine-grained exception handling. 2013-09-04 16:48:38 -04:00
dachshund
9734b68d15 Merge #99. 2013-09-03 12:52:47 -04:00
dachshund
63fa51ac20 Merge #99. 2013-09-03 12:52:47 -04:00
zhengyuyu
6638089b99 Fix the slow retrieval attack issue
download.py:Add a timeout and rewrite the _fileobject.read()

test_slow_retrieval_attack.py:Add a new kind of slow retrieval attack

slow_retrieval_server.py:Modification for new kind of slow retrieval attack
2013-08-28 05:43:47 -04:00
vladdd
abf0349b05 Move all files up one directory from 'src/'. 2013-02-10 21:38:06 -05:00
Renamed from src/tuf/__init__.py (Browse further)