fix(idemix): never return a nil error when credential verification fails - #2117
Open
AkramBitar wants to merge 1 commit into
Open
fix(idemix): never return a nil error when credential verification fails#2117AkramBitar wants to merge 1 commit into
AkramBitar wants to merge 1 commit into
Conversation
Signed-off-by: AkramBitar <akram@il.ibm.com>
AkramBitar
force-pushed
the
fix-2062-idemix-km-nil-error
branch
from
August 3, 2026 19:23
21512bc to
4d32207
Compare
📊 Token Validation BenchmarkComparison of this PR against the base branch. 🟢 improvement · 🔴 regression · ➖ within ±1.0% noise.
|
📊 Token Validation BenchmarkComparison of this PR against the base branch. 🟢 improvement · 🔴 regression · ➖ within ±1.0% noise.
|
AkramBitar
requested review from
SaidAltury-ibm
and removed request for
HayimShaul
August 5, 2026 14:02
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.
NewKeyManagerWithSchemafunnelled both credential-verification failure modes througherrors.WithMessagef(err, ...). When the BCCSP reports a bad credential asvalid == falsewith a nil error, wrapping nil yields nil, so the constructor returned(nil, nil). Callers checking onlyerr != nilthen used a nil*KeyManagerand panicked later, far from the real cause.The branch is now split: an error is wrapped,
!validreturns a fresh error. A verification failure is always reported as a non-nil error.Tests: a BCCSP decorator forcing each outcome (
(false, nil)— the bug,(false, err),(true, err)) across both curve configs, a happy-path pin, and an end-to-end case with a tampered credential rejected by the real BCCSP. The(false, nil)case fails before this change and passes after.Docs: added "Credential Verification at Load Time" to
docs/services/identity.md.Fixes #2062