Skip to content

feat: expose adding trust anchor / intermediate certificates on the FFI pki env#2150

Open
typfel wants to merge 4 commits into
mainfrom
jacob/feat/certs-ffi
Open

feat: expose adding trust anchor / intermediate certificates on the FFI pki env#2150
typfel wants to merge 4 commits into
mainfrom
jacob/feat/certs-ffi

Conversation

@typfel
Copy link
Copy Markdown
Member

@typfel typfel commented May 18, 2026

What's new in this PR

Expose adding trust anchor / intermediate certificates on the FFI pki env


PR Submission Checklist for internal contributors
  • The PR Title
    • conforms to the style of semantic commits messages¹ supported in Wire's Github Workflow²
    • contains a reference JIRA issue number like SQPIT-764
    • answers the question: If merged, this PR will: ... ³
  1. https://sparkbox.com/foundry/semantic_commit_messages
  2. https://github.com/wireapp/.github#usage
  3. E.g. feat(conversation-list): Sort conversations by most emojis in the title #SQPIT-764.

@typfel typfel requested a review from a team May 18, 2026 18:21
Copy link
Copy Markdown
Contributor

@coriolinus coriolinus left a comment

Choose a reason for hiding this comment

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

IMO we need at least some documentation about proper usage before approving this.

Comment thread crypto-ffi/src/pki_env.rs
/// Add a DER-encoded certificate as a trust anchor.
pub async fn add_trust_anchor(&self, name: &str, cert_der: &[u8]) -> CoreCryptoResult<()> {
let cert = x509_cert::Certificate::from_der(cert_der).map_err(CoreCryptoError::generic())?;
self.0.add_trust_anchor(name, cert).await?;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This is dangerous at the moment; until we do a database migration (which we wanted to postpone until after CC 10) any new trust anchor will silently overwrite the previous trust anchor. So at the very least I'd like to see some docs to that effect if we make this function public.

ppJsiJ+R0Mj4ato4FPg90nm0OtACIQCAIjV4mlXh8Gp2RRSlwuA894+NhyztLPU+vErHy/0I
uA==
`.replace(/\s/g, "");

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This is almost PEM! :-)

@fewerner
Copy link
Copy Markdown
Contributor

47af192 is missing a commit type

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.

4 participants