Commit Graph

44 Commits

Author SHA1 Message Date
Michael Greene
0c941948a3 improved the test to check that the resulting count value is actually close to the target, and improved tune_count accordingly - closes #157 2016-06-09 16:13:12 -07:00
Michael Greene
e1515f755a - made HashAlgorithm.tune_count more robust and added a regression test for it - closes #157
- PEP8
2016-06-09 14:59:13 -07:00
Michael Greene
2a5e8209ea - added Brainpool Standard curve support (matching GnuPG) for users with openssl >= 1.0.2
- bumped dev branch version to 0.5.0
2016-04-22 17:10:51 -07:00
Michael Greene
54385958fb updated docs; fixed a couple of typos and documentation errors
[skip ci]
2016-04-22 14:06:41 -07:00
Michael Greene
9501954a15 updated docs
[skip ci]
2016-04-21 20:51:32 -07:00
Michael Greene
848c8afe28 - added SECP256K1 curve to EllipticCurveOID because GnuPG supports it
- marked some regression tests as such
 - minor organization stuff
[skip ci]
2016-04-21 18:46:28 -07:00
Michael Greene
dc83611b9a removed some unnecessary code; this should bring current test coverage up to 100% 2016-04-21 17:07:35 -07:00
Michael Greene
3cbad620e1 - generalized/refactored away some repeated code in MPIs subclasses
- updated __all__ in a few places
- improved test_exports
- pep8
2016-02-16 21:05:21 -08:00
Michael Greene
e8326b4771 - correctly deriving the KEK length now for KDF
- added missing OIDs for EllipticCurveOID enum members
 - expanded test of expected key generation failures to test all ECC OIDs that aren't implemented yet
 - some minor code cleanups
2016-02-16 16:23:13 -08:00
Michael Greene
f31a802c73 - Implemented proper parsing of ECDH keys - closes #110
- Additional code needed to generate ECDH keys also added
 - Encrypt/decrypt using ECDH also works
 - Added some code to the test harness to start making it work with gpg 2.1
 - Fixed key generation tests to test generating keys using all possible algorithms
 - Updated documentation sources to reflect these changes
2016-02-15 22:48:01 -08:00
Michael Greene
3d5f878b08 - String2Key count is a single octet, so the
value must be constrained to the range
  0-255 inclusive
- reversed six.PY2/3 checks so six.PY2 is the special case
- singledispatch import now tries the one in functools if singledispatch is not installed
2016-01-12 14:22:41 -08:00
Michael Greene
c76ba55ee5 - Implemented proper parsing of ECDSA keys - closes #109
- Added ECDSA signing and verification - closes #111
 - ECDSA key generation is also supported
 - refactored some of the signing/verification machinery to simplify code in PGPKey._sign and PGPKey.verify
 - fixed a bug with Signature subpacket ByteFlags where the byte output was not being properly null-padded to the length of the subpacket when necessary, which led to the potential for key outputs that would fail to parse properly if update_hlen was not called (which is silly)
 - fixed string formatting UserID packets when the comment and/or email address are missing - closes #142
 - implemented OpaquePubKey and OpaquePrivKey so that keys using unimplemented formats can still be loaded without error, even if they can't be used
 - enabled initial key action testing using ecc.1.pub.asc and ecc.1.sec.asc (which also required copying the two signatures from ecc.1.pub.asc to ecc.1.sec.asc)
 - improved test output for some tests with auto-ids that were formed in an unfortunate manner
2015-06-10 22:39:21 -07:00
Michael Greene
f3300d3895 - fixed __all__ in each __init__.py (elements should be strings, not class references); added __all__ where appropriate to other files
- added preliminary test data for ecdh/ecdsa keys [obtained from https://sites.google.com/site/brainhub/pgpecckeys#TOC-ECC-NIST-P-256-key-no-passphrase]
   - also added logic to skip actually testing against that test data as it doesn't work yet
 - updated need.txt
[skip ci]
2015-06-05 20:10:04 -07:00
Michael Greene
84567e085f - PEP8
- modified tox.ini so that py32 can continue to be tested even though cryptography no longer supports it
 - Key Generation - #147 :
   - implemented new API method
   - added unit tests for generating keys, adding user ids, and adding new subkeys
   - added unit tests to test basic expected exception raising when trying to use incomplete keys
   - added a very basic key-completeness test to the @KeyAction decorator
 - added __contains__ to SignatureVerification
2015-06-01 17:45:41 -07:00
Michael Greene
d02a7f7595 CSS change for documentation to make the content area a bit wider relative to the window; PEP 8 2014-10-14 15:39:35 -07:00
Michael Greene
21102f9aae Documentation extravaganza!
[skip ci]
2014-10-14 14:41:24 -07:00
Michael Greene
6fbe57bb96 some minor inspection fixes; documentation 2014-10-14 13:12:04 -07:00
Michael Greene
a36a776079 documentation updates and a minor API change to PGPUID.new 2014-10-07 16:32:20 -07:00
Michael Greene
accac2f702 - Selection of signing/encrypting user id is now possible; closes #121
- Forced ByteFlag subpackets to take/return sets now instead of lists
 - removed some properties from PGPKey
 - added new classmethod `from_blob` to Armorable
 - made some modifications to the unit tests to work with this stuff
2014-10-06 13:12:32 -07:00
Michael Greene
e600be8921 some documentation; overhauled PGPKey.sign by splitting it into multiple methods; reimplemented almost all of TestPGPKey in test_05_actions 2014-10-01 21:47:31 -07:00
Michael Greene
851f645cdd 100% test coverage - closes #115 2014-09-30 18:38:10 -07:00
Michael Greene
522ebcd535 added missing super calls to __init__ so multiple/diamond inheritance resolves correctly; removed some commented code that no longer needs to exist 2014-09-26 14:24:22 -07:00
Michael Greene
9583136c35 creating new photo UIDs now works - #118; signing photo UIDs is now actually being tested 2014-09-25 13:15:19 -07:00
Michael Greene
919c6357b2 replaced TypedProperty with sdproperty; replaced ClassProperty with classproperty 2014-09-24 15:55:42 -07:00
Michael Greene
7629bc79d0 api usability enhancements; more unit test stuff 2014-09-22 17:25:22 -07:00
Michael Greene
696c1575ac PGPKey.verify now verifies all of the subject's signatures that it can instead of just the first one - closes # 120 2014-09-11 14:45:05 -07:00
Michael Greene
0acdde7720 export test first pass - closes #90 2014-09-11 13:18:11 -07:00
Michael Greene
f9fbc64d69 Moved s2k count tuning to constants.HashAlgorithm - closes #116
Moved session key generator method to constants.gen_key, to facilitate encrypting messages with multiple decryption methods (e.g. several recipients private keys, or multiple passwords)
2014-09-05 17:11:48 -07:00
Michael Greene
7596d38f67 First pass for encrypting messages/storage using symmetric encryption only (via passphrase) - closes #113 2014-09-05 15:19:32 -07:00
Michael Greene
c67f6f8100 . 2014-08-27 15:48:25 -07:00
Michael Greene
c830a13896 added some more test material; added some more tests 2014-08-26 17:33:13 -07:00
Michael Greene
8542e63652 leveraging six a bit better now; also, py27 should not be broken now 2014-08-22 20:03:11 -07:00
Michael Greene
9ad050623d can now load Symmetrically Encrypted Data packets (tag 9); cannot yet decrypt them 2014-08-21 13:07:40 -07:00
Michael Greene
2dc7bf0a72 can now load parse (but not yet decrypt) packet tag 18 - Symmetrically Encrypted and Integrity Protected Data; added new test piece, Exportable Certification 2014-08-21 13:03:29 -07:00
Michael Greene
88d7836c57 compressed data packets can contain more than one packet 2014-08-21 11:44:42 -07:00
Michael Greene
c4e6cc9fea renamed 08.compressed to 08.compressed.deflate; added compress/decompress methods to the CompressionAlgorithm enum so CompressedData(Packet) can actually decompress the compressed packet within itself 2014-08-20 23:34:54 -07:00
Michael Greene
95deebdc0d PGPKey is alive again! - #80
- Filled out EmbeddedSignature finally
 - Added EmbeddedSignatureHeader since Embeded Signatures don't have a tag or a length, just a version
 - Fixed a logic error in SubPackets.__contains__
 - Added tag class bases to *Key classes
 - Added a PacketTag enum
 - Shortened the names of the certification signature types in SignatureType
 - Expanded PGPSignature.prefs into separate methods
 - Added unit tests for PGPKey (for an rsa public key and an rsa private key)
 - This also brings us one step away from completing #76 and #71
2014-08-13 20:02:21 -07:00
Michael Greene
607997eb73 PEP 8 2014-08-06 15:03:51 -07:00
Michael Greene
578f91263b - Refactored Trust into the new object model - #80
- Added enums for TrustLevel and TrustFlags
2014-08-05 21:32:41 -07:00
Michael Greene
280d82c74a - Reimplemented String2Key
- Sped up String2Key.derive_key significantly by doing math instead of a dumb loop
 - Implemented {Pub,Priv}{,Sub}KeyV4
 - Moved implementation of key decryption to Priv{RSA,DSA,ElG}
 - Added series of unit tests to test parsing many types of String-To-Key data
 - Added new unit test to test decrypting encrypted key material
 - Copied some encrypted private keys from the old test material into the new test material set for testing the decryption of encrypted secret key material
 - Minor code organization changes to prevent stupid circular import problems
2014-08-05 19:22:13 -07:00
Michael Greene
879d1c9a3c several things:
- now explicitly decoding to latin-1 when trying to decode strings
 - Issuer payload is now forced to 8 octets in length
 - moved the cool docstring for Header.parse that I made a long time ago 'cause I like it, into the new Header.parse
 - commented out ElGSignature for the time being
 - finished SignatureV4(VersionedPacket)
 - removed some commented lines that no longer needed to be kept around
 - added some reserved constants to HashAlgorithm
 - added Unknown to KeyServerPreferences; made it an IntEnum
2014-08-04 18:32:08 -07:00
Michael Greene
482ac455c4 moved the old Signature.Type to constants.SignatureType 2014-07-31 22:07:59 -07:00
Michael Greene
1ad96af888 added more descriptive names to SymmetricKeyAlgorithm 2014-07-31 15:32:51 -07:00
Michael Greene
060f3761c5 moved all existing constants to here; resubclassed as IntEnum. They still need some metadata readded. Also created new FlagEnum subclasses to use the new MetaFlagEnum/FlagEnum infrastructure. 2014-07-30 22:39:21 -07:00