Skip to content

Add summary docs and an example for the FFI#124

Merged
ctz merged 2 commits intomainfrom
jbp-ffi-doc
May 7, 2026
Merged

Add summary docs and an example for the FFI#124
ctz merged 2 commits intomainfrom
jbp-ffi-doc

Conversation

@ctz
Copy link
Copy Markdown
Member

@ctz ctz commented May 7, 2026

No description provided.

@codspeed-hq
Copy link
Copy Markdown

codspeed-hq Bot commented May 7, 2026

Merging this PR will not alter performance

✅ 4 untouched benchmarks


Comparing jbp-ffi-doc (df5ea70) with main (fc450e8)

Open in CodSpeed

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds end-user facing documentation and a minimal C example program for the upki-ffi C API, plus CI checks intended to keep the example building and formatted.

Changes:

  • Document the expected call sequence for the C-FFI in README.md.
  • Add a small C demo (upki-demo.c) and Makefile under upki-ffi/example/, including embedded demo certificates.
  • Extend CI to clang-format the demo and to build the example in a dedicated workflow job.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
upki-ffi/example/upki-demo.c New minimal C program demonstrating config creation and revocation checking.
upki-ffi/example/Makefile Build rules for compiling/linking the C demo against the release FFI library.
upki-ffi/example/demo-certs.h Embedded demo certificate DER blobs used by the C demo.
README.md Replaces C-FFI TODO with a short usage guide and links.
.github/workflows/lints.yml Adds a clang-format check for the demo C file.
.github/workflows/build.yml Adds a job intended to ensure the FFI example builds (and currently attempts to run it).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread .github/workflows/build.yml Outdated
Comment on lines +78 to +82
- name: Install ${{ matrix.rustc }} toolchain
uses: dtolnay/rust-toolchain@master
with:
toolchain: stable

Comment on lines +88 to +89
./upki-demo || true
valgrind ./upki-demo || true
Comment on lines +1 to +5
unsigned char CERT_0_DER[] = {
0x30, 0x82, 0x04, 0xff, 0x30, 0x82, 0x03, 0xe7, 0xa0, 0x03, 0x02, 0x01,
0x02, 0x02, 0x12, 0x06, 0x18, 0x29, 0xba, 0x4d, 0x0e, 0x6a, 0xc6, 0x56,
0x8d, 0x37, 0x7c, 0xe5, 0xaa, 0x6e, 0x43, 0x97, 0x3f, 0x30, 0x0d, 0x06,
0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01, 0x0b, 0x05, 0x00,
Comment on lines +21 to +22

e = upki_check_revocation(config, certs, sizeof(certs) / sizeof(certs[0]));
Comment thread upki-ffi/example/Makefile Outdated
Comment on lines +3 to +7
upki-demo: upki-demo.c demo-certs.h
$(CC) -o $@ $< -I.. -L$(LIBDIR) -lupki -Wl,-rpath,$(LIBDIR)

clean:
rm upki-demo
Comment thread README.md
2. `upki_check_revocation(config, certs, certs_count)` - checking revocation status.
`certs` is a sequence of certificates represented by `upki_certificate_der` structs,
and is `certs_count` elements long. This returns `UPKI_REVOCATION_REVOKED` if the
certificate is revoked, `UPKI_REVOCATION_NOT_REVOKED` if it is OK, or another error.
@ctz ctz added this pull request to the merge queue May 7, 2026
Merged via the queue into main with commit 77a121e May 7, 2026
10 checks passed
@ctz ctz deleted the jbp-ffi-doc branch May 7, 2026 20:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants