summaryrefslogtreecommitdiffstats
path: root/ffi-macros
AgeCommit message (Collapse)Author
2021-12-10Remove the ffi crates.Justus Winter
- 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.
2021-11-29Prefer vec! macro.Nora Widdecke
- The vec![] macro is more performant and often easier to read than multiple push calls. - Allow push to a Vec straight after creation in tests. Performance is not that great of an issue in tests, and the fix would impact legibility. - Found by clippy::vec_init_then_push.
2021-10-18Relicense to LGPL 2.0 or later.Neal H. Walfield
- Change Sequoia's license from GPL 2.0 or later to LGPL 2.0 or later as unanimously decided on October 18, 2021 by: - Christof Wahl <cw@pep.security> (pEp security CEO) - Heiko Schaefer <heiko.schaefer@posteo.de> (pEp Foundation employee, Sequoia developer) - Justus Winter <justus@sequoia-pgp.org> (pEp Foundation employee, Sequoia Founder) - Neal H. Walfield <neal@pep.foundation> (pEp Foundation employee, Sequoia Founder) - Patrick Meier <pm@pep.security> (pEp security Chief Product and Service Officer) - Rudolf Bohli <rb@pep.security> (pEp security Chairman of the Board) - Volker Birk <vb@pep.security> (pEp security Founder, pEp Foundation Council)
2021-09-30Annotate functions where single_match is OKLars Wirzenius
See https://rust-lang.github.io/rust-clippy/master/index.html#single_match
2021-09-30Drop unnecessary &mut on a sliceLars Wirzenius
Reduce &mut foo[...].copy_from_slice(bar); to just foo[...].copy_from_slice(bar); since the &mut does nothing except obfuscate the code. Found by clippy lint unnecessary_operation: https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_operation
2021-09-30Use the now-idiomatic option? syntaxLars Wirzenius
This works in Rust now: foo?; as a replacement for: if foo.is_none() { return None; } It's similar to ? for error handling and can only be used in functions that return an Option. The instance of this in a macro caused the problem to be reported a lot of time, once per time the macro was used, but luckily it can could be fixed in only one place. Magic! Found by clippy lint question_mark: https://rust-lang.github.io/rust-clippy/master/index.html#question_mark
2021-09-23openpgp-ffi-macros: Avoid creating unused borrows.Nora Widdecke
2021-09-21Avoid matching on &Foo, when a plain Foo pattern worksLars Wirzenius
The extra & in a pattern (match arm or if let) is unnecessary and only makes the code harder to read. In most places it's enough to just remove the & from the pattern, but in a few places a dereference (*) needs to be added where the value captured in the pattern is used, as removing the & changes the type of the captured value to be a reference. Overall, the changes are almost mechanical. Although the diff is huge, it should be easy to read. The clippy lint match_ref_pats warns about this. See: https://rust-lang.github.io/rust-clippy/master/index.html#match_ref_pats
2021-08-27ffi, openpgp-ffi, ffi-macros: Correct links.Nora Widdecke
- Some link targets have moved or were replaced since the link's creation. Make them point to the new location or replacement.
2021-08-27Convert markdown to intra-doc links.Nora Widdecke
- Apply cargo intraconv.
2021-04-13bench: Disable libtest benchmark harness.Nora Widdecke
- The libtest benchmark harness that is automatically added by cargo interferes with criterion. Disable it everywhere where there are no benchmarks. - https://github.com/rust-lang/rust/issues/47241 - https://bheisler.github.io/criterion.rs/book/faq.html
2021-04-12Include LICENSE.txt in all published cratesFabio Valentini
Having the license file in the root directory is not enough, since cargo actions for workspace members will not consider this file. This commit adds a symbolic link to the license file in the root directory of all workspace members, so "cargo publish" will include the LICENSE.txt file when publishing crates.
2021-04-09Lint: Use char for single characters.Nora Widdecke
- https://rust-lang.github.io/rust-clippy/master/index.html#single_char_pattern - https://rust-lang.github.io/rust-clippy/master/index.html#single_char_add_str
2021-04-09Lint: Use get() instead of iter().next().Nora Widdecke
- https://rust-lang.github.io/rust-clippy/master/index.html#iter_next_slice
2021-04-09Lint: Remove unecessary imports.Nora Widdecke
- https://rust-lang.github.io/rust-clippy/master/index.html#single_component_path_imports
2021-04-09Lint: Use next instead of nth(0).Nora Widdecke
- https://rust-lang.github.io/rust-clippy/master/index.html#iter_nth_zero
2021-04-09Lint: Remove redundant lifetime.Nora Widdecke
- Constants have by default a `'static` lifetime - https://rust-lang.github.io/rust-clippy/master/index.html#redundant_static_lifetimes
2021-04-09Lint: Remove unnecessary conversions.Nora Widdecke
- https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion
2021-04-09Lint: Use lazy evaluation.Nora Widdecke
- https://rust-lang.github.io/rust-clippy/master/index.html#or_fun_call
2021-04-01Fix documentation links.Neal H. Walfield
2021-03-02ffi_macros: Fix import of ToTokens.Nora Widdecke
- The `syn` crate really does not want users to refer to their private re-exports (https://github.com/dtolnay/syn/commit/957840e, in 1.0.58). - Pull in `ToTokens` from its original source, `quote`. - Fixes building with `syn >= 1.0.58`.
2021-01-20Turn missing documentation into a warning in all crates.Justus Winter
2021-01-20Add branding to all crates.Justus Winter
2020-12-16Release 1.0.0.v1.0.0Justus Winter
- Release buffered-reader 1.0.0, sequoia-openpgp 1.0.0, and sequoia-sqv 1.0.0. - Also release sequoia-sop 0.22.0.
2020-12-11Release 0.21.0.v0.21.0Justus Winter
2020-12-11Correct minimal versions.Nora Widdecke
- Versions required by feature or API usage: - anyhow 1.0.18. - policy::test::reject_seip_packet and policy::test::reject_cipher' fail - We use `impl From<anyhow::Error> for Box<dyn std::error::Error + Send + Sync + 'static>`, introduced in 1.0.5. - tokio 0.2.19 - We use `tokio::net::tcp::OwnedReadHalf`, introduced in 0.2.19. - chrono 0.4.10 - We use the `std` feature, introduced in 0.4.10. - thiserror 1.0.2 - futures and futures-util 0.3.5 - tempfile 3.1 - c_doctests require the same version of rand both as direct dependency and through tempfile. - Yanked versions: - structopt 0.3.11. 0.3.8 to 0.3.10 were yanked. - socket2 0.3.16. 0.3.0 to 0.3.15 were yanked. - Update our dependencies to the package versions required by other dependencies, e.g. structopt requires lazy_static 1.4.0. - clap 2.33 - lazy_static to 1.4.0 - libc to 0.2.66 - proc-macro2 to 1.0.7 - syn to 1.0.5. - winapi 0.3.8
2020-10-14Release 0.20.0.v0.20.0Justus Winter
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-08-21Release 0.19.0.v0.19.0Justus Winter
2020-07-31Release 0.18.0.v0.18.0Justus Winter
2020-06-12Release 0.17.0.v0.17.0Justus Winter
2020-04-03Release 0.16.0.v0.16.0Justus Winter
2020-04-02ffi-macros: Increase the length of acceptable C type names.Neal H. Walfield
- This is needed to deal with pgp_cert_valid_user_id_amalgamation_t, for instance.
2020-04-02ffi-macros: Handle some special cases in ident2c.Neal H. Walfield
- Interpret sequences of capital letters as a single word. For instance, `UserID` should map to `user_id`. - Special case `ID` by converting it to `Id` so that `UserIDAmalgamation` maps to `user_id_amalgamation`.
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-04Release 0.15.0.v0.15.0Justus Winter
2020-02-07Release 0.14.0.v0.14.0Justus Winter
2020-02-06openpgp: Rename ComponentBinding to ComponentBundle, etc.Justus Winter
- Likewise KeyBinding, UserIDBinding, UserAttributeBinding, UnknownBinding, etc. - Reason: a self-signature on a component is a binding, but revocations and TPSes are not bindings. - Consistently call collections of components and associated signatures bundles now. Likewise for fields, methods. - Fixes #425.
2019-12-20Release 0.13.0.v0.13.0Justus Winter
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-11-28Call TPKs Certificates, update identifiers, documentation.Justus Winter
- Fixes #387.
2019-11-25Release 0.12.0.v0.12.0Justus Winter
2019-10-31Change license to GPLv2+.Neal H. Walfield
2019-10-30Update authors.Neal H. Walfield
2019-10-25Release 0.11.0.v0.11.0Justus Winter
2019-09-06Release 0.10.0.v0.10.0Justus Winter
2019-08-22Bump syn, quote, and proc-macro2 to 1.0.Justus Winter
2019-08-19ffi-macros: Handle type c_void.Justus Winter
- Fixes #325.
2019-07-15Switch to Rust 2018.Justus Winter