Conversation
djc
approved these changes
May 7, 2026
There was a problem hiding this comment.
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 underupki-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 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 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 |
| 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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.