Repository navigation
fix(keyring): call KeyringConsent2 as a confidential host callback - #51
Merged
Merged
Conversation
The host serves KeyringConsent2 through a host callback binding, which refuses ordinary calls to a declared member. The module called it plainly, so every keyring operation failed consent as Unavailable and hosts fell back to their own secret paths. Call it with call_confidential, as the audit, approval store and prompt callbacks already do. Mock-bus unit tests keep ordinary calls through a test-only switch. keyring_native_contract loads the real module behind a binding and proves Set, Get and a refused Get.
Tiny Sweeper reviewReviewed head: Verdict: Ready for maintainer review · Priority: none Diagnostics and supporting detailsFull summaryPull request purpose (title): fix(keyring): call KeyringConsent2 as a confidential host callback. Tiny Sweeper completed its review; deterministic results follow. Review snapshot
Completeness: Complete Features
Tests
FindingsNo active actionable findings. Before mergeNone. How this fits togetherflowchart LR
n0["Consent<br/>changed"]:::changed
n1["consent<br/>changed"]:::changed
n2["fixture<br/>changed"]:::changed
n3["...bound_and_oversized_passwords_are_refused<br/>changed"]:::changed
n4["standalone"]:::impacted
n5["CryptoState"]:::impacted
n6["bare_config"]:::impacted
n7["CryptoConfig2"]:::impacted
n8["as_str"]:::impacted
n1 -->|calls| n8
n2 -->|calls| n8
n3 -->|calls| n2
n3 -->|tests| n2
n3 -->|calls| n4
n3 -->|tests| n4
n3 -->|calls| n6
n3 -->|tests| n6
n4 -->|uses| n5
n4 -->|uses| n7
n4 -->|calls| n8
n5 -->|uses| n7
n6 -->|uses| n7
classDef changed fill:#0d4429,stroke:#238636,color:#e6edf3
classDef impacted fill:#161b22,stroke:#6e7681,color:#c9d1d9
classDef flagged fill:#5a1e02,stroke:#d93f0b,color:#ffffff
classDef blocking fill:#67060c,stroke:#f85149,color:#ffffff
Agent review detailscritique
security
tests
commits
description
Evidence and run details
|
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars.
|
The other native fixtures run a second time outside the repository; the keyring fixture now does too.
Contributor
Author
|
Validation notes from the self-hosted Linux runner:
|
The test-only branch held a confidential call that no build ran, so the native changed-line coverage gate counted it as uncovered. Choose the call with one flag, as the audit client does: native fixtures cover the confidential call and unit tests cover the ordinary one.
Consent fails closed as Unavailable when nothing serves KeyringConsent2. The test also runs the confidential call in the unit build.
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.
Summary
The module called
KeyringConsent2as an ordinary bus call. The host servesKEYRING_CONSENTas a confidential callback endpoint, which refuses non-confidential calls, so every keyring operation failed with an "unavailable" error. That made openhuman fall back from the OS keyring to its master-key encrypted store when saving the sign-in token. That path needs a forced "Unlock configuration secrets" approval, which is only accepted from a chat turn, so desktop sign-in failed.This makes
adapter_crypto.rs#consentuseproxy.call_confidential(CONSENT, ..), the same pattern asAuditSink2.Append(fixed in 4a75ceb). Acfg(test)switch keeps the mock-bus unit fixture on plain calls, asAuditClientandApprovalClientsalready do.Tests
crates/tinysecurity-module/examples/keyring_native_contract.rsloads the real cdylib behindprepare_host_callbacks+serve_atforKeyringConsent2, then runs Set, a Get round-trip, and a refused Get. The binding refuses plain calls, so this fails at Set on9cbd99band passes here..github/scripts/run-native-master-cipher-coverage.sh, which the existing "Collect native coverage" step calls on all three OSes. No workflow file changes.Validation (self-hosted Linux runner)
keyring_native_contract: all pass.cargo fmt --check: clean.tinysecurity-cryptonative_handles::app_storetests, a crate this PR doesn't touch. Being checked againstmain; will update here.Release
Contract stays 2.0 (main). After merge, release from
mainas v0.19.0 (minor). openhuman will re-pin it together with its host move to contract 2.0 (tinyhumansai/openhuman#8536).