Repository navigation
init, crypto: fix settings.json warning, lock secrets, check CPUID - #248
Merged
Merged
Conversation
Found in review of #233. - init: settings.json keeps JSON types, so "v2pqtransport": true (or "mlkemportable": true) was taken for the double negative -noX=0 and warned on every start, in qbit-qt as a dialog. The warning now looks at the source that wins, in GetSetting()'s precedence: a bool from settings.json is plain, one from the command line or qbit.conf is the double negative. ArgsManager gains a const LockSettings() for this. feature_pq_settings.py covers each source and override. - bip324, bip324_pq: a responder holds the 3,168-byte decapsulation key, and both sides the retained ECDH secret, until the peer's version arrives. Both now live in secure_allocator memory (mlock'd, excluded from core dumps), like CKey, and are still wiped on close. - sha256: SHA256AutoDetect read CPUID leaf 7 without checking the maximum basic leaf. In a VM limited to leaf 1 the answer is leaf 1's data, whose APIC ID bits can claim SHA-NI, and the self-test then dies with SIGILL. Leaf 7 is now read only when supported. - mlkem: ForcePortableForTesting restored the state it replaced, which is wrong when guards overlap without nesting, as on two threads. Guards are now counted. - fuzz: mlkem_backend_diff compared portable C with itself under MLKEM_FORCE_PORTABLE=1, and nothing checked that native code ran in the native replay. It now aborts at start-up unless the native code the build and CPU allow is active, and skips the diff, saying so, when only portable C is. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Member
Author
|
@codex review |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Codex Review: Didn't find any major issues. Delightful! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
This was referenced Oct 23, 2026
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.
Five fixes from review of #233.
truein settings.json. settings.json keeps JSON types, so"v2pqtransport": true(or"mlkemportable": true) was taken for the double negative-nov2pqtransport=0, and warned on every start; in qbit-qt that warning is a dialog.GetSetting()'s precedence. A bool from settings.json is a plain value. A bool from the command line orqbit.confis the double negative.ArgsManagergains a constLockSettings()for this.feature_pq_settings.pycovers each source and each override. It fails against the old code.secure_allocatormemory, which is mlock'd and excluded from core dumps, asCKeyis. They are still wiped on close.ForcePortableForTestingguards are counted. Guards that overlap without nesting, as on two threads, used to restore the wrong state. This is test-only; production selection is unchanged.mlkem_backend_difffuzz target can't silently compare portable C with itself. At start-up it aborts unless the native code that the build and CPU allow is active. When only portable C runs, it says so and skips the diff.Tests run:
test_qbit --run_test=bip324_tests,mlkem_tests,cpu_features_tests,crypto_tests,net_pq_tests,net_tests,argsman_tests,getarg_tests. The three new unit tests fail with the library fixes reverted.rpc_pqtransport.py,feature_pq_settings.pyandfeature_settings.py.mlkemandmlkem_backend_diffover their seed corpora, both natively (x86_64-avx2) and withMLKEM_FORCE_PORTABLE=1.Since #245, pull requests into
feature/pq-transportdon't run CI. #233's full CI covers this change once it merges.🤖 Generated with Claude Code
Need help on this PR? Tag
@codesmith-botwith what you need.