Commit Graph

78 Commits (042d52a75f7209c7dd2929bfad4873a19e9d3c22)

Author SHA1 Message Date
Isis Lovecruft 042d52a75f
Move source files to directory named for top-level package. 2013-06-03 21:16:19 +00:00
Isis Lovecruft c97b51fec5
Add versioneer and restructure the repo into a src/ dir. 2013-05-12 09:32:46 +00:00
Isis Lovecruft cc7beb7185
Rewrite GPG.decrypt_file(). 2013-05-11 18:26:14 +00:00
Isis Lovecruft cfd7b38242
Add option to delete subkeys with GPG.delete_keys().
* TODO this needs unittests.
2013-05-11 18:25:17 +00:00
Isis Lovecruft dce4b4a226
Rename handle_status() parser methods to be private to cleanup the API. 2013-05-11 18:10:41 +00:00
Isis Lovecruft e4f2d533b1
Add cipher, compress, and digest preferences and rename parameters.
* Rename gpghome to homedir.
 * Rename gpgbinary to binary.
 * Add setting to append '--no-use-agent' to the command string in an attempt
   to overcome bugs resulting on systems where the user has gpg-agent running
   in the background (with some configurations, this is run before X is
   started, and killing the agent can result in X dying) and GnuPG tries to
   call the program specified by the symlink at /usr/bin/pinentry, result in
   encryption and decryption failing due to the '--batch' option blasting
   through pinentry without input. This results in a complaint from GnuPG:

       gpg: Sorry, no terminal at all requested - can't get input

   This bug also prevents symmetric encryption/decryption from working in a
   similar manner.
       Daniel Kahn Gilmor's monkeysphere, if I am recalling correctly, has a
   hack to remove the $DISPLAY variable from the users environment, and then
   add it back in, but frankly this option frightens me, as unsetting the
   display could result in all X applications failing.
       Werner Koch's suggestions, from the gnupg-devel mailing list are:
   http://lists.gnupg.org/pipermail/gnupg-users/2007-April/030927.html
       And, for the record, '--no-use-agent' doesn't disable pinentry.
2013-05-11 18:03:41 +00:00
Isis Lovecruft 458b8a4c2c
Remove unused logger statement. 2013-05-11 14:48:45 +00:00
Isis Lovecruft 228cec9533
Add all available key fields for GPG.gen_key_input to the docstring. 2013-05-11 08:49:37 +00:00
Isis Lovecruft a7afce0394
Add a testing mode to GPG.gen_key_input() which uses insecure PRNG.
* This should only be used in the unittests, as the PRNG it uses in GnuPG does
   not create strong keypairs (though it's faster, thus why we're using it for
   testing).
2013-05-11 08:43:33 +00:00
Isis Lovecruft f95c3c7c1e
Remove old TODO comment. 2013-05-10 09:50:56 +00:00
Isis Lovecruft d392265101
Fix two bugs, one due to an extra pair of quotes, the other due to strformat. 2013-05-10 09:45:39 +00:00
Isis Lovecruft b66fc4ca82
Add subkey support and a docstring to GPG.export_keys(). 2013-05-10 09:44:07 +00:00
Isis Lovecruft 55185d528b
Separate options into tidy groups so that the parser handles them efficiently. 2013-05-10 09:42:30 +00:00
Isis Lovecruft fdaadcbd20
Fix a bug due to calling a GnuPG option which was removed several versions ago. 2013-05-10 09:40:36 +00:00
Isis Lovecruft 5d0e45170f
Add a docsting for GPG.delete_keys(). 2013-05-10 09:39:40 +00:00
Isis Lovecruft 04a79a2802
Remove the version string from generated keys, encrypted files, and sigs. 2013-05-10 09:33:07 +00:00
Isis Lovecruft df5346694d
Get rid of the "--no-show-photos is deprecated" GnuPG warning. 2013-04-17 22:49:09 +00:00
Isis Lovecruft bd853d3fdb
Make the util module private. 2013-04-17 22:48:07 +00:00
Isis Lovecruft 0bc97dd48b
Move _copy_data(), _write_passphrase(), and _threaded_copy_data() to util. 2013-04-17 22:47:13 +00:00
Isis Lovecruft 0394034236
Add key generation utility functions.
* Add util._make_passphrase() for creating a random string passphrase and
   optionally writing it to a file only readable by the real uid of the
   running process.
 * Change the util._today() function to _next_year(), which gives us today's
   date a year from now, for setting the default expire date in
   GPG.gen_key_input().
2013-04-17 20:58:49 +00:00
Isis Lovecruft 9288f8eead
Add docstring for GPG.gen_key_input(). 2013-04-17 20:57:51 +00:00
Isis Lovecruft a9faa376e7
Update docstring for GPG.genkey(). 2013-04-17 20:54:39 +00:00
Isis Lovecruft faf102e6ac
Remove old commented out code for keyring generation in GPG.__init__(). 2013-04-17 20:53:56 +00:00
Isis Lovecruft 56131179c6
Add stub GPG.list_sigs() function. 2013-04-17 00:16:28 +00:00
Isis Lovecruft 9dc2947014
Update docstrings for GPG.decrypt() and GPG.send_keys(). 2013-04-17 00:14:06 +00:00
Isis Lovecruft 961b63f958
Add explicit --no-show-photos option to GPG.list_keys() just in case. 2013-04-17 00:12:18 +00:00
Isis Lovecruft 2fb88ad6b4
Fix function verify_file() to handle detached signature files. 2013-04-16 23:09:05 +00:00
Isis Lovecruft 301fd6f89c
Clean up the logging statements in _sign_file(). 2013-04-16 23:07:37 +00:00
Isis Lovecruft 70b8269aaf
Remove one of the sources of the UnicodeDecodeErrors on Python2.6. 2013-04-16 23:06:42 +00:00
Isis Lovecruft 807aa9821b
Make log statements in _copy_data() more explicit. 2013-04-16 22:45:33 +00:00
Isis Lovecruft 07310a860e
Move _make_binary_stream() to util module and update unittests. 2013-04-15 01:42:55 +00:00
Isis Lovecruft b09adb3f19
Remove extra output handing logic in GPG.encrypt_file(). 2013-04-15 01:13:47 +00:00
Isis Lovecruft f357c16a21
Move dreb's GPGWrapper class to gnupg.py. 2013-04-15 01:12:36 +00:00
Isis Lovecruft 4a63023e4b
Update docstring for GPG.encrypt(). 2013-04-15 01:11:47 +00:00
Isis Lovecruft 06a480b669
Get rid of useless inline comment. 2013-04-15 01:11:20 +00:00
Isis Lovecruft a17b8828c1
Again, _result_map is a private attribute. 2013-04-15 01:10:33 +00:00
Isis Lovecruft af996b8a69
Update docstring for GPG.encrypt_file(). 2013-04-15 01:09:32 +00:00
Isis Lovecruft 4a719cec79
Update docstring for GPG.gen_key_input(). 2013-04-15 01:08:54 +00:00
Isis Lovecruft 5f3f26f916
Refactor method GPG.gen_key(). 2013-04-15 01:08:14 +00:00
Isis Lovecruft 26d8f98513
Explicitly list public keys if we didn't specify for secret ones. 2013-04-15 01:07:22 +00:00
Isis Lovecruft 1be0114847
Changes because of now-private attributes and checks moved to util.py. 2013-04-15 01:06:29 +00:00
Isis Lovecruft acbe787847
Make _result_map attribute private. 2013-04-15 01:02:44 +00:00
Isis Lovecruft 3626132c6c
Update check in GPG.verify_file() to use util._is_file(). 2013-04-15 01:01:35 +00:00
Isis Lovecruft 7555cbac3c
Update docstring for GPG.verify_file(). 2013-04-15 01:01:02 +00:00
Isis Lovecruft 4383e9ac5c
Update docstring for GPG.verify(). 2013-04-15 00:59:55 +00:00
Isis Lovecruft 773b7adfb8
Make _result_map a private attribute. 2013-04-15 00:59:31 +00:00
Isis Lovecruft 265c32ac47
Change keyid in _sign_file() to remove extra quoting. 2013-04-15 00:59:03 +00:00
Isis Lovecruft 2691cc8d33
Change level of two log statements. 2013-04-15 00:58:29 +00:00
Isis Lovecruft f6e3d19826
Change GnuPG argument construction in GPG.sign() to use allowed options. 2013-04-15 00:57:42 +00:00
Isis Lovecruft 22e0443dcc
Change GPG.sign() to handle files and strings, make _sign_file() private. 2013-04-15 00:56:49 +00:00