<feed xmlns='http://www.w3.org/2005/Atom'>
<title>mirrors/arti.git/crates/arti-rpc-client-core/src/ffi.rs, branch arti-v1.2.6</title>
<subtitle>mirror of https://gitlab.torproject.org/tpo/core/arti
</subtitle>
<id>http://git.dilluti0n.com/mirrors/arti.git/atom?h=arti-v1.2.6</id>
<link rel='self' href='http://git.dilluti0n.com/mirrors/arti.git/atom?h=arti-v1.2.6'/>
<link rel='alternate' type='text/html' href='http://git.dilluti0n.com/mirrors/arti.git/'/>
<updated>2024-07-31T17:54:16Z</updated>
<entry>
<title>ffi: Add some explicit ()s to prove they are there.</title>
<updated>2024-07-31T17:54:16Z</updated>
<author>
<name>Nick Mathewson</name>
<email>nickm@torproject.org</email>
</author>
<published>2024-07-31T17:25:29Z</published>
<link rel='alternate' type='text/html' href='http://git.dilluti0n.com/mirrors/arti.git/commit/?id=c4f8b574cfe7c35db3cc074fec59937b051b9c93'/>
<id>urn:sha1:c4f8b574cfe7c35db3cc074fec59937b051b9c93</id>
<content type='text'>
</content>
</entry>
<entry>
<title>ffi: Document safety for each function using ffi_body_raw.</title>
<updated>2024-07-31T17:54:16Z</updated>
<author>
<name>Nick Mathewson</name>
<email>nickm@torproject.org</email>
</author>
<published>2024-07-31T13:00:04Z</published>
<link rel='alternate' type='text/html' href='http://git.dilluti0n.com/mirrors/arti.git/commit/?id=6961e83f6ecbd975d7ed3610d6170a76240cac1a'/>
<id>urn:sha1:6961e83f6ecbd975d7ed3610d6170a76240cac1a</id>
<content type='text'>
</content>
</entry>
<entry>
<title>ffi: rename ffi_body_simple to ffi_body_raw</title>
<updated>2024-07-31T17:54:16Z</updated>
<author>
<name>Nick Mathewson</name>
<email>nickm@torproject.org</email>
</author>
<published>2024-07-31T12:50:29Z</published>
<link rel='alternate' type='text/html' href='http://git.dilluti0n.com/mirrors/arti.git/commit/?id=5cdfa510127ea53126b1398f44e26b2fd540326f'/>
<id>urn:sha1:5cdfa510127ea53126b1398f44e26b2fd540326f</id>
<content type='text'>
</content>
</entry>
<entry>
<title>ffi: use void to omit unreachable "on invalid" blocks</title>
<updated>2024-07-31T17:54:16Z</updated>
<author>
<name>Nick Mathewson</name>
<email>nickm@torproject.org</email>
</author>
<published>2024-07-30T21:06:30Z</published>
<link rel='alternate' type='text/html' href='http://git.dilluti0n.com/mirrors/arti.git/commit/?id=9c4c9e72d4cc76d58c577d15dbaea67507b108f3'/>
<id>urn:sha1:9c4c9e72d4cc76d58c577d15dbaea67507b108f3</id>
<content type='text'>
</content>
</entry>
<entry>
<title>ffi: Remove all non-opt conversions</title>
<updated>2024-07-31T17:54:16Z</updated>
<author>
<name>Nick Mathewson</name>
<email>nickm@torproject.org</email>
</author>
<published>2024-07-30T20:40:22Z</published>
<link rel='alternate' type='text/html' href='http://git.dilluti0n.com/mirrors/arti.git/commit/?id=fa70f79c0b2e930077896272dde44a2e15a989fa'/>
<id>urn:sha1:fa70f79c0b2e930077896272dde44a2e15a989fa</id>
<content type='text'>
Additionally, inline the related conversion functions.

This should reduce the total amount of unsafe code that somebody
would need to look at.
</content>
</entry>
<entry>
<title>ffi: Always abort on panic.</title>
<updated>2024-07-31T17:54:16Z</updated>
<author>
<name>Nick Mathewson</name>
<email>nickm@torproject.org</email>
</author>
<published>2024-07-29T17:36:19Z</published>
<link rel='alternate' type='text/html' href='http://git.dilluti0n.com/mirrors/arti.git/commit/?id=a968848d576f5bf9ae0a1624ff1bd07d01060e14'/>
<id>urn:sha1:a968848d576f5bf9ae0a1624ff1bd07d01060e14</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Use macros to make FFI functions simpler to read and check.</title>
<updated>2024-07-31T17:54:16Z</updated>
<author>
<name>Nick Mathewson</name>
<email>nickm@torproject.org</email>
</author>
<published>2024-07-25T22:55:53Z</published>
<link rel='alternate' type='text/html' href='http://git.dilluti0n.com/mirrors/arti.git/commit/?id=3303533551c63ab2e41b3790e402767e928983c9'/>
<id>urn:sha1:3303533551c63ab2e41b3790e402767e928983c9</id>
<content type='text'>
These macros do the only part of our FFI functions that needs to be
`unsafe`: converting input pointers into types that can be used in
safe rust.  I've added documentation about what requirements each of
these conversions puts onto out inputs: both informally, and via a
reference to the relevant parts of the Rust library documentation.

While doing this I found a safety bug in `OutPtr::from_opt_ptr`:
it should have been using `MaybeUninit`.

These macros should allow us to build a "proof sketch" for the
safety of our FFI code. We need to show, for each input parameter:

  - That the documented requirements for its conversion method
    are also documented requirements for that kind of input, in our
    header file.
  - That the documented requirements for how it can be used
    after conversion are in fact followed in the code.
</content>
</entry>
<entry>
<title>Rename Utf8CStr=&gt;Utf8CString</title>
<updated>2024-07-31T17:54:16Z</updated>
<author>
<name>Nick Mathewson</name>
<email>nickm@torproject.org</email>
</author>
<published>2024-07-25T17:58:01Z</published>
<link rel='alternate' type='text/html' href='http://git.dilluti0n.com/mirrors/arti.git/commit/?id=31d3c76529abd72dbb224b0bb41a9e8ff425fcb9'/>
<id>urn:sha1:31d3c76529abd72dbb224b0bb41a9e8ff425fcb9</id>
<content type='text'>
</content>
</entry>
<entry>
<title>rpclib ffi: Grand identifier renaming</title>
<updated>2024-07-31T17:54:16Z</updated>
<author>
<name>Nick Mathewson</name>
<email>nickm@torproject.org</email>
</author>
<published>2024-07-25T15:06:54Z</published>
<link rel='alternate' type='text/html' href='http://git.dilluti0n.com/mirrors/arti.git/commit/?id=851cd0a7032b7bcc2689c36afed7a5ef1b820326'/>
<id>urn:sha1:851cd0a7032b7bcc2689c36afed7a5ef1b820326</id>
<content type='text'>
In brief: Everything now starts with ARTI_RPC, arti_rpc, or ArtiRpc.
</content>
</entry>
<entry>
<title>rpclib: Revise/condense "safety" docs for C functions</title>
<updated>2024-07-31T17:54:16Z</updated>
<author>
<name>Nick Mathewson</name>
<email>nickm@torproject.org</email>
</author>
<published>2024-07-25T14:40:04Z</published>
<link rel='alternate' type='text/html' href='http://git.dilluti0n.com/mirrors/arti.git/commit/?id=a9334b3cb2a60387ede0c3a83bb348ecd25f5cc9'/>
<id>urn:sha1:a9334b3cb2a60387ede0c3a83bb348ecd25f5cc9</id>
<content type='text'>
These documents are no longer called "safety".  They are now mostly
collected as a big list of "correctness requirements" at the start
of the cbindgen header.  Because of these requirements, most
functions no longer need their own "safety" sections.

I am explicitly using `#[allow(clippy::missing_safety_doc)]` on each
function, rather than adding a blanket exception:
  - There are other unsafe functions in this code, to which we
    wouldn't want an exception to apply.
  - Documenting the safety^W correctness requirements of a function
    is important enough to make sure that we aren't skipping out on
    it unintentionally.
</content>
</entry>
</feed>
