Age | Commit message (Collapse) | Author |
|
|
|
|
|
|
|
|
|
|
|
- Fixes 9d6e628d6a183b483bdf115993d0a5a377c3d823.
|
|
- A consequence of using wrapper types in the API is that we can no
longer hand out references. For example, with the recently
introduced wrapper types, pgp_tsk_tpk no longer works, as it
returns bare references.
- With this change, we wrap immutable and mutable references to
objects. It presents an opportunity for a uniform API (i.e. just
always free references you got from us), and for us the ability to
track mutability of references.
|
|
- Addresses #172.
|
|
- In a1eba557ff62f09bef2c7e379a238c643ac240d7, I changed the store
to insert all subkeys into the key_to_keyid table. Update the
documentation to reflect this change.
|
|
- A macro to make profiling a few bits of code straightforward.
|
|
|
|
- Any place where we execute a build command for the ffi crate, we
should do the same for the openpgp-ffi crate, too.
|
|
- 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 wrapper object may be deallocated either if the object is
freed *or* the object is moved. Change the error message to
mention both of these possibilities.
|
|
- 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 .
|
|
- CDefError is not exposed as cffi.error.CDefError, but as
cffi.api.CDefError in python3-cffi 1.9.1-2. This change is
forwards compatible with python3-cffi 1.11.5-3 (from Debian
Testing).
- enum.auto is only available in Python v3.6. Albeit uglier,
manually assigning values works in Python v3.5 (and later).
|
|
- 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.
|
|
|
|
- We need at least version 1.31.0 of rustc.
- Prefix commands that require root with sudo.
|
|
|
|
This patch splits off the deterministic stage into it's
own function to make it easier to write tests for ECDH keys.
|
|
This fixes a crash in the TPK parser resulting from reaching and
unreachable branch. The problem is triggered by an invalid SecretSubkey
packet. The packet is parsed as Packet::Unknown(Tag::SecretSubkey,...).
The parser then calls pkt.tag() to convert the Packet into a Token.
The patch uses a match instead of tag() when converting. Closes #120.
|
|
|
|
|
|
|
|
- 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().
|
|
|
|
|
|
|
|
|
|
- Note that the wrapper type is not actually used for now, the
functions still operate on the original type. But, this lets us
derive functions, and for that we merge it now.
- See #166.
|
|
|
|
|
|
|
|
- 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.
|
|
|
|
|