Commit Graph

179 Commits (64fd83bf85d34bbfb63275ad5a08d0a5992b3acd)

Author SHA1 Message Date
Isis Lovecruft 64fd83bf85
Add bug reporter. 2013-04-11 18:39:03 +00:00
Isis Lovecruft f68d01b9f2
Update the README. 2013-04-11 18:21:32 +00:00
Isis Lovecruft f01668fe48
Add NOTES file to docs/ directory. 2013-04-11 18:16:05 +00:00
Isis Lovecruft 3152784ada
Merge branch 'fix/2162-stream-check' into develop 2013-04-10 22:00:09 +00:00
Isis Lovecruft 58de4c6c21
Make a logger statement more explicit. 2013-04-10 21:58:56 +00:00
Isis Lovecruft 0ae817e3b8
Update _sanitise() docstring with information on return object. 2013-04-10 21:56:55 +00:00
Isis Lovecruft 32c6c1b3ed Lower key length and fix expiry date in test_invalid_key_type(). 2013-04-10 21:49:44 +00:00
Isis Lovecruft 0fcf9676b3 Add checks to test_gen_key_input(). 2013-04-10 21:49:44 +00:00
Isis Lovecruft a873c1172a Default the key length for batch files to 4096. 2013-04-10 21:49:44 +00:00
Isis Lovecruft c47968c47a Fix unittest to check for secret keyring. 2013-04-10 21:49:44 +00:00
Isis Lovecruft febabccbda Pep8'ing the docstrings again. 2013-04-10 21:49:44 +00:00
Isis Lovecruft 38cc813412 Rearrange the logic on checking safe_values so that None is skipped. 2013-04-10 21:49:44 +00:00
Isis Lovecruft dd25c3742a Remove some extraneous log statements, make others more explicit. 2013-04-10 21:49:44 +00:00
Isis Lovecruft 582a17beb8 Remove a comment about pre-Python2.6 compatibility, since we don't care. 2013-04-10 21:49:44 +00:00
Isis Lovecruft 0ce277a367 Add options '--list-secret-keys' and '--fixed-list-mode' to _is_allowed(). 2013-04-10 21:49:44 +00:00
Isis Lovecruft d861b36305 Fix #2162 add stream check. 2013-04-10 21:49:44 +00:00
Isis Lovecruft 00e94d6b34
Hack around the nasty ctb=%d.02 GnuPG bug that keeps resurfacing.
* https://bugs.g10code.com/gnupg/issue1179

 * This bug has resurfaced several times in GnuPG's history, and as far as I've
   understood it, it is due to a generation or an attempt at parsing a .gpg
   file (a message/file, or one of the keyrings) which is generated/formatted
   such that the GnuPG data packets comprise a certain number of bytes (562
   bytes precisely) and/or the demarcation signal (two equal signs, '==') of
   the trailing ctb (I assume 'ctb' stands for cipher text bytes; it's
   everywhere in GnuPG's sourcecode) CRC checksum ends up on its own line, like
   so:

        -----BEGIN PGP MESSAGE-----

        hQIMA1DJjYe0ARAPAQ/6A7PWiyfiBIpbJ7+XbaptYPB0muoi3rXF4cuIXU37uDug
        04Cck+8u9hcMjhYd0pN6zJMJLO8CUOdUKJblpxPSYc7yanJDc33n1jsdkr7XNbbz
        Xjh1z3EJZPhhp3YE7lqgnTTXQsGUihnhwiQqsuNgCVZfSwXpVFa+IHC+/AXhAPLl
        /BoY6+YOupD8G4bOUCU/XBvQp8uH9kh9n9101+6SopJ94H354X0PtZJs5BISCW7g
        /tUxAqxLesDaZkHF91HL7AJE8+/pheTc8vHGP+Zu8/Q5Lr+GW2cUrCXXxUV/xRIh
        P7t7WDdU5V1BXyughEBP7Jwr8G3llKr42ZRVgvOyFIe+sMVibq2dEhxJr/sjR0j6
        lYws+tZVWbmuxOnMDCjgIaEverU0nnd1SqQ/tS7yFh8lpBfMay2IdVVh+Bi3zDeT
        Kb/h3tCjG0++h5FuG8UBWv13LRlfcF817ShnwoG80y4cESgCXxZGkd9DRExH8wy8
        VJpIaVKiaZs5jlHLHX4JWy2IVmEvk/6xwZZwrNV4sGYzDGkxHLyTUUQu/NOkCtAb
        2Zs9mGrtsSGSoP6lfKDk9hh8fJtPGxGzIezVR9WXYKeYAfGZOzMI1Ji1jF1fO21G
        KqTaF2WnWfaWmsuICTiBntgNntZRsXwmMNkcBt5LVK8uRpWQqIQmAkN4vl6SgovS
        QAHrC6D9mUmoNvKcS71aH4uZjkfYtNmgp8i5cmTP6UaGouVeqzDCtK/vIy1V/iaX
        89vcdsILlMMVB/10Rtscyus
        ==suET
        -----END PGP MESSAGE-----

    When this happens, GnuPG *stops* parsing entirely before the CRC checksum
    following the '==', and thus the next time it starts parsing again the
    first thing it gets is the end header '-----END PGP MESSAGE-----'.

 * My solution for hacking around this is to export directly to a keyring,
   which can either be one we create for this purpose, or the keyring set as
   self.pubring. I do not know yet if this will affect --list-keys.
2013-04-10 21:49:35 +00:00
Isis Lovecruft dc0d9cf70b
Update docstring for GPG.gen_key_input() with details on batch file syntax. 2013-04-10 19:16:58 +00:00
Isis Lovecruft 24da4d186c
Factor out unnecessary parsing for the presence of the passphrase fd. 2013-04-10 19:15:43 +00:00
Isis Lovecruft c96aed31ed
Add function for getting a string of today's date in %Y-%m-%d format. 2013-04-10 19:14:48 +00:00
Isis Lovecruft 8c6821ea0e
Remove log statement entirely because otherwise it's triplicate. 2013-04-10 18:03:52 +00:00
Isis Lovecruft b8ce529638
Remove duplicate log statement of the GnuPG command we're running. 2013-04-10 18:00:00 +00:00
Isis Lovecruft 525ebf71ef
Merge branch 'fix/update-packaging' into develop 2013-04-10 17:52:05 +00:00
Isis Lovecruft a54fa33ff5 Bump because minor version because we've rewritten large chunks of the codebase. 2013-04-10 17:51:06 +00:00
Isis Lovecruft dbdcc848a5 Update .gitignore. 2013-04-10 17:51:06 +00:00
Isis Lovecruft f385b3938f Fix distutils, PyPI, and pip packaging configuration files.
* Remove/replace old classifiers in PyPI configuration PKG-INFO.
 * Add pip requirements.txt file for documentation builds on readthedocs.org.
 * Fix package build variables in distutils setup.py.
2013-04-10 17:51:06 +00:00
Isis Lovecruft 9e0e0a0d4e Add Makefile command for creating a virtualenv with virtualenvwrapper. 2013-04-10 17:51:06 +00:00
Isis Lovecruft 3be6c67bb9
Merge branch 'fix/2162-stream-check' into develop 2013-04-10 17:49:11 +00:00
Isis Lovecruft 0c5fda7da4
GnuPG wants pubring for its option '--keyring'. Fuck GnuPG. 2013-04-10 17:22:59 +00:00
Isis Lovecruft af7e952b42
Factor out some unnecessary string parsing code. 2013-04-10 17:22:09 +00:00
Isis Lovecruft 5fd040c793
Remove extraneous logger statement. 2013-04-10 17:21:11 +00:00
Isis Lovecruft e978f34712
Add '--secret-keyring' as an allowed option. 2013-04-10 17:20:47 +00:00
Isis Lovecruft a97040a06f
Add unittest cmdline argparse to hook into unittest.TestProgram's parser. 2013-04-10 17:19:25 +00:00
Isis Lovecruft 20284e0741
Revise logger and suite ordering, and override parts of unittest module.
* Rearrange sets of testsuites to provide logical execution order.
 * Remove unused suite() function.
 * Create dynamic module loader through a unittest.TestProgram.createTest
   override to take an instance of unittest.TestLoader which is created later.
2013-04-10 17:14:06 +00:00
Isis Lovecruft 43a69e9fcd
Update test assertions for key generation and batch parameters after import.
* In unittest test_key_generation_import_list_with_colons().
2013-04-10 17:08:21 +00:00
Isis Lovecruft c19fd30545
Add assertions to check that key have been created in test_gen_key_*(). 2013-04-10 17:05:35 +00:00
Isis Lovecruft f0ee442bab
Pep8ify some more docstrings. 2013-04-10 17:04:57 +00:00
Isis Lovecruft 1d34b04d82
Remove unused function expire_today(). 2013-04-10 17:03:21 +00:00
Isis Lovecruft b758239af8
Add implementation note on test_copy_data(). 2013-04-10 17:02:13 +00:00
Isis Lovecruft 5f157c3c00
Don't hardcode paths. 2013-04-10 17:01:37 +00:00
Isis Lovecruft fc71ede502
Cleanup assertion statement. 2013-04-10 17:00:52 +00:00
Isis Lovecruft 5e706d09d0
Pep8 the docstrings. 2013-04-10 17:00:11 +00:00
Isis Lovecruft 5cd2eb2b94
Also get the logger from gnupg so that we can debug events in unittests. 2013-04-10 16:58:59 +00:00
Isis Lovecruft c72aa1eb96
Update unittest temporary file directory location and gnupghome. 2013-04-10 16:55:29 +00:00
Isis Lovecruft c5d2e6fc9d
Keep module metadata in one place. 2013-04-10 16:54:39 +00:00
Isis Lovecruft 4ee62ea400
Patch Python2.6 and earlier to use future-patched unittest module. 2013-04-10 16:52:48 +00:00
Isis Lovecruft 1cac3df2ca
Add the missing crunchbang in test_gnupg.py. 2013-04-10 16:43:42 +00:00
Isis Lovecruft e9d223f701
Fix typos, remove extra whitespace line. 2013-04-09 17:47:31 +00:00
Isis Lovecruft 9af49dbce5
Add missing option `--batch` to _allowed options set.
* Rearranged the other options because their order was nolens volens.
2013-04-09 17:35:10 +00:00
Isis Lovecruft 09481d27ae
Split key material related unittests into separate test suites by functionality. 2013-04-09 17:34:18 +00:00