Age | Commit message (Collapse) | Author |
|
|
|
|
|
|
|
|
|
|
|
- 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.
|
|
|
|
- Previously, it was impossible to use the ffi_wrapper_type macro
twice in the same module because importing a trait twice
introduces a conflict.
|
|
|
|
|
|
- Turn it into a pointer type aligning it with the other type
definitions.
|
|
- This way we can easily introduce new transformations.
|
|
- Using absolute paths allows us to use types without having the
user to 'use' them.
|
|
|
|
|
|
|
|
|
|
|
|
- This also checks for internal nul bytes.
|
|
|
|
|
|
|
|
|
|
|
|
- Fixes 9d6e628d6a183b483bdf115993d0a5a377c3d823.
|
|
- Addresses #172.
|
|
|
|
- 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.
|
|
- 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.
|
|
- Change TPKBuilder::add_userid to take an Into<Cow<'a, str>>>
instead of a &str.
|
|
- 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 .
|
|
- 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.
|
|
- 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.
|
|
- 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.
|
|
|
|
|
|
|
|
|
|
- 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.
|
|
- In case of errors, set *tpk_out to None.
|
|
|
|
- Fixes tests not being found because the functions signature were
formatted differently. In the end, only proper parsing will help
here.
|
|
- This function was used early on to demonstrate the FFI layer. It
can now be expressed using pgp_tpk_debug().
|
|
|
|
|
|
|
|
|
|
|
|
|
|
- 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.
|