summaryrefslogtreecommitdiffstats
path: root/openpgp-ffi/src/serialize.rs
AgeCommit message (Collapse)Author
2020-10-14Replace most 'extern crate' directives with 'use'.Justus Winter
- See #480.
2020-10-09openpgp: Make Recipient::set_keyid easier to use.Justus Winter
2020-09-22openpgp: Hide stream::Encryptor::aead_algo from public API.Wiktor Kwapisiewicz
- Mark `aead_algo` as available only during tests, - Remove support for AEAD from `sop`, - Mark `aead` parameter in FFI as unused, - openpgp-ffi: Drop `aead_algo` argument from `pgp_encryptor_new`, - Fixes #550.
2020-05-13openpgp: Unawkwardify Encryptor::add_password.Justus Winter
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-03openpgp: Unawkwardify the streaming encryptor.Justus Winter
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 KeyIter to KeyAmalgamationIterNeal H. Walfield
- Rename `KeyIter` to `KeyAmalgamationIter`, `ValidKeyIter` to `ValidKeyAmalgamationIter`. - Rename `cert/keyiter.rs` to `cert/amalgamation/iter.rs`.
2020-04-02openpgp: Move the writer module to serialize::stream.Justus Winter
2020-03-13openpgp: Change pgp_writer_stack_message to take a reference.Neal H. Walfield
- pgp_writer_stack_message should take a reference to the writer and not take ownership of the writer. - This is essential for the armor writer, which needs to be explicitly finalized.
2020-03-11openpgp-ffi: Avoid undefined behavior.Justus Winter
- Dropping a zeroed instant of that type is not safe as it contains references.
2020-03-09Switch from failure to anyhow.Justus Winter
- Use the anyhow crate instead of failure to implement the dynamic side of our error handling. anyhow::Error derefs to dyn std::error::Error, allowing better interoperability with other stdlib-based error handling libraries. - Fixes #444.
2020-02-17openpgp: Make Recipient::new polymorphic over key variants.Justus Winter
2020-01-21openpgp: Change KeyIter to return KeyAmalgamations.Neal H. Walfield
- Change KeyIter to return KeyAmalgamations instead of Keys. - Given a `KeyAmalgamation`, it is possible to turn it into a `ValidKeyAmalgamation`. This is not possible with a `Key`. - With a `KeyAmalgamation`, it is still possible to query things about the certificate.
2020-01-07Fix broken links in the documentation.Justus Winter
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-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-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-11-28Call TPKs Certificates, update identifiers, documentation.Justus Winter
- Fixes #387.
2019-11-25openpgp: Rename openpgp::constants to openpgp::types.Justus Winter
- Fixes #381.
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::LiteralWriter.Justus Winter
- See #375.
2019-11-19openpgp: Use the builder pattern for stream::Signer.Justus Winter
- See #375.
2019-10-27Fix more spelling errors caught by codespellDaniel Kahn Gillmor
Signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
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>
2019-09-10openpgp: Make password argument polymorphic.Justus Winter
2019-09-10openpgp: Make 'LiteralWriter::new's arguments optional.Justus Winter
2019-09-06openpgp: Rework streaming encryptor.Justus Winter
- Instead of giving a set of TPKs to the encryptor, hand in a set of recipients, which are (keyid, key)-tuples, conveniently created from key queries over TPKs. This simplifies the encryptor, and makes the key selection explicit. - Drop the EncryptionMode type. - As a nice side effect, we can now generate encrypted messages with wildcard recipient addresses.
2019-08-23openpgp: Use marker types to denote a Key's type.Neal H. Walfield
- In addition to providing some added protection, this allows us to implement 'From<Key<_, _>> for Packet'.
2019-08-20openpgp: Make choice of AEAD algorithm explicit.Justus Winter
- Automatically using AEAD if all recipients claim support is a policy decision, which we'd rather avoid in the openpgp crate. - Fixes #293.
2019-07-15Prepare for Rust 2018.Justus Winter
- This is the result of running `cargo fix --edition`, with some manual adjustments. - The vast majority of changes merely qualify module paths with 'crate::'. - Two instances of adding an anonymous pattern to a trait's function. - `async` is a keyword in Rust 2018, and hence it needs to be escaped (e.g. in the case of the net::r#async module). - The manual adjustments were needed due to various shortcomings of the analysis employed by `cargo fix`, e.g. unexpanded macros, procedural macros, lalrpop grammars.
2019-06-26openpgp-ffi, ffi, ffi-macros: Avoid deprecated integer types.Justus Winter
2019-05-07openpgp-ffi, ffi: Fix calling convention on Windows.Justus Winter
- Use `extern "C"` instead of `extern "system"`. The latter selects stdcall, which is only appropriate for talking to the Windows API.
2019-03-21openpgp-ffi: Allow passing 0 to select the default algorithmNeal H. Walfield
- 01db33b and 97cdc30 changed the Encryption::new and Signer::new APIs to optionally provide the algorithm to use for encryption and hashing. Also make it optional in the C API by recognizing 0 as meaning the default algorithm.
2019-03-18openpgp: Make cipher algorithm configurable in streaming Encryptor.Justus Winter
- Fixes #208.
2019-03-18openpgp: Make hash algorithm configurable in streaming Signer.Justus Winter
- See #208.
2019-03-11openpgp-ffi: Unwrap array of wrapped TPKs.Neal H. Walfield
2019-02-05openpgp-ffi: Convert pgp_writer_t.Justus Winter
2019-02-05openpgp-ffi: Use a common macro for every exported function.Justus Winter
- This way we can easily introduce new transformations.
2019-01-29openpgp-ffi: Convert Error.Justus Winter
2019-01-29openpgp-ffi: Explicitly convert to failure::Error.Justus Winter
2019-01-29openpgp-ffi: Fix TPK handling.Justus Winter
- Fixes 9d6e628d6a183b483bdf115993d0a5a377c3d823.
2019-01-18openpgp: Move serializing glue to a new module.Justus Winter