Commit graph

272 commits

Author SHA1 Message Date
vladdd
85771dc7e3 Continue updating unit tests affected by PyCrypto changes 2013-09-05 11:50:15 -04:00
vladdd
79c3856916 Add tests for create_encrypted_pem() and create_from_encrypted_pem() 2013-09-03 12:48:26 -04:00
vladdd
8e5c8ac5e0 Merge branch 'develop' into pycrypto 2013-09-03 12:19:59 -04:00
vladdd
a11d26091f Merge branch 'zanefisher-fix_tests' into develop 2013-08-30 14:59:45 -04:00
vladdd
1b367116da Review Zane's unit test fixes and resolve merge conflicts 2013-08-30 14:58:41 -04:00
vladdd
c99a8d1a0c Review Zane's unit test fixes and resolve merge conflicts 2013-08-30 14:56:33 -04:00
vladdd
0e2f59eb4b Update rsa_key.py and keystore.py with final PyCrypto major changes
rsa_key.py was modified to generate and verify RSASSA-PSS signatures instead of RSASSA-PKCS1-v1_5.  Optional functions to read and save passphrase-protected PEM files also added to rsa_key.py.  keystore.py was modified to generate encrypted .key files (similar scheme as before) with PyCrypto to support uniform encryption of varied key types.  User passwords are no longer temporarily stored, but used to derive a symmetric key with PBKDF2.  The derived key is then used with AES-256-Mode-CTR to generate the encrypted key data.  Affected unit tests updated.
2013-08-29 09:28:03 -04:00
zanefisher
748da1eb58 Make aggregate tests randomization optional. 2013-08-26 15:35:28 -04:00
zanefisher
f10d970a75 Removed stray debug code. 2013-08-26 14:25:25 -04:00
zanefisher
4eb4b80182 Aggregate tests now passes. Moved various unit test code that ran on import into setup and teardown functions that are called at the appropriate time when run with other tests. 2013-08-26 14:18:20 -04:00
vladdd
9c5eddc458 Replace evpy crypto calls in rsa_key.py with PyCrypto's equivalent 2013-08-20 13:17:04 -04:00
zanefisher
a990059329 Rewrote extraneous dependencies test, based on arbitrary package test. 2013-08-19 17:10:13 -04:00
zanefisher
794ba94b2d Removed unnecessary imports from aggregate_tests.py. 2013-08-15 17:40:48 -04:00
vladdd
00ee27aeec Update system tests following design change to log.py 2013-08-15 15:48:12 -04:00
zanefisher
51f491ede2 Merge remote-tracking branch 'upstream/master' 2013-08-15 14:56:49 -04:00
vladdd
6f6f60fdff Update the unit tests affected by the design change to log.py 2013-08-15 14:33:35 -04:00
zanefisher
280d7a0362 Randomized order of aggragate tests. Added teardown code to some unit tests. 2013-08-13 18:41:38 -04:00
vladdd
5cbb8c48f9 Refactor log.py and change the default logging behavior
Previously, logging messages were written to "tuf.log" *and* and the console, by default.  Modules had to explicitly disable the logger to silence console messages.  TUF, when integrated by a software updater, should not log messages to console by default.  The design change now forces modules to call tuf.log.add_console_handler() to enable logging messages to console.  The logger, file, and console handlers may have independent logging levels.
2013-08-13 12:19:31 -04:00
vladdd
ae3b51ab3d Confirm unit tests run properly individually & fix test_keystore
"test_keystore.py" logged TUF messages if run individually.
2013-08-12 12:47:26 -04:00
vladdd
28601181cf Review and confirm issue #63 2013-08-12 12:20:48 -04:00
vladdd
e5731749bf Modify _ensure_all_targets_allowed() to also work with path_hash_prefix 2013-08-09 12:13:01 -04:00
vladdd
f214d9019e Expand comment and add missing prefix comparison in updater.target() 2013-08-09 10:43:26 -04:00
vladdd
37a38d5a11 Merge branch 'master' of https://github.com/theupdateframework/tuf 2013-08-09 08:30:41 -04:00
vladdd
45203d25d1 Update tuf-spec.txt and implement "lazy bin walk"
tuf-spec.txt was updated to include the latest metadata changes, such as version numbers, and the "lazy bin walk" scheme was implemented in updater.py.
2013-08-09 08:29:57 -04:00
dachshund
4943fef8ed Merge remote-tracking branch 'origin/master' 2013-08-08 12:59:13 -04:00
dachshund
8479d462df Fix bugs with a library and a few unit tests.
Include a missing import for a library so that it does not throw a
runtime error.

Include missing imports for unit tests so that they are standalone.
2013-08-08 12:57:47 -04:00
vladdd
bb94f426f2 Update updater.py to also check for compressed versions of targets.txt
Also added a comment to make it obvious that referenced_metadata should always be release for delegated roles.
2013-08-08 12:23:40 -04:00
vladdd
4a7c5fe27f Preliminary update preceding the major path_hash_prefix changes
This update addresses issue #86.  It begins by removing the wholesale downloading of all targets metadata and only downloads & verifies the metadata for the roles it only needs; the "lazy walk" scheme.
2013-08-07 19:30:22 -04:00
vladdd
5f4b5c9249 Update updater.py to retrieve compressed versions of Targets metadata
This change addresses issue #85.  The previous implementation only recognized compressed versions of "release.txt".
2013-08-07 15:38:16 -04:00
vladdd
da025768c3 Remove list.sort() and cleanup try-except blocks in signercli.py
Previously, _make_delegated_metadata() attempted to minimize the number of target directories in the "paths" field
of delegations by calculating common root-most directories.  This bahavior was found to be unsafe and removed, and as a result,
the sort of delegated targets is no longer needed.
2013-08-07 10:45:25 -04:00
vladdd
fa88d6e9b6 Remove test print statements 2013-08-06 14:36:16 -04:00
vladdd
c2eec3e42f Minor changes following review 2013-08-06 13:42:44 -04:00
vladdd
b5fcaaecdb Update following Trishank's initial code review 2013-08-06 12:38:28 -04:00
zanefisher
61e94847af Tests no longer run automatically when imported.
aggregate_tests now loads all the unit tests into one suite and runs them together,
so that any failures and errors show up together in a concise report.
2013-07-31 19:02:06 -04:00
vladdd
0eb0b50022 Update tuf/tests/system_tests modules affected by metadata changes 2013-07-30 14:50:40 -04:00
zanefisher
4fd9975015 Fixed various tests. 2013-07-30 14:41:27 -04:00
vladdd
ef7a5512d4 Continue design changes to address issues #57, #39, #48
A directory listed under the "paths" field of a parent metadata delegation is understood to mean all
subdirectories and files the delegated role is trusted to update.  The delegated role has the option
of specifying multiple, arbitrary, and explicit file paths & directories.  The previous implementation
allowed explicit file paths in the "paths" field of the parent role metadata.  This commit modified
this behaviour to allow directories (replicating wildcards) to minimize the size of parent metadata.
2013-07-29 15:35:12 -04:00
vladdd
061370c06f Merge master and resolve conflicts 2013-07-26 14:18:59 -04:00
vladdd
26925ea18f Modify default expiration times set in quickstart.py
Modify the default expirations times for the targets, release, and timestamp roles; 3 months, 1 week, and 1 day, respectively.
2013-07-25 13:09:04 -04:00
vladdd
7bac198fb8 Add comments to test_updater.py and fix bug in signercli.py
Add comments to make it clearer how the self.Repository.refresh() call in test_5_all_targets() successfully returns the metadata for all the roles.  _mock_download_url_to_tempfileobj() is set up to allow mock downloads of the "all_role_paths" files in order.Relative filepaths were incorrectly calculated when
directories were specified as target paths in the --makedelegation command-line option for signercli.py.
2013-07-25 12:43:45 -04:00
zanefisher
13b418a008 Revert "Print, and log, messages in command-line utilities." 2013-07-23 15:10:34 -04:00
zanefisher
f6ffdaaa68 Merge remote-tracking branch 'origin/master' into log-to-console 2013-07-22 17:28:36 -04:00
zanefisher
fb7ec7c9ab Revert "Remove logging to stdout."
This reverts commit 5c222797d7.
2013-07-22 17:15:30 -04:00
dachshund
6c2251c0bd Merge code from @zhengyuyu which makes a function more readable.
His code splits tuf.download.download_url_to_tempfileobj into two major
pieces. The first piece opens a connection to a URL, and computes
the required and reported lengths for downloading data from that given
URL. The second piece downloads data from the given URL in such a way
that we can defend against endless data and slow retrieval attacks.
2013-07-22 14:23:29 -04:00
zhengyuyu
20551a7989 Splits the real download procedure from the download_url_to_tempfileobj and put it into a new function. this makes the download_url_to_tempfileobj clearer and more modular 2013-07-22 00:20:12 -04:00
dachshund
a559727398 Fast test for breach of delegation. 2013-07-08 09:11:25 +08:00
dachshund
471df8287b Merge branch 'master' of github.com:theupdateframework/tuf 2013-07-06 21:21:59 +08:00
dachshund
0074aebfc7 Comment about Unicode filenames; #61. 2013-07-06 21:21:33 +08:00
dachshund
f22a80808f Comment about Unicode filenames. 2013-07-06 21:19:32 +08:00
dachshund
a106c2ebf0 Comment about Unicode filenames. 2013-07-06 21:17:53 +08:00