summaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)Author
2018-07-13remove test codejustus/generate-weird-keysKai Michaelis
2018-07-13openpgp: use as_rfc4880() when serializing the RSA keyKai Michaelis
2018-07-05add example that generates (weird) keysJustus Winter
2018-07-05openpgp: Add simple decryption example.Justus Winter
2018-07-05openpgp: Implement serialization of secret keys.Justus Winter
2018-07-05openpgp: Also accept RSASign when creating/verifying signatures.Justus Winter
2018-07-05openpgp: Fix parsing secret keys.Justus Winter
- Use php_try! to parse secret keys, so that truncated keys are turned into an unknown packet.
2018-07-04openpgp: Use broken-down time as key creation time.Justus Winter
2018-07-04openpgp: Add and use a module for time and duration conversion.Justus Winter
2018-07-04openpgp: Add a new way to wrap writers for streaming serialization.Justus Winter
- Implement `From<'a mut io::Write>` for the writer stack. While this may be neat in some situations, if you have a concrete writer `sink`, you need to do some acrobatics to use it, e.g.: Signer::new((&mut sink as &mut io::Write).into(), ...)
2018-07-04openpgp: Hide the `writer::Stackable` trait.Justus Winter
- Do not expose the `writer::Stackable` trait in the API. Instead, use a tuple struct to wrap boxed objects of this kind. - Add and use `writer::Stack::finalize()` and `writer::Stack::finalize_all()` to pop one or all writers from the stack.
2018-07-04openpgp: Fix EdDSA corner case.Justus Winter
- MPI encoding can drop leading zero bytes, we need to add them back prior to feeding the signature to nettle.
2018-07-02openpgp: Remove gratuitious mut.Neal H. Walfield
2018-07-02tool: Emit armored data by default.Justus Winter
2018-07-02openpgp: Simplify KeyFlags handling.Justus Winter
- Instead of having an owned and a referencing version, just copy the byte(s) when constructing a KeyFlags object. In almost all cases it will be just one byte.
2018-07-02openpgp: Implement detached signature generation in the Signer.Justus Winter
- Also, simplify the example accordingly. - Add an example for a normal signature.
2018-07-02openpgp: Fix error handling.Justus Winter
2018-07-02openpgp: Improve documentation, add example.Justus Winter
2018-07-02openpgp: Create a special Option-like type for PacketParser.Neal H. Walfield
- In the future, we want to return some summary information about a parsed packet sequence after the packet sequence is fully parsed. Currently, PacketParser::next() and PacketParser::recurse() consume the PacketParser and return None on EOF. Thus, even if the summary information were stored in the PacketParser, it becomes inaccessible on EOF. - This change introduces a new type, PacketParserResult, that contains either a PacketParser or a PacketParserEOF. PacketParserEOF is returned on EOF instead of None. Since it is a struct, it can hold only any information that we want to return to the caller.
2018-06-29openpgp: Actually compute signatures in the streaming signer.Justus Winter
2018-06-29openpgp: Derive Eq for Fingerprint.Justus Winter
- This is necessary to use Fingerprints as keys in hash maps.
2018-06-29openpgp: Make SubpacketArea::lookup public.Justus Winter
- Also make it return Subpacket instead of SubpacketRaw.
2018-06-29openpgp: Implement signing.Justus Winter
- This implements the low-level functionality necessary to create signatures using RSA, DSA, ECDSA, and EdDSA.
2018-06-29openpgp: Move the definition of `struct Signature`.Justus Winter
2018-06-29openpgp: Add setters for subpackets.Justus Winter
2018-06-29openpgp: Add a owned version of KeyFlags.Justus Winter
2018-06-29openpgp: Implement Default and PartialEq for Keyflags.Justus Winter
2018-06-29openpgp: Make subpacket debug output prettier.Justus Winter
- Format the SubpacketArea as a list instead of a map, and avoid printing the tag in the subpacket.
2018-06-29openpgp: Add and use a function converting from Value to Tag.Justus Winter
2018-06-29openpgp: Typo.Justus Winter
2018-06-29openpgp: Fix serializing embedded signatures.Justus Winter
- Embedded signatures must be serialized without the frame.
2018-06-29openpgp: Make iterating over maps of broken packages more robust.Justus Winter
- Avoid out-of-bounds slicing.
2018-06-29openpgp: Typo.Justus Winter
2018-06-29openpgp: Typo.Justus Winter
2018-06-29openpgp: Implement deleting, adding, and replacing subpackets.Justus Winter
2018-06-28openpgp: Implement Serialize for Subpacket{,Value}.Justus Winter
2018-06-28openpgp: Add constructor and length method for Subpacket{,Value}s.Justus Winter
2018-06-28openpgp: Add accessors for subpacket::NotationData.Justus Winter
2018-06-28openpgp: Refactor length parsing and add serializing.Justus Winter
- Add a type alias for the subpacket length, and implement parsing and serializing as trait methods.
2018-06-28openpgp: Typo.Justus Winter
2018-06-28openpgp: Improve error handling.Justus Winter
- Return an Error::InvalidArgument when trying to parse a ciphertext with a signature algorithm specifier, or a signature with an encryption one.
2018-06-28openpgp: Add `MPIs::Unknown` for parameters of unknown algorithms.Justus Winter
- Fixes #8.
2018-06-28openpgp: Parse MPIs of ElGamal signatures.Justus Winter
2018-06-28openpgp: Typo.Justus Winter
2018-06-28tool: Add a test for the bug fixed in 1d63e71.Neal H. Walfield
2018-06-27tools: Make sqv check that a validated TPK is really wanted.Neal H. Walfield
- sqv only checked whether an *unvalidated* TPK was wanted; it needs to double-check that this is really the case after validating the TPK. Consider the case where key X is needed to validate a signature and the keyring contains two keys: Mallory's and Alice's, and both have key X as a subkey, but the back-sig is only valid for Alice's key. The current code will use Mallory's key, and the signature validation will fail. If we had double checked, then we'd have discarded Mallory's key, and correctly used Alice's. - To fix this problem, this commit changes the code to use the new TPKParser::unvalidated_tpk_filter, which is not only simpler to use, but takes care of this double checking.
2018-06-27openpgp: Add an interface to filter unvalidated TPKs.Neal H. Walfield
- Validating self-signatures is computationally expensive. When searching a keyring, it would be faster to filter, validate and then recheck, than to validate and filter. - Because handing out unvalidated TPKs will inevitably result in an unvalidated TPK being used in a context where it should have been validated, we provide this new interface, `TPKParser::unvalidated_tpk_filter`, which is similar to Rust's `Iterator::filter` method. Using a callback means that the user has to go out of their way to propagate the unvalidated TPK, which will hopefully prevents the unvalidated TPK from being used in a context where a validated TPK is required.
2018-06-27openpgp: Add some convenience constructors to TPKParser.Neal H. Walfield
2018-06-27openpgp: Make footer detection more robust.Justus Winter
- Also, make armor::Reader use a buffered reader. This allows us to peek into the buffer to find the footer, even if we didn't request enough data to see it. - Fixes #7.
2018-06-27openpgp: Tune TPK-abbreviation acrobatics.Justus Winter
- Previously, we joined two Strings. Now we just use the &'static str.