summaryrefslogtreecommitdiffstats
path: root/net/src/lib.rs
AgeCommit message (Collapse)Author
2020-10-23update net to futures=0.2amesgen
2020-10-14Use 'Examples' for the examples section.Justus Winter
- See #480.
2020-10-14Replace most 'extern crate' directives with 'use'.Justus Winter
- See #480.
2020-04-20openpgp: Add armor::Writer::with_headers.Justus Winter
- Add a new constructor that takes headers. This allows us to make the header argument polymorphic.
2020-04-02openpgp: Drop KeyID::from_hex in favor of FromStr.Justus Winter
- See #462.
2020-03-26Remove redundant field names.Wiktor Kwapisiewicz
2020-03-20openpgp: Remove `to_hex` in KeyHandle, KeyID and Fingerprint.Wiktor Kwapisiewicz
- Replace all usages of `to_hex` with formatting string with :X specifier. - Fixes #456.
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-03-09net: Define net::Error using thiserror.Justus Winter
2020-02-05openpgp: Improve use of armor writer in tests and examples.Justus Winter
2020-01-23net: Avoid unnecessary indirection.Neal H. Walfield
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-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-20net: Use openpgp crypto API for SHA1 hashIgor Matuszewski
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-11-28Call TPKs Certificates, update identifiers, documentation.Justus Winter
- Fixes #387.
2019-11-26openpgp: Implement From<Fingerprint> for KeyID.Justus Winter
- Remove Fingerprint::to_keyid, use From instead.
2019-11-15net: Bail out if the received keyid does not match.Tobias Mueller
- Arguably, the user wanted to fetch a key with a certain ID. If the server returns something different, we throw an error. That error contains both the expected keyid as well as the TPK from the server, in case the consumer wants to inspect the problem or make use of the key regardless.
2019-10-25rfc2822,openpgp: Move rfc2822 crate to be a private mod in openpgpNeal H. Walfield
- The rfc2822 crate doesn't implement all of RFC 2822. Moreover, it includes a number of extensions. This makes rfc2822 a misnomer. - RFC 2822 is actually obsoleted by RFC 5322. This means that if we ever add support for RFC 5322, it will be an even worse misnomer. - Move the whole crate into the openpgp crate. Note: we don't directly export the API; it is only used internally by packet::userid. - Closes #279.
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-08-22Bump percent-encoding to 2.1.Justus Winter
2019-08-20net: Drop SKS pool in favor of keys.openpgp.org.Justus Winter
2019-08-19net: Drop the sync variant.Justus Winter
- The sync wrapper hide the async nature of the implementation, and while this may seem convenient, it may cause subtle problems if it is invoked from a different event loop. - Furthermore, 'async' is a reserved keyword in the 2018 edition, requiring awkward escaping. - Fixes #307.
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-10net: Drop unused parameter.Justus Winter
2019-05-28net: Add wkd module implementing a WKD clientjuga
- Also add an async::wkd module. - Part of #251.
2019-05-15core, store, tool: Use realm instead of domain.Justus Winter
- Remove the domain parameter from core::Context. - Replace it with a realm to be passed in when opening a store. - For sq, merge store name and realm into the --store parameter. - Fixes #105.
2019-05-03ipc: New crate.Justus Winter
2019-02-27net: If no protocol is given, assume hkps.Justus Winter
- Also, add a test. - Fixes #201.
2019-02-27net: Typo.Justus Winter
2019-02-07net: Make Error::MalformedUri print expected protocol prefixes.Tobias Mueller
- This makes the error message more helpful, e.g. for users of "sq keyserver --server ...".
2018-11-24Rename the openpgp crate to sequoia-openpgp.Justus Winter
2018-10-17net: Compare cookies in constant time.Justus Winter
2018-06-20Warn about public functions without documentation, add missing docs.Justus Winter
2018-06-05net: Bump hyper to "0.12", hyper-tls to "0.2".Justus Winter
2018-03-23openpgp: Move the TPK type definition to openpgp proper.Justus Winter
- We define all types in the root of the openpgp crate, and their implementations in separate modules. This makes using these types much simpler, yet keeps the root from getting too crowded. - Also fix all users accordingly.
2018-03-04net: Use the url crate for URL manipulation.Justus Winter
- The url crate is more expressive than hyper::Uri and among other things features a 'join' operation. - This fixes malformed URLs being created by the net module where we naively using string operations instead of the proper join operation.
2018-02-16net: Add an asynchronous interface.Justus Winter
2018-01-23Use the failure crate to handle errors.Justus Winter
- The failure crate is a young error handling solution for Rust. It may change the API, but since we pin our dependencies, this should not be a problem for us, albeit a bit inconvenient. - Introduction of the crate is a bit noisy, but not as bad as anticipated, because failure magically handles all errors used in the standard library. - Matching on concrete error values requires downcasting before matching, which seems a bit unidiomatic. This is the cost of using and "chaining" arbitrary error types. This is something that may be improved later on in the library or language. - Having said that, using the error type in the tool was nice. I did not have to use a downcast, so maybe my worries about downcasts are unjustified because it is not such a common use case after all. On the other hand, the tool is quite simple and our only mode of failure is to print the message.
2018-01-15ffi,net: Update last users of KeyId to use KeyID.Justus Winter
2018-01-14openpgp: Remove the openpgp/types moduleNeal H. Walfield
- It only contains a KeyId type which is redundant relative to KeyID and it is buggy (e.g., when it converts a Key ID to hex, it drops any leading zeros). - Update users to use KeyID instead.
2018-01-08net: Add a module for IPC support.Justus Winter
2018-01-04net: Fix sending keys to servers.Justus Winter
- Now that TPKs can be serialized, KeyServer::send can get actual TPKs to send.
2018-01-03core,net: Avoid 'unwrap()' in examples.Justus Winter
- We should not even suggest to use unwrap in our examples.
2017-12-19Make the Result types public.Justus Winter
2017-12-14Add network policy.Justus Winter
- The network policy determines how Sequoia connects to remote servers. - Add a policy field in the context. - Add an error indicating a policy violation. - Honor the policy in the net module. - Add ffi glue.
2017-12-13Split up Sequoia.Justus Winter
- Split up into six crates: buffered-reader, openpgp, sequoia-core, sequoia-ffi, sequoia-net, and sequoia-store. - Adjust imports accordingly.