summaryrefslogtreecommitdiffstats
path: root/openpgp-ffi
AgeCommit message (Collapse)Author
2019-02-12openpgp-ffi: Drop empty file.Justus Winter
2019-02-12openpgp: Use a Signer to set the expiry.Justus Winter
2019-02-12openpgp: Drop superfluous function.Justus Winter
2019-02-07openpgp-ffi: Add example.Justus Winter
2019-02-06openpgp: New error for unsupported packet types.Justus Winter
2019-02-06openpgp: Rename consuming conversion functions.Justus Winter
- Rename functions that consume their receiver but are called .to_...() to .into_...(). - For the packet types, simply drop the conversion function in favor of using the From trait. - Fixes #160.
2019-02-05openpgp-ffi: Convert pgp_writer_t.Justus Winter
2019-02-05ffi-macros: Do not pull traits into the namespace.Justus Winter
- Previously, it was impossible to use the ffi_wrapper_type macro twice in the same module because importing a trait twice introduces a conflict.
2019-02-05openpgp-ffi: Convert pgp_reader_t to the new framework.Justus Winter
2019-02-05ffi-macros: Make trait RefMutRaw more flexible.Justus Winter
2019-02-05openpgp-ffi: Fix pgp_armor_header_t.Justus Winter
- Turn it into a pointer type aligning it with the other type definitions.
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: Improve the derived serialization function.Justus Winter
- Using absolute paths allows us to use types without having the user to 'use' them.
2019-01-29openpgp-ffi: Derive Parse.Justus Winter
2019-01-29openpgp-ffi: Derive Serialize.Justus Winter
2019-01-29openpgp-ffi: Add a Fallible<()> to Status conversion.Justus Winter
2019-01-29openpgp-ffi: Use generated to_string() function.Justus Winter
2019-01-29openpgp-ffi: Fix PacketPile handling.Justus Winter
2019-01-29openpgp-ffi: Deduplicate code.Justus Winter
- This also checks for internal nul bytes.
2019-01-29openpgp-ffi: Convert Error.Justus Winter
2019-01-29openpgp-ffi: Explicitly convert to failure::Error.Justus Winter
2019-01-29openpgp-ffi: Add missing declaration.Justus Winter
2019-01-29openpgp-ffi: Check for missing declarations.Justus Winter
2019-01-29openpgp-ffi: Convert TSK.Justus Winter
2019-01-29openpgp-ffi: Fix TPK handling.Justus Winter
- Fixes 9d6e628d6a183b483bdf115993d0a5a377c3d823.
2019-01-29openpgp-ffi: Build examples below CARGO_TARGET_DIR.Justus Winter
- Addresses #172.
2019-01-29openpgp-ffi: Copy edit documentation.Neal H. Walfield
2019-01-29ffi,openpgp-ffi: Install .pc files in target directory.Neal H. Walfield
- Install the .pc files in the target directory when building so that it is easier to link against built, but uninstalled libraries. - 177835be9dba392ab10994254b67aa676be66331 accidentally removed this functionality for debug builds. Restore it, and also add it for release builds. - Avoid code duplication by using a macro.
2019-01-29openpgp: TPKBuilder::autocrypt should not default to an empty UIDNeal H. Walfield
- TPKBuilder::autocrypt created a TPK with a single User ID, as required by the Autocrypt specification. Since no User ID was passed, it used the empty string. - An empty User ID is a bit surprising, and it is unclear if it is even a reasonable default (GnuPG rejects it). But, even if the programmer is aware of this, adding a new user ID does not replace the empty User ID, and removing the empty User ID is a pain. - Change the API to better match typical usage: have the constructor take the User ID. - Nevertheless, preserve the flexibility by making the User ID optional to allow the caller to add a User ID later. In this case, a non-autocrypt compliant TPK with no User ID is created instead of an empty User ID. - Closes #146.
2019-01-29openpgp: Change TPKBuilder::add_userid to take an Into<Cow>>.Neal H. Walfield
- Change TPKBuilder::add_userid to take an Into<Cow<'a, str>>> instead of a &str.
2019-01-28openpgp-ffi: Rust bool -> C bool, not int.Neal H. Walfield
- A Rust boolean maps to a C _Bool, not a C int. - Note: this mapping has recently been formalized. See, for instance, https://github.com/rust-lang/rust/pull/46176 .
2019-01-25ffi-macros: Protect against use-after-free.Justus Winter
- When we transfer ownership from C to Rust, we move the wrapped object out of the wrapper, and poison the wrapper. - This prevents reuse of the wrapper object. When a stale reference is given to us, we check the tag encoding the type information. - If the tag field is poisoned, we can produce a more helpful error message. This is not exact, of course. As soon as the memory is reused, our tag is overwritten.
2019-01-25ffi-macros: Check wrapper types at runtime.Justus Winter
- This change adds a tag to the derived wrapper types that identify the type of the wrapped value. - At runtime, we can verify that references to wrapper objects indeed carry the right tag. - Fixes #166.
2019-01-25openpgp-ffi: Use wrapper types.Justus Winter
- With the abstractions for moving ownership and references across the FFI boundary, we can now switch to actually using the wrapper types by changing the function signatures to use the wrapper type, and updating the generated functions.
2019-01-25openpgp-ffi: Convert TPK.Justus Winter
2019-01-25openpgp-ffi: Convert PacketPile.Justus Winter
2019-01-25openpgp-ffi: Convert Fingerprint.Justus Winter
2019-01-25openpgp-ffi: Convert KeyID.Justus Winter
2019-01-25openpgp-ffi: Derive conversion functions.Justus Winter
- This is a framework for dealing with ownership and references at the FFI boundary. Previously, we used macros to do that. This change introduces a more idiomatic interface, we use traits converting from raw pointers of a wrapper type to objects, references, or mutable references to a wrapped type. - For now, we use the wrapped type as wrapper type. We merely introduce a new mechanism replacing the macro-based one. - This patch also converts all the derived functions. - The following patches will convert all the functions that are already using the ffi_wrapper_type. Once this conversion is done, we can introduce our own wrapper type.
2019-01-25openpgp-ffi: Improve error handling.Justus Winter
- In case of errors, set *tpk_out to None.
2019-01-23openpgp-ffi: Add test.Justus Winter
2019-01-23openpgp-ffi: Paper over the shady parsing in c-tests.Justus Winter
- Fixes tests not being found because the functions signature were formatted differently. In the end, only proper parsing will help here.
2019-01-23openpgp-ffi: Remove pgp_tpk_dump.Justus Winter
- This function was used early on to demonstrate the FFI layer. It can now be expressed using pgp_tpk_debug().
2019-01-23openpgp-ffi: Wrap TPK.Justus Winter
2019-01-22openpgp-ffi: Wrap KeyID.Justus Winter
2019-01-22openpgp-ffi: Wrap PacketPile.Justus Winter
2019-01-22openpgp-ffi: Wrap Fingerprint.Justus Winter
2019-01-22openpgp-ffi: Qualify KeyID.Justus Winter
2019-01-22openpgp-ffi: Cleanup paths in macros.Justus Winter
2019-01-21Distribute highlight.js with our documentation.Justus Winter
- For C code fragments, we use the highlight.js highlighter to apply syntax highlighting. Previously, highlight.js was only used in the FFI documentation, and was loaded from a CDN. - We now distribute highlight.js with our documentation. This is done in the 'doc' make target. - This helps to protect the privacy of users viewing the documentation. - Unfortunately, highlighting no longer works when viewing the documentation locally in a browser using the file:// scheme.