Commit graph

52 commits

Author SHA1 Message Date
Vladimir Diaz
b48c974021
Merge branch 'develop' into edit_comment_test_indefinite 2018-06-12 09:19:26 -04:00
Vladimir Diaz
bc35b8ac3e
Add test 3 to the summary of conducted tests
Signed-off-by: Vladimir Diaz <vladimir.v.diaz@gmail.com>
2018-06-12 09:18:47 -04:00
Sebastien Awwad
e9cd01e18a
DOC: Clarify comment on freeze attack test
to indicate the source of the freeze issue

Signed-off-by: Sebastien Awwad <sebastien.awwad@gmail.com>
2018-06-11 16:10:21 -04:00
Vladimir Diaz
621ec3a76b
Add test condition for the persistent freeze attack
Signed-off-by: Vladimir Diaz <vladimir.v.diaz@gmail.com>
2018-06-11 11:48:14 -04:00
Vladimir Diaz
eb3858ada3
Use replace('\', '/') in test_indefinite_freeze_attack.py
Signed-off-by: Vladimir Diaz <vladimir.v.diaz@gmail.com>
2018-04-19 10:49:16 -04:00
Vladimir Diaz
42c97d7340
Edit test conditions affected by new settings
Signed-off-by: Vladimir Diaz <vladimir.v.diaz@gmail.com>
2018-03-27 14:44:10 -04:00
Vladimir Diaz
8f65fa4154
Rename license files in modules
Signed-off-by: Vladimir Diaz <vladimir.v.diaz@gmail.com>
2018-02-05 11:31:19 -05:00
Vladimir Diaz
ec95a0d30f
Resolve conflicts
Signed-off-by: Vladimir Diaz <vladimir.v.diaz@gmail.com>
2017-12-08 16:53:57 -05:00
Vladimir Diaz
334bf3ca12
Update integration tests following map file changes
Signed-off-by: Vladimir Diaz <vladimir.v.diaz@gmail.com>
2017-12-08 16:32:06 -05:00
Vladimir Diaz
e904ccb957
Remove py26 conditional import statements 2017-12-08 16:23:19 -05:00
Vladimir Diaz
f2514bdc4d
Add copyright and license to test-related files
Signed-off-by: Vladimir Diaz <vladimir.v.diaz@gmail.com>
2017-11-30 13:33:11 -05:00
Vladimir Diaz
72d7ebfd8d
Remove py26 conditional import statements 2017-09-21 17:16:29 -04:00
Vladimir Diaz
90155962a7 Fix unit tests to use tuf.settings.repositories_directory 2017-02-06 16:19:58 -05:00
Vladimir Diaz
fb0ea0b836 Fix more import statements for various modules 2017-01-11 15:41:13 -05:00
Vladimir Diaz
b1367430d7 Replace instances of tufformats in test modules 2016-11-09 17:10:05 -05:00
Artiom Baloian
299ff68edd Now crypto related files are in ssl_crypto and ssl_commons 2016-11-02 17:44:32 -04:00
Artiom Baloian
b0156944bb Moved util.py, now it is common 2016-11-02 09:49:37 -04:00
Artiom Baloian
b793c81739 Added simple_settings, now it is a requirement of TuF.
Rename conf.py into the settings.py an changed import call.
2016-11-01 15:38:40 -04:00
Artiom Baloian
b07d9a5d0f Move some part of tufformats into the common formats 2016-10-31 19:04:14 -04:00
Artiom Baloian
8247a02737 Moved TuF exceptions and schem into the ssl_commons 2016-10-31 11:58:05 -04:00
Artiom Baloian
7098cdbc3a Move _vendor dir and split formats into the formats and tufformats 2016-10-28 18:37:28 -04:00
Vladimir Diaz
8882dc5b7b Merge branch 'root-versioning' of https://github.com/ecordell/tuf into ecordell-root-versioning
Conflicts:
	tests/test_key_revocation.py
	tests/test_replay_attack.py
	tests/test_repository_tool.py
	tests/test_updater.py
	tuf/formats.py
	tuf/repository_lib.py
2016-10-17 15:57:48 -04:00
Vladimir Diaz
feb2cd0df4 Update tests to improve code coverage and following the changes to repository write and backtracking 2016-09-15 15:24:00 -04:00
Vladimir Diaz
a59008cf2b Use the 'clear_all' argument with clear_roledb.py and clear_keydb.py 2016-07-15 15:24:45 -04:00
Vladimir Diaz
70cc1b8abd Clear roledb and keydb of 'test_repository' entries after each test case 2016-07-11 13:53:16 -04:00
Vladimir Diaz
872ff7c1a1 Use correct key import function to load non-root keys in test_indefinite_freeze_attack.py 2016-06-28 17:01:38 -04:00
Vladimir Diaz
dd8a7eb0dd Review test_indefinite_freeze_attack.py and updater.py. Minor edits made 2016-03-17 11:36:11 -04:00
Sebastien Awwad
1ee1f92a4d
added clarifying comments to repo and key loading 2016-03-16 14:27:40 -04:00
Sebastien Awwad
4d8732bee8
removing unnecessary loading of root keys in test 2016-03-16 14:23:58 -04:00
Sebastien Awwad
9137986301
Removing superstitious 0.1s sleeps. 2016-03-16 14:14:26 -04:00
Sebastien Awwad
893911614a
fixing minor comment wording 2016-03-16 11:54:18 -04:00
Sebastien Awwad
85a7502603
- Tweaked the sleep durations to be more minimal, based on time that had passed. (updater.refresh() can take a while.)
- Put code back into working state after some failure mode debugging of a separate bug by Vlad and me.
- Expanded some comments, added explanations, and made a few others more readable.
- Removed an unnecessary path recalculation and an unnecessary sleep.
2016-03-16 11:50:11 -04:00
Sebastien Awwad
ab4cbdde52
guaranteed test failure: unprintable on 3, printable on 2 2016-03-14 18:08:24 -04:00
Sebastien Awwad
fee25a44cd
sharing bug with Vlad 2016-03-14 17:39:04 -04:00
Sebastien Awwad
8250223207
removed unnecessary temp variable reload line; switched names of Test 1 and Test 2 2016-03-14 16:30:12 -04:00
Sebastien Awwad
08e005330a
Minor log message improvements. 2016-03-14 15:51:58 -04:00
Sebastien Awwad
6a4982fa8a
Improving comments in test_indefinite_freeze_attack 2016-03-14 12:59:46 -04:00
Sebastien Awwad
0fa4518929 comment improvement in indefinite freeze attack test 2016-03-11 17:01:35 -05:00
Sebastien Awwad
66f56271d2 This is a manual squash commit of detect_expiry_322, to avoid merge conflicts.
Comment lines from the individual commits include:
1. Fix #322 by detecting expiry of stale files. initial attempt
2. temp commit of files from Soma
3. removing freeze_attack_stale_expiry and leaving the test added to indefinite freeze attack
4. fixing indefinite freeze attack test: now incorporates old reject-freshly-downloaded-but-expired-timestamp test as well as reject-stale-already-present-but-expired-snapshot test
5. small refinements to indefinite freeze attack test
6. Pulled the recursion out of the except block in refresh() to avoid unprintable nested exceptions.
7. Added comments to the last commit (retry_once)
8. Merge pull request #1 from awwad/detect_expiry_322_temp (removing cruft in another branch)
2016-03-10 15:01:12 -05:00
Vladimir Diaz
47471db40f Add import statements for unvendored dependencies in the unit tests 2015-06-02 10:28:02 -04:00
Vladimir Diaz
74c0120ed4 Increase sleep time after starting simple server in integration tests. 2014-06-10 09:26:09 -04:00
vladdd
17b230abdd Support Python 2.6. 2014-06-06 18:57:23 -04:00
Vladimir Diaz
797bab5ddc Fix Python 2 + 3 JSON consistency issue and re-generate repository data.
Explicitly specify the JSON separators for Python 2 + 3 consistency.
2014-06-05 11:17:30 -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
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
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
7843bdd272 [WIP] Python 2+3 support.
Add six, convert PY <=2.5 exception handling, dictionary iteration, libraries, remaining 7/8 test modules.
2014-04-23 12:50:05 -04:00