summaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)Author
2019-01-17openpgp-ffi: New crate.Justus Winter
- 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.
2019-01-17ffi: Generalize c-tests for multiple include dirs.Justus Winter
2019-01-17ffi: Drop superfluous cleanup of sequoia.pc.Justus Winter
2019-01-17openpgp: add Signature::{sign,verify}_messageKai Michaelis
For the sake of symmetry and writing tests.
2019-01-17openpgp: allow checking if a sig is revoked at a specific time.Kai Michaelis
Adds an argument to *::revoked to give a timepoint. The function will then return the revokation status at this time instead of now.
2019-01-17ffi: Fix last commit.Justus Winter
- Fixes error handling in the Python bindings.
2019-01-17ffi: Do not use a context where an errp suffices.Justus Winter
- This prepares us for the FFI crate split. - Fixes #158.
2019-01-16ffi: Use the new set of macros.Justus Winter
- First, for the two existing functions with an error-pointer.
2019-01-16ffi: Add new error-pointer-based error handling.Justus Winter
- Express existing context-based error handling using the new set of macros.
2019-01-16ffi: Store raw pointers to errors in the Context.Justus Winter
2019-01-16ffi: Introduce setter for the error in the Context.Justus Winter
2019-01-16ffi-macros: Improve translation.Justus Winter
- Use the parenthesis token to preserve location information.
2019-01-16ffi: Rework complex error handling macros.Justus Winter
- 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.
2019-01-16ffi: Wrap every function using ffi_catch_abort.Justus Winter
- This prevents stack unwinding across the FFI boundary. - Fixes #161.
2019-01-16ffi-macros: New crate.Justus Winter
- This crate contains macros for Sequoia's FFI crate(s). Having it in a separate crate means that we can share it when we split the FFI crate into two. - More importantly, we need a separate crate if we want to create procedural macros. - As first macro, this patch adds ffi_catch_abort that wraps a function's body in a catch_unwind block, aborting on panics.
2019-01-15ffi: Allocate returned strings using libc.Justus Winter
- 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.
2019-01-15ffi: Introduce macro for *char parameters.Justus Winter
2019-01-15ffi: Move TSK glue to a new module.Justus Winter
2019-01-15openpgp: add a function to revoke a UserIDKai Michaelis
Adds UserIDBinding::revoke() and a test
2019-01-15tool: Drop unreachable code.Justus Winter
- AppSettings::ArgRequiredElseHelp makes sure this doesn't happen.
2019-01-15tool: Introduce key manipulation subcommand.Justus Winter
- And move the key generation subcommand there, calling it `generate`. - Fixes #163.
2019-01-15tool: Move key generation to a new module.Justus Winter
2019-01-15openpgp: Hand a Vec<crypto::Signer> to stream::Signer.Justus Winter
- Using `crypto::Signer`s has several benefits. First, it shifts the decision which key to use to the caller, moving policy out of the caller. Second, it forces the caller to deal with encrypted keys. Finally, it allows us to use remote keys like smart cards in the future. - Fixes #142.
2019-01-15openpgp: Add convenience selector.Justus Winter
2019-01-11ci: Work around Python test failures.Justus Winter
- When building the bindings first, testing them later, the tests fail most of the time. I have not found the reason yet. - Reverts 9549da4b2bfa29519bb453a1f4fdd9baa536b57b.
2019-01-11ffi: Do not hardcode CARGO_TARGET_DIR.Justus Winter
2019-01-11ci: Use valgrind to run our C tests.Justus Winter
2019-01-11ci: Build first, then test.Justus Winter
2019-01-11Add missing Python build dependencies.Justus Winter
2019-01-11openpgp: generate X25519 keys according to spec.Kai Michaelis
Previously we just used a random 32 byte value. Correct X25519 keys require bits 0 to 2 of the first byte and bit 7 of the last byte to be 0. Closes #162
2019-01-11ffi: Add preliminary Python bindings.Justus Winter
- The bingings support basic manipulation of OpenPGP data, but are quite incomplete. Furthermore, the Python API is not very pythonic in some places, so expect it to break in the future.
2019-01-10tool: Generate keys protected with a password.Justus Winter
2019-01-10openpgp: Implement creation of TSKs with encrypted keys.Justus Winter
2019-01-10openpgp: Use Signer when revoking TPKs.Justus Winter
2019-01-10ffi: New function sq_p_key_into_key_pair.Justus Winter
2019-01-10ffi: New module openpgp/crypto.Justus Winter
2019-01-10ffi: Use absolute path in macro.Justus Winter
2019-01-10ffi: Optionally use valgrind to check the c-tests.Justus Winter
2019-01-10ffi: Fix reason for revocation parameter handling.Justus Winter
- We must use &c_char here instead of *const c_char, because the former can not be NULL, hence Option<&c_char> gets NULLable-pointer-optimized (see https://doc.rust-lang.org/nomicon/ffi.html#the-nullable-pointer-optimization).
2019-01-10ffi: Fix memory leaks in C tests.Justus Winter
2019-01-10ffi: Fix detection of main functions in C tests.Justus Winter
2019-01-09ffi: Use Option<&mut T> for destructors.Justus Winter
- This reflects the fact that destructors may be called with NULL.
2019-01-09ffi: Use *const T for non-optional arguments.Justus Winter
- 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.
2019-01-09ffi: Use ffi_param_ref_mut for mutable arguments.Justus Winter
2019-01-09ffi: Only return raw pointers.Justus Winter
2019-01-09ffi: Fix conversion to ffi_param_ref.Justus Winter
2019-01-09ffi: Drop spurious identity cast.Justus Winter
2019-01-09ffi: Drop spurious forget.Justus Winter
- `tpk_refs_raw` is a `*mut _`, forgetting it is a nop.
2019-01-09ffi: Introduce macro for moving ownership from C.Justus Winter
2019-01-09ffi: Introduce macro for passing references from C.Justus Winter