Commit Graph

396 Commits

Author SHA1 Message Date
Michael Greene
95261034f4 Can now decrypt asymmetrically-encrypted messages (RSA only; OpenSSL does not provide ElGamal at this time) - #105 2014-08-26 20:12:44 -07:00
Michael Greene
c830a13896 added some more test material; added some more tests 2014-08-26 17:33:13 -07:00
Michael Greene
807062234f cleaned up some code in PGPKey.sign; added new Signature(MPIs) method from_signer; removed OpenSSL 0.9.8 from testing because it causes unnecessary problems during testing, and I don't want to support it anyway 2014-08-26 12:25:35 -07:00
Michael Greene
44e7a49ee1 removed keys.py as it is no longer needed (finally); forgot to remove one instance of params in conftest 2014-08-26 11:08:14 -07:00
Michael Greene
976d1272f3 the warning verifying with a subkey like this generates needs to be explicitly ignored 2014-08-25 17:28:22 -07:00
Michael Greene
30ffc7fd78 signing binary documents works again - first pass (still some cleanup to do, but this is a good start) 2014-08-25 17:22:33 -07:00
Michael Greene
07c4343841 verification of signatures of binary documents works again 2014-08-25 15:03:28 -07:00
Michael Greene
902832bc8e Added parsing for signed messages, one-pass signed messages, and encrypted messages - closes #102 2014-08-25 12:31:07 -07:00
Michael Greene
3e9c136c5a added parsing of One-Pass signature packets 2014-08-25 11:29:54 -07:00
Michael Greene
cb4316fe60 more new test material
[skip ci]
2014-08-22 22:17:48 -07:00
Michael Greene
98af166e90 added literal and compressed messages - #102 2014-08-22 20:59:50 -07:00
Michael Greene
db465fa191 refined the cleartext group in the ASCII regex some; implemented some of the properties in PGPMessage for the cleartext case; some PEP8 fixes; renamed one of the message blocks and added a new one; implemented a test harness for PGPMessage, and added a test to that harness for testing the cleartext messages 2014-08-22 19:05:22 -07:00
Michael Greene
f3fbe55024 added basic support for loading/parsing and exporting cleartext messages 2014-08-22 16:59:29 -07:00
Michael Greene
9ea1d14ed0 updated tox pep8 to use a flake8 config section; PEP8 fixes; added one-pass signed messages (closes #103) 2014-08-22 14:32:43 -07:00
Michael Greene
43bc7bf7f6 Updated cryptography to 0.5.4 - closes #91
Slightly reorganized the default imports in pgpy/__init__.py
First pass at updating the ascii_unarmor regex to support cleartext signatures - #102, #27, #28
Added pypy3 to the test matrix as an allowed failure
2014-08-22 13:00:40 -07:00
Michael Greene
fe5ed49241 added another userid test packet for regression testing the regex; renamed the inline-signed message to cleartext.asc; updated need.txt, and progress.rst 2014-08-21 18:06:14 -07:00
Michael Greene
9a55f873d8 can now parse Symmetric-Key Encrypted Session Key v4 packets; corrected a typo 2014-08-21 13:23:49 -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
88fef75490 fixed test id enumeration to work on a test material file's basename (as it was supposed to) instead of the whole path; added additional test material to test all currently defined compression algorithm types 2014-08-21 11:08:34 -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
c1761abf51 - Implemented parser classes for Public-Key Encrypted Session Key v3 packets, Compressed Data packets, and Literal Data packets
- Added stub classes for Symmetric-Key Encrypted Session Key v4 packets, One-Pass Signature v4 packets, Symmetric-Key Encrypted Data packets, Marker packets, Symmetric-Key Encrypted and Integrity Protected Data v1 packets, and Modification Detection Code packets
 - Updated PGPKeyring a bit; now returns a list of unique fingerprints loaded by PPGKeyring.load and PGPKeyring.fingerprints
 - Added a shortcut property to PrivKeyV4 that returns True if the secret key material is encrypted, otherwise False
 - Fixed a small parsing bug in Opaque(Packet) that parsed incorrect lengths on versioned packets. This was previously dead code, so it would not have appeared before adding the versioned packet stubs.
2014-08-20 18:45:26 -07:00
Michael Greene
720ae702cf Merge branch 'feature/#80' into develop. closes: #69, #72, #76, #80, #82, #98 2014-08-19 18:38:52 -07:00
Michael Greene
ae038ebfea finished reimplementing PGPKeyring 2014-08-19 17:58:03 -07:00
Michael Greene
1ce179a4c4 - partially reimplemented PGPKeyring - #80
- fixed a typo in UserID packet regex that was causing it to capture well-formatted comments as part of the name
 - changed _signature fields for PGPKey and PGPUID to deques
 - moved is_ascii and is_path into FileLoader as staticmethods
 - fixed comment0 header in pubtest.asc
 - changed Fingerprint.__hash__ to return the hash of the fingerprint without any spaces
 - partially added first unit test for PGPKeyring
2014-08-15 01:17:00 -07:00
Michael Greene
443604b9f6 stubbed out the new PGPKeyring and a test harness for it
incremental update to test_reg_bug_56 to begin transitioning into using PGPKey and PGPSignature instead of directly using the packets and TempExportableSig
added stub property __key__ to PGPKey
[skip ci]
2014-08-13 21:02:48 -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
08e3f7a051 PGPSignature is alive again! - #80
- Two property methods are not yet because I don't have test data for them yet
 - Added __sig__ method to Signature(MPIs). DSASignature.__sig__ outputs in (hopefully) correct ASN.1 DER format
 - Removed keyfields.py finally
 - Changed expiration subpacket payloads to timedelta objects (as they should have been already)
 - Changed SignatureV4.hleft to SignatureV4.hash2 for consistency
 - Added unit test harness for basic loading of PGP blocks
 - Added unit test harness for loading/testing signature blocks
 - Added unit test stub for (eventual) loading/testing key blocks
2014-08-12 18:36:42 -07:00
Michael Greene
943c39c0bb fixed Python 2.7 2014-08-10 02:34:35 -07:00
Michael Greene
5ba1095ec0 python 3.2 works now 2014-08-10 01:54:12 -07:00
Michael Greene
ca886fc049 - filled out more progress
- stubbed out PGPKey more
 - added temporary test instantiation to test_3_armor
2014-08-09 21:46:59 -07:00
Michael Greene
1e30047ed8 whoops 2014-08-09 20:07:21 -07:00
Michael Greene
1c4667c7f4 refactored MPI field classes to:
- store key parts as integers #94
 - private MPI classes now also store the public key fields - #92
 - do the work to set up the Cryptography public/private key objects. Private key field objects can also return public key objects, so this is part of what is needed for #92
 - updated unit tests to work with the refactored code
2014-08-09 19:52:06 -07:00
Michael Greene
6728b0b9b3 more test stuff 2014-08-09 13:09:15 -07:00
Michael Greene
746643e445 added a new userid packet that found a problem with my uid regex 2014-08-07 14:38:14 -07:00
Michael Greene
e1f43a3519 - renamed subpacket and packet files to be more easily eye-sortable
- updated parametrizations to match the new filenames
 - disabled stdout capturing in py.test
 - added classname output to TestPacket.test_load
2014-08-07 13:49:01 -07:00
Michael Greene
d6e323e68c more tests/test material modifications
- modified the header in compressed.08 to use a one-byte length instead of an indeterminate length
 - changed the keyserver in signature.0x18 to fakekey.server.tld
 - modified the parametrization of packet headers and parsing tests to append CAFEBABE to the end of each packet as a sentinel value to ensure that none of the parsed packets are being overly greedy; modified the tests to take this into account
 - filled out all missing pgpdump strings for subpackets
 -
2014-08-07 12:40:18 -07:00
Michael Greene
be17ea647b - added additional test material; I now have almost all RFC 4880 packet types represented
- renamed some packet files to pad single-digit tag ids to 2 digits
 - added alternate keyring location keyword argument to gpg_verify
 - added support for parsing indeterminate packet lengths with old type headers (assumes the length is all the remaining bytes)
 - added stripped down pubkey to bug_56 regression test
2014-08-07 01:14:00 -07:00
Michael Greene
c7e0bef165 - implemented a real regression test for #56
- deleted bug_56.py
 - renamed test_3_actions to test_4_actions
 - added stub for test_3_armor
 - added more to need.txt
2014-08-06 19:14:42 -07:00
Michael Greene
3ed34cb538 removed unused import 2014-08-06 19:10:12 -07:00
Michael Greene
3509230b63 no message 2014-08-06 19:10:03 -07:00
Michael Greene
228e52e205 reenabled gpg_verify test fixture 2014-08-06 19:09:52 -07:00
Michael Greene
c7a9892c92 moved all test parametrization to conftest; created stub for test_3_actions.py 2014-08-06 15:07:23 -07:00
Michael Greene
f9b72b019a more updates/cleanups of test material 2014-08-06 15:06:45 -07:00
Michael Greene
31278535d4 - refactored UserAttribute into the new object model
- changed internal keys in SubPackets to tuples
 - stopped storing the {,un}hashed packet block lengths for SubPackets as it's trivial to compute those anyway, and doesn't need to be done often
2014-08-06 11:25:52 -07:00
Michael Greene
c00036d63f stubbed out UserAttribute(Packet) 2014-08-05 22:10:34 -07:00
Michael Greene
1cefd6cd57 organization - #82 2014-08-05 22:07:59 -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
44352712ed - refactored UserID into the new object model - #80
- renamed some test material - #82
 - added the infamous 'dunham' userid packet to test material - #81
2014-08-05 21:10:12 -07:00