Age | Commit message (Collapse) | Author |
|
- Remove the general-purpose ffi crates. They will be moved into
their own repository. Note that we consider general-purpose ffi
crates to be a dead end: exposing Sequoia's interface requires a
large number of types and functions, and using the interface from
C turned out to be verbose and error-prone. Instead, we prefer to
write point solutions in Rust that implement exactly the
functionality the downstream consumer needs, then expose this via
ffi bindings.
- See https://gitlab.com/sequoia-pgp/sequoia-ffi.
|
|
- Use range syntac instad of manual comparisons. This is arguably
better to read.
- Found by clippy::manual_range_contains.
|
|
When creating a struct with a field foo, using a variable also named
foo, it's not necessary to name the field explicitly. Thus, instead
of:
Self { foo: foo }
use this:
Self { foo }
The shorter form is more idiomatic and thus less confusing to
experienced Rust programmers.
This was found by the clippy lint redundant_field_names:
https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names
Sponsored-by: author
|
|
|
|
- https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure
|
|
- This moves all functionality from sequoia_core crate as an inner
`core` module of the ipc crate.
- The `core` module has to be public as other crates depend on
`core::Context` either directly (store, ffi) or indirectly (store
through ffi crate).
- Remove the `core` crate completely.
|
|
- When dropping the Context, free the error pointer, too.
- Add test that would have allowed valgrind to find the issue.
- Fixes #671
|
|
- Move core::NetworkPolicy to net::Policy, update all code
accordingly.
|
|
- See #480.
|
|
- 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.
|
|
|
|
- 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.
|
|
- Use `extern "C"` instead of `extern "system"`. The latter selects
stdcall, which is only appropriate for talking to the Windows API.
|
|
- Fixes #147.
|
|
|
|
- This creates a new crate, 'sequoia-openpgp-ffi', and moves a
handful of functions from 'sequoia-ffi' to it.
- The 'sequoia-ffi' crate is a superset of the 'sequoia-openpgp-ffi'
crate. This is accomplished by some include! magic.
- My first attempt involved having 'sequoia-ffi' depend on
'sequoia-openpgp-ffi', so that the former just re-exports the
symbols. However, that turned out to be unreliable, and might be
not what we want, because it could also duplicate parts of Rust's
standard library.
- Fixes #144.
|
|
- This prepares us for the FFI crate split.
- Fixes #158.
|
|
- First, for the two existing functions with an error-pointer.
|
|
- Express existing context-based error handling using the new set of
macros.
|
|
|
|
|
|
- Introduce a macro that emits local macros that implicitly use the
given context to store complex errors.
- This prepares us to decouple error handling from contexts, at
least for the functions that otherwise do not use the context.
|
|
- This prevents stack unwinding across the FFI boundary.
- Fixes #161.
|
|
- Allocate all returned strings using libc's allocator. This has
the advantage that the user can easily use strings and free them
using free(3).
- Fixes #157.
|
|
|
|
|
|
- This reflects the fact that destructors may be called with NULL.
|
|
- Previously, Option<&T> was used, primarily because it was more
ergonomic in Rust. However, this gave the impression that the
argument was optional.
- Likewise for mutable references.
- This patch addresses all pointers to Rust values.
- See #149.
|
|
|
|
|
|
|
|
|
|
|
|
- Wrap code in a main function if none exists.
- Derive names for tests not bound to a function.
- Honor no-run and ignore.
- Fix all examples that are now tests.
|
|
|
|
|
|
|
|
- Usually, we report complex errors by attaching them to the ffi
context. However, when we create the contexts, there is no
context to attach the error to. Therefore, we add an explicit
error argument here.
|
|
- Add a status code representing errors.
- Hand out errors as opaque objects. These objects can then be
queried for the numeric status code, and a string representation.
|
|
- There is no need to box failure::Error, which is in fact a struct
and not a trait.
|
|
- Add support for generic readers (i.e. implementations of
std::io::Read) and writers.
- Implemented constructors allow creating both readers and writers
by opening a file, using an existing file descriptor, or by
backing it with a provided buffer.
|
|
|
|
- Also add the missing prototypes for getting and setting the IPC
policy.
|
|
|
|
- Organize the ffi module the way Sequoia is organized.
- Add more examples.
|