Commit graph

67 commits

Author SHA1 Message Date
Vladimir Diaz
da8221ccf9 Explain that crypto libraries may place further restrictions on keys
For example, PyCrypto requires that RSA keys be a multiple of 256
2016-02-12 13:07:42 -05:00
Vladimir Diaz
6bded2bce7 Remove remaining exception messages that are stored in temp variables 2016-02-11 15:28:51 -05:00
Vladimir Diaz
2a7bd8248f Merge branch 'develop' of github.com:theupdateframework/tuf into 1.0-review2 2016-02-11 12:31:06 -05:00
Vladimir Diaz
e007507e0b Expand comment to say that users have the option to update tuf.conf if a required library is unavailable 2016-02-11 12:17:52 -05:00
Vladimir Diaz
5b1a931177 Remove unneeded import statement ('Crypto') 2016-02-11 11:25:35 -05:00
Vladimir Diaz
b5e75ab277 Raise an exception if a required privat key is unset 2016-01-29 10:57:25 -05:00
Vladimir Diaz
3f1bb37560 Clarify that keys with sizes lower than what we recommend may still be imported 2016-01-28 17:46:28 -05:00
Vladimir Diaz
6953fd758b Delete irrelevant comment in import_rsakey_from_encrypted_pem() 2016-01-28 17:36:26 -05:00
Vladimir Diaz
c99bb0fe01 Reduce redundant info in a comment, but emphasize what is excluded in keyid 2016-01-28 15:48:29 -05:00
Vladimir Diaz
75b8b66523 Fix doc test failures in two functions of keys.py 2016-01-28 14:26:56 -05:00
Vladimir Diaz
d9ecbc851f Do not store private key material in exception messages 2016-01-28 14:03:49 -05:00
Vladimir Diaz
2452076467 Update comment to list PyCA's newly supported crypto library 2016-01-28 13:41:15 -05:00
Vladimir Diaz
1380b67642 conformat --> conformant 2016-01-28 13:30:17 -05:00
Vladimir Diaz
68e863835b Fix comment in generate_ed25519_key()
Fix comment to explain that PyCA's pure python implmentation of ed25519 is used as a fall back only in the verification of Ed25519 signatures
2016-01-28 13:26:48 -05:00
Vladimir Diaz
8d5a7cb8c1 Do not reference the current module by name in the header block 2016-01-26 15:01:50 -05:00
Vladimir Diaz
85c229fd3b Remove temp variables to store exception messages
And move links for RSA and Ed225519 to a more suitable location in the doctsring.
2016-01-25 17:02:20 -05:00
Vladimir Diaz
8ce6031ced Add a note to extract_pem() to state the expected format of the returned pem 2016-01-21 16:39:26 -05:00
Vladimir Diaz
0c05e36030 Delete unneeded variable in keys.py 2016-01-21 16:21:29 -05:00
Vladimir Diaz
faf1a18a99 Remove extraneous blank line 2016-01-21 16:12:55 -05:00
Vladimir Diaz
75f1b93b37 Fix UnsupportedLibraryError messages in keys.py
The error messages raised when a crypto library specified in conf.py is unavailable were expanded.  Modified the message to not use backslashes (explicit line continuation)
2016-01-21 16:09:33 -05:00
Vladimir Diaz
6a9c209381 pyca_crypto_keys.py is not used to generate Ed25519 keys (ed25519_keys.py is) 2016-01-21 12:39:46 -05:00
Vladimir Diaz
f6d7302293 Tweak the comment blocks for the crypto import statements in keys.py 2016-01-21 12:36:15 -05:00
Vladimir Diaz
21eeed3c94 Add extract_pem(), which was previously in format_rsakey_from_pem() 2015-08-26 17:26:29 -04:00
Vladimir Diaz
342b3b0c78 Remove leading and trailing newline characters from private PEM strings 2015-08-26 11:13:39 -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
3eb8f10710 More coverage improvements 2015-03-02 15:10:27 -05:00
vladdd
95ab4e3172 Replace re.sub() with string.index()
re.sub() with the 'flags' keyword argument caused type error in Python 2.6.
Converted PEM validation to use index() to address issue above.
Raise specific exception depending on missing header / footer.
Check footer follows header.
2014-07-18 15:19:04 -04:00
Ruben Pollan
53ff336468 Clean up pem keys
A change of line or any other character outside the public key makes
changes the keyid and breaks the behaviour of TUF. Remove everything
before '-----BEGIN PUBLIC KEY-----' and after
'-----END PUBLIC KEY-----'.
2014-07-17 13:37:31 -05:00
vladdd
7be31965e7 Minor edits. 2014-06-29 21:33:22 -04:00
Vladimir Diaz
1c1cd0f192 Update / fix remaining Python 2 + 3 doctests.
Remove test_slow_retrieval_attack.py print statements.
2014-06-06 08:37:31 -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
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
bc99524e2b Finish initial refactor of slow retrieval attack. 2014-05-13 12:53:50 -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
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
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
vladdd
08a2bad2c0 Add Travis CI, coveralls, and coverage-related updates. 2014-04-20 16:15:19 -04:00
Vladimir Diaz
7314f782aa Add error message for clients that lack a required crypto library.
TUF's crypto dependencies was recently changed: ED25519 signatures supported by default, and require PyCrypto or tuf[tools] to verify RSASSA-PSS signatures.
The error returned for clients that tried to verify rsassa-pss signatures without the required library was bad.  Error message returned now:

$ basic_client.py --repo http://localhost:8001
Error: No working mirror was found:
  localhost:8001: Metadata downloaded from the remote repository specified an RSA signature.  Verifying RSA signatures requires PyCrypto.
$ pip install PyCrypto, or pip install tuf[tools].
2014-04-03 13:18:58 -04:00
vladdd
2d015797ef Update affected ed25519 modules.
Update modules affected by the changes made to the latest versions of pyca-ed25519 and pyca-pynacl:
Do not use the unsafe key and signature generation functions of pure python ed25519, but do support the signature verification routine.  Developers must use the faster and secure pynacl+libsodium to generate ed25519 keys and signatures.

Temporarily suppress pynacl's import warning error.

Minor edits to comments and code.
2014-03-07 23:21:54 -05:00
Vladimir Diaz
73adff9edf Update format_rsakey_from_pem() in keys.py.
Update repository_tool.py and keys.py functions that import rsa publickey files.  Perform a simple check of the PEM string so that an improperly formatted PEMis detected sooner.  Reported by Santiago.
2014-02-19 09:13:01 -05:00
Vladimir Diaz
00c69116aa Implement key format requested in issue #171.
Exclude the 'private' attribute from metadata key objects, and when calculating keyids.
2014-02-13 12:10:12 -05:00
Vladimir Diaz
2c55b94a8b Modify the extension of rolename files.
rolename.txt -> rolename.json.
2014-01-27 11:35:38 -05:00
vladdd
b2e220f598 Fix Issue #167. 2014-01-18 17:09:32 -05:00
Vladimir Diaz
2a61a80162 Update modules affected by the vendored ed25519 and update libtuf.py 2013-12-20 16:06:25 -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
8b7745cb09 Add final comment+docstring updates to keys.py
Minor comment change to libtuf.py
2013-12-12 09:26:25 -05:00
Vladimir Diaz
7a08bad781 Continue documentation effort and fix outdated libtuf.py 2013-12-11 14:14:16 -05:00