Commit graph

46 commits

Author SHA1 Message Date
Trishank Karthik Kuppusamy
da0a9aa196 By default, limit visited number of delegations in preorder DFS. 2016-02-19 17:44:21 -05:00
Vladimir Diaz
55f1a5bad3 Merge branch 'develop' of github.com:theupdateframework/tuf into 1.0-review 2016-01-27 17:11:16 -05:00
Vladimir Diaz
2f77fbccb6 Merge branch 'develop' of github.com:theupdateframework/tuf into tuf1.0_version_numbers 2016-01-27 17:07:06 -05:00
Vladimir Diaz
f0e3f76adc Explain that a subset of crypto libraries can be used for general-purpose crypto and RSA 2016-01-21 16:11:56 -05:00
Vladimir Diaz
47cae502fa Allow users to specify the path (via conf.py) to save log files 2016-01-14 17:25:08 -05:00
Vladimir Diaz
7f91f56802 Review conf.py 2015-10-27 17:04:29 -04:00
Vladimir Diaz
ed1f217022 Implement changes for _update_metadata() 2015-10-15 09:49:32 -04:00
Vladimir Diaz
5f2ee2f3ad Remove commented lines used for testing 2015-08-26 17:27:15 -04:00
Vladimir Diaz
115b2d2bce Ensure the PSS defaults used by PyCrypto match those set with pyca/cryptography's 2015-08-05 14:51:27 -04:00
Vladimir Diaz
b2132e3c72 Support enryption + decryption with pyca/cryptography 2015-07-30 10:19:44 -04:00
Vladimir Diaz
16685d2ff3 Add configuration option for supported URI schemes
Support only 'http' and 'https' by default.  Thanks Marcin W.
2015-05-04 15:34:22 -04:00
vladdd
bc99524e2b Finish initial refactor of slow retrieval attack. 2014-05-13 12:53:50 -04:00
vladdd
e4bd9a7ba2 [WIP] Refactor download.py 2014-05-11 22:59:42 -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
2c55b94a8b Modify the extension of rolename files.
rolename.txt -> rolename.json.
2014-01-27 11:35:38 -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
Vladimir Diaz
973d3a23a3 Address Issue #137 and update repository_tool.py.
Add the add_restricted_paths() method.
Rename libtuf.py
Update README.
Update delegate_hashed_bins() docstring.
More testing of hashed bins and consistent snapshots.
Remove old scripts from setup.py.
2014-01-23 12:03:31 -05:00
vladdd
fbd7b147e8 Address Issues #151 and #156.
Adjust logger messages and levels.
Update use of tuf.conf variable so that it can be updated in code.
Update updater.py comments.
2014-01-18 18:37:27 -05:00
Vladimir Diaz
a9d90e7ce0 Finish initial implementation of Issue #151 and reading consistent snapshots.
Support multiple hash algorithms, where the generated digests of metadata and
target files is included in metadata (and filenames if 'consistent_snapshots'
is True).  Previously, only a single hash algorithm was supported, and it was
set by default to 'sha256' in code.  Repository maintainers may now choose any,
and/or multiple, hash algorithms from those supported by TUF.  By default,
'sha256' is used when generating digests.

Support the recent change to the TUF specification, where writing consistent
snapshots may include N versions of identical metadata and targets, if N hash
algorithms is used by the repository when generating metadata.

Update code affected by the recent changes to the specification, such as
targets that may include digests in their filename.

Support consistent snapshots of compressed metadata, including repositories
that provide multiple versions of metadata with different digests included
in their filenames.

The repository tools can now load repositories that include consistent snapshots
of metadata and targets, including those with multiple (i.e., multiple digests
prepended to filenames) consistent snapshots of files.

The client code may now read repositories with 'consistent_snapshots': true in
Root metadata, and properly request and update files with digests included.
2014-01-17 11:05:40 -05:00
vladdd
a2db039cf0 Update conf.py header and comments 2014-01-04 15:42:34 -05:00
vladdd
f866da7cb8 Address Issues #165, #158, and #147.
Issue 147: Finalize conversion of all written metadata behavior.  This commit ensures that compressed and uncompressed metadata is also written as outlined in the issue.

Issue 158: As requested, updater.refresh() may now unsafely fetch (i.e., unknown file size and hash) Root metadata if valid top-level metadata cannot be downloaded successfully (e.g., top-level keys may have been revoked).  The repository must also sign the new Root file (at least until all clients have updated) with any revoked keys so that clients may successfully update.  After unsafely updating Root, the top-level metadata is updated again as normal (and only once to avoid an infinite loop).  By default, refresh() unsafely updates Root if only invalid top-level metadata can be downloaded, although this behavior may be overriden by the caller if they wish.  Changed default behavior: refresh(self, unsafely_update_root_if_necessary=True)

Issue 165: Delegated roles are no longer added as attributes of a Targets object by libtuf.py (e.g., repository.targets.delegated_role).  The previous bahavior restricted rolenames to Python identifiers (i.e., can only include letters, numbers, the underscore character, and must start with a nonnumeric character).  Now, delegated roles may be referenced as strings (e.g., repository.targets('recently-claimed')) and include characters other than '_'.  In addition, methods have been added to return all the delegated rolesnames of a target (e.g., repository.targets.get_delegated_rolenames()) and the immediate delegated Target objects of a role.  Previous behavior: repository.targets.unclaimed.django.version = 8
Current behavior: repository.targets('unclaimed')('django').version = 8.
2014-01-02 12:18:44 -05:00
Vladimir Diaz
45c65c9178 Merge branch 'develop' into repository-tools 2013-12-16 14:22:31 -05:00
Vladimir Diaz
d27543258e Update libtuf.py documentation and address issues #143 and #144
Add support for encrypted (and public ed25519 keys) TUF key files.
Add support for ed25519 keys, signatures, and key files in libtuf.py.
Update libtuf.py diagram.
Move canonical encoding operations to the create and verify key functions.
2013-12-16 08:45:40 -05:00
Vladimir Diaz
56bdd48b53 Add comments and re-add ed25519 to conf.py 2013-12-09 11:22:37 -05:00
Vladimir Diaz
68eedeb477 Initial commit for Issue #143 and #144 2013-12-09 11:11:23 -05:00
Nektarios Tsoutsos
9f0f80fab4 Modified the maximum timestamp.txt size (#bug 159) 2013-12-03 16:46:24 -05:00
vladdd
86e8f0b771 Switch default ed25519 cryptography library to 'ed25519'
Modify so that testing the repository tools does not raise errors for users without pynacl installed.
2013-11-13 11:44:00 -05:00
vladdd
ac6dade0dc Move test cases to test_pycrypto_keys.py 2013-10-10 14:56:56 -04:00
vladdd
31d603c710 Update all unit tests affected by configurable crypto
Add separate 'tuf.conf.py' options for key types.
2013-10-10 12:19:46 -04:00
vladdd
37b665bf9a Modify behavior of configurable crypto and update conf.py
Add missing doctest and minor edits.
2013-10-09 13:37:26 -04:00
vladdd
46d07be5ad Continue configurable crypto changes: add keys.py doctest 2013-10-09 08:15:09 -04:00
vladdd
5622e0c622 Commence configurable crypto changes
Refactored the majority of affected modules.  Added optimized version of the reference implementation of ed25519.
2013-10-08 13:09:59 -04:00
vladdd
8c7bee515a Relocate the default PBKDF2 iterations to tuf.conf 2013-09-12 12:50:11 -04:00
dachshund
9a3820bfcf Fix #42. 2013-09-09 11:39:39 -04:00
dachshund
9f1e4f60e9 Address comments from 01db53dac6. 2013-09-08 02:14:22 -04:00
dachshund
01db53dac6 A way to mitigate #42. 2013-09-08 00:32:09 -04:00
dachshund
e64e938d21 Fix a couple of bugs.
Read file before it is closed.
Remove incorrect slow retrieval defense.
2013-09-06 14:38:30 -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
dachshund
3c18b58b71 Adapt Zheng Yuyu's changes. 2013-08-06 13:40:24 -04:00
zhengyuyu
0c83799c85 Fix the endless data attack issue
modification of updater.py for download.py

modification of conf.py for fix

modification of test_download.py for download.py

modification of test_updater.py for download.py

add a new test of endless data attack to metadata timestamp.txt

more readable and fix the endless data attack issue.
2013-08-02 16:32:55 -04:00
dachshund
31b97634b4 Allow users to require SSL certificate verification during interposition. 2013-03-04 19:54:41 -05:00
dachshund
d03dd0f2ec Copy SSL certificate verification from pip. 2013-03-04 18:01:15 -05:00
dachshund
b7fb79328f Remove SSL cert verification code until we verify it. 2013-02-28 16:46:04 -05:00
dachshund
1685c7fa6d We now *should* verify SSL connections given certificate authorities. 2013-02-22 17:45:44 -05:00
vladdd
abf0349b05 Move all files up one directory from 'src/'. 2013-02-10 21:38:06 -05:00
Renamed from src/tuf/conf.py (Browse further)