summaryrefslogtreecommitdiffstats
path: root/openpgp/src/serialize/stream.rs
AgeCommit message (Collapse)Author
2020-05-13openpgp: Avoid constructing vectors of recipients.Justus Winter
- Every iterator implements IntoIterator. Simplify accordingly.
2020-05-13openpgp: Make Encryptor::with_passwords polymorphic.Justus Winter
2020-05-13openpgp: Make Encryptor::for_recipients polymorphic.Justus Winter
2020-05-13openpgp: Unawkwardify Encryptor::add_recipient.Justus Winter
2020-05-13openpgp: Unawkwardify Encryptor::add_password.Justus Winter
2020-05-07openpgp: Use a builder to construct Decryptor.Justus Winter
- See #498.
2020-05-07openpgp: Use a builder to construct Verifier.Justus Winter
- See #498.
2020-05-07openpgp: Use a builder to construct DetachedVerifier.Justus Winter
- See #498.
2020-04-21openpgp: Rename signature::Builder to signature::SignatureBuilder.Wiktor Kwapisiewicz
- Rename all calls to `Builder` with `SignatureBuilder`. - Fixes #481.
2020-04-21openpgp: Improve docs.Justus Winter
- We finalize the writer stack at the end of the streaming operation, but we build the filters using the builder pattern.
2020-04-21openpgp: Add Signer::with_template that takes a signature::Builder.Justus Winter
- This allows customization of the generated signatures.
2020-04-21openpgp: Add a filter applying ASCII Armor to the streaming stack.Justus Winter
- Previously, when creating an armored message using the armor::Writer and the streaming serialization interface, one had to finalize both the writer stack and the armor writer, which is unergonomic, not obvious, and error prone. - This filter properly finalizes the armor writer when the writer stack is finalized. - Fixes #453.
2020-04-20openpgp: Fix documentation.Justus Winter
2020-04-20openpgp: Don't finalize the Signer in Drop.Justus Winter
- Previously, Signer::drop made an effort to finalize the filter. This, however, is only a best-effort mechanism: It cannot report errors. - Because of this, we now believe that it actually exacerbates the problem of downstream users not finalizing the filter: It will work most of the time, but sometimes fail.
2020-04-20openpgp: Don't finalize the Encryptor in Drop.Justus Winter
- Previously, Encryptor::drop made an effort to finalize the filter. This, however, is only a best-effort mechanism: It cannot report errors. - Because of this, we now believe that it actually exacerbates the problem of downstream users not finalizing the filter: It will work most of the time, but sometimes fail.
2020-04-20openpgp: Don't finalize the PartialBodyFilter in Drop.Justus Winter
- Previously, PartialBodyFilter::drop made an effort to finalize the filter. This, however, is only a best-effort mechanism: It cannot report errors. - Because of this, we now believe that it actually exacerbates the problem of downstream users not finalizing the filter: It will work most of the time, but sometimes fail. - Drop the implementation of Drop. Fix all the problematic test cases.
2020-04-16Revert "openpgp: Make PacketParserResult a std::result::Result."Justus Winter
This reverts commit 2e1eec5fe4157a391a13554ff7df3075cfe043cc.
2020-04-09openpgp: Make PacketParserResult a std::result::Result.Justus Winter
- This avoids the partial implementation imitating std::option::Option, replacing it with std::result::Result. - As a benefit, std::result::Result is in the prelude, simplifying a lot of parsing loops.
2020-04-08openpgp: Change key's role function names.Wiktor Kwapisiewicz
- Change `mark_role_primary` to `role_into_primary`. - Change `mark_role_primary_ref` to `role_as_primary`. - Change `mark_role_subordinate` to `role_into_subordinate`. - Change `mark_role_subordinate_ref` to `role_as_subordinate`. - Change `mark_role_unspecified` to `role_into_unspecified`. - Change `mark_role_unspecified_ref` to `role_as_unspecified`. - Fixes #452.
2020-04-08openpgp: Specialize stream::Message, make Cookie private.Justus Winter
- Previously, Message was polymorphic over the cookie. However, the writer stack framework only has one user, and it likely ever will, so I don't really see the point in complicating our interface.
2020-04-08openpgp: Rename Encryptor::sym_algo to symmetric_algo.Justus Winter
- This aligns it with AED::symmetric_algo and SKESK::symmetric_algo.
2020-04-07openpgp: Improve documentation for the serialize module.Justus Winter
- Fixes #472.
2020-04-06openpgp: Rename VerificationHelper::get_public_keys to get_certs.Justus Winter
2020-04-06openpgp: Make Signer::creation_time polymorphic.Justus Winter
2020-04-03openpgp: Unawkwardify the streaming encryptor.Justus Winter
2020-04-03openpgp: Make LiteralWriter::date polymorphic.Justus Winter
2020-04-03openpgp: Rename.Justus Winter
2020-04-03Change function names to align to Rust naming conventions.Wiktor Kwapisiewicz
- Change `mark_parts_public` to `parts_into_public`, - Change `mark_parts_public_ref` to `parts_as_public`, - Change `mark_parts_secret` to `parts_into_secret`, - Change `mark_parts_secret_ref` to `parts_as_secret`, - Change `mark_parts_unspecified` to `parts_into_unspecified`, - Change `mark_parts_unspecified_ref` to `parts_as_unspecified`, - Fixes #452.
2020-04-03openpgp: Unify Message and writer::Stack, hide writers.Justus Winter
- Previously, Message::new returned a writer::Stack, and Message was just an empty struct. Unify the types. This makes sense, because if you have a message, and encrypt it, you get a message. - Make the writer module private. This is an implementation detail.
2020-04-03openpgp: Rename.Justus Winter
2020-04-02openpgp: Move the writer module to serialize::stream.Justus Winter
2020-04-02openpgp: Move the padding module to serialize::stream.Justus Winter
2020-03-26Remove redundant field names.Wiktor Kwapisiewicz
2020-03-25openpgp: Improve performance of detached signature verification.Justus Winter
- Previously, we transformed data and detached signatures into signed messages on the fly, then used the streaming Verifier to verify the message. However, this introduces a nontrivial overhead, even if unnecessary copies are carefully avoided. - Instead, specialize the streaming Decryptor to handle detached signatures. use crypto::hash_buffered_reader to compute the hashes over the data, then attach the computed signatures to the signature packets, and use Decryptor's verification machinery. - While this is arguably less elegant, it is much simpler, and a lot faster. Notably, if we operate on files and can mmap them into memory, we can compute the hash in one call to the compression function. Verification of detached signatures is an important use case, so this speedup outweighs the loss of elegance. - Fixes #457.
2020-03-18openpgp: Fix documentation.Justus Winter
2020-03-03openpgp: Only impl Serialize for objects that are normally exported.Neal H. Walfield
- Add two new traits: `Marshal` and `MarshalInto`. - Implement them instead of `Serialize` and `SerializeInto`. - Only implement `Serialize` and `SerializeInto` for data structures that are normally exported. - This should prevent users from accidentally serializing a bare signature (`Signature`) when they meant to serialize a signature packet (`Packet`), for instance. - Fixes #368.
2020-03-03openpgp: Mark experimental features.Justus Winter
- Fixes #446.
2020-02-26openpgp: Add a prelude file to import things related to certificatesNeal H. Walfield
- Add `openpgp/src/cert/prelude.rs` to import most types and traits related to certificates. - Use it instead of using the types and traits individually.
2020-02-19openpgp: Split VerificationResult.Justus Winter
- Split VerificationResult into Result<GoodChecksum, VerificationError>. - Fixes #416.
2020-02-17openpgp: Make Recipient::new polymorphic over key variants.Justus Winter
2020-02-12openpgp: Add optional cipher argument to DecryptionHelper::decrypt.Justus Winter
2020-02-12openpgp: Add optional cipher argument to PKESK3::decrypt.Justus Winter
2020-02-06openpgp: Rename methods 'set_policy' to 'with_policy'.Justus Winter
- Fixes #427.
2020-01-31openpgp: Add a policy object.Neal H. Walfield
- Change all functions that need to evaluate the validity of a signature (either directly or indirectly to take a policy object. - Use the policy object to allow the user to place additional constraints on a signature's validity. - This addresses the first half of #274 (it introduces the policy object, but does not yet implement any policy).
2020-01-24openpgp: Improve test.Justus Winter
- Use the frozen time as policy. Simplify writer stack finalization.
2020-01-17openpgp: Allow the caller to determine a signature's creation time.Neal H. Walfield
- Add Signer::creation_time so that a user of a Signer object can determine the signature's creation time.
2020-01-16openpgp: Return Result<()> from Signature::verify*.Justus Winter
2020-01-16openpgp: Improve example.Neal H. Walfield
2020-01-10openpgp: Pass MessageStructure by value, not reference.Neal H. Walfield
- Instead of passing MessageStructure to VerificationHelper::check by reference, pass it by value. - After calling VerificationHelper::check, it is dropped. Passing it by value allows the caller to avoid some cloning.
2020-01-06openpgp: Use KeyAmalgamation::for_xxx instead of building a KeyFlagsNeal H. Walfield
- Use the convenient functions KeyAmalgamation::for_storage_encryption, KeyAmalgamation::for_transport_encryption, etc., instead of building up a KeyFlags and then calling KeyAmalgamation::key_flags. - This pattern requires less boilerplate.