summaryrefslogtreecommitdiffstats
path: root/openpgp/src/serialize/stream.rs
AgeCommit message (Collapse)Author
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.
2020-01-06openpgp: Pass a timestamp to the KeyIter instead of each filter.Neal H. Walfield
- KeyIter::revoked and KeyIter::key_flags (and its variants) didn't take a time stamp so they could only be used for filtering keys based on their current state, not their state at some time in the past. Adding a time stamp to each of the filters would have fixed the problem, but it would have made the interface ugly: callers always want the same time stamp for all filters. - Split KeyIter into two structures: a KeyIter and a ValidKeyIter. - Add KeyIter::policy. It takes a time stamp, which is then used for filters like `alive` and `revoked`, and it returns a ValidKeyIter, which exposes filters that require a time stamp.
2019-12-20openpgp: Simplify key iteration interface.Neal H. Walfield
- Cert::keys_valid() is just a short-cut for Cert::keys_all().alive().revoked(false). - Remove Cert::keys_valid() and rename Cert::keys_all() to Cert::keys().
2019-12-19openpgp: Change KeyIter to return a struct instead of a tuple.Neal H. Walfield
- A tuple is just an unnamed, inflexible struct. Use a struct instead. - Fixes #400.
2019-12-19Don't use misleading `<&[T; N] as IntoIterator>::into_iter`Igor Matuszewski
See https://github.com/rust-lang/rust/pull/65819. Warned against by default since Rust 1.41. Right now `into_iter` returns references to objects inside an array rather than moving the values (as one would expect) so it makes sense to use `iter()` or for-in-borrowed (which calls the same thing) to retain the behaviour but make it less confusing.
2019-12-13openpgp: Likewise for MDC.Justus Winter
2019-12-05openpgp: Make crypto::{Signer,Decryptor} non-polymorphic.Justus Winter
- These are low-level cryptographic traits that are not concerned with the role of a key. - Fixes #382.
2019-12-04openpgp: Refine CertBuilder::add_encryption_subkey.Justus Winter
2019-12-04openpgp: Rename KeyFlag's accessors.Justus Winter
- Fixes #359.
2019-12-04openpgp: Rename KeyIter filters.Justus Winter
- See #359.
2019-12-03openpgp: Drop algorithm argument from signature::Builder::sign_hash.Justus Winter
- The hash context knows the algorithm.
2019-12-03openpgp: Make Literal::set_filename polymorphic over AsRef<[u8]>.Justus Winter
- And drop Literal::set_filename_from_bytes.
2019-12-03openpgp: Remove all calls to Time::canonicalize.Justus Winter
- Now that we store timestamps in OpenPGP's native encoding, the canonicalization happens when converting to it.
2019-12-03openpgp: Use Timestamp in packet::Literal.Justus Winter
2019-11-28Call TPKs Certificates, update identifiers, documentation.Justus Winter
- Fixes #387.
2019-11-27openpgp: Fix issuer handling in the streaming verifier.Justus Winter
- To that end, make VerificationHelper::get_public_keys take KeyHandles for all the issuers.
2019-11-27openpgp: Make variants of VerificationResult struct-like, add infos.Justus Winter
2019-11-25openpgp: Rename openpgp::constants to openpgp::types.Justus Winter
- Fixes #381.
2019-11-22openpgp: Make conversions into Key<SecretParts, _> fallible.Justus Winter
- Fixes #380.
2019-11-21openpgp: Replace time crate with std::time.Justus Winter
- In sq and sqv, use chrono to interface with the user. - Fixes #341.
2019-11-20openpgp: Use the builder pattern for stream::Encryptor.Justus Winter
- Fixes #375.
2019-11-19openpgp: Use the builder pattern for stream::Compressor.Justus Winter
- See #375.
2019-11-19openpgp: Use the builder pattern for stream::LiteralWriter.Justus Winter
- See #375.
2019-11-19openpgp: Use the builder pattern for stream::Signer.Justus Winter
- See #375.
2019-11-19openpgp: Avoid specializing Signer over key role.Justus Winter
2019-10-23openpgp: Use Vec::resize instead of a loop.Neal H. Walfield
- Instead of pushing an element at a time, use Vec::resize to grow the vector to the desired size.
2019-10-22openpgp: Fix AEAD encryption.Neal H. Walfield
- The AEAD implementation did not correctly handle messages where the last chunk was a bit smaller than the chunk size. Specifically, assume that the chunk size is 32 bytes and the digest size is 16 bytes, and consider a message with 17 bytes of data. That message will be encrypted as follows: [ chunk1 ][ tag1 ][ tagF ] 17B 16B 16B If we read a chunk and a digest, we'll successfully read 48 bytes of data. Unfortunately, we'll have over read: the last 15 bytes are from the final tag. To correctly handle this case, we have to make sure that there are at least a tag worth of bytes left over when we read a chunk and a tag. - Test encrypting and decrypting more message sizes using AEAD. - Also, check that the AEAD implementation correctly handles corruption (specifically, a corrupted final tag).
2019-10-22openpgp: Use a constant for the default AEAD chunk size.Neal H. Walfield
2019-10-11openpgp: Add a test demonstrating a bug related to AEAD.Justus Winter
2019-09-27linting: Clear up bare trait object warningsDaniel Silverstone
Newer Rust compilers requre `dyn` marking trait objects. Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>