-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Circuits V3: init commit. Update package deps. Replace test( ti it( #76
Conversation
src/circuits/atomicV3.ts
Outdated
const isValidMTPType = | ||
query.proofType === ProofType.Iden3SparseMerkleTreeProof && proofType === 2; | ||
|
||
if (!isValidSigType || !isValidMTPType) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it will always fail (if isValidMTPType is true, isValidMTPType always would be false)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we need AND here I guess (as it was before)
const isValidMTPType = | ||
query.proofType === ProofType.Iden3SparseMerkleTreeProof && proofType === 2; | ||
|
||
if (!isValidSigType && !isValidMTPType) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is wrong check.
if proofType == '' , then signal can be 1 or 2.
see https://github.com/iden3/go-iden3-auth/blob/8e8050511faf8384126ae6bb44641a5611b8e888/pubsignals/atomicV3.go#L57
throw new Error(`Nullifier id is generated but wasn't requested`); | ||
} | ||
|
||
if (typeof query.groupId === 'undefined' && this.pubSignals.linkID !== 0n) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we also need to check if groupId is provide linkNonce must not be zero
@@ -19,7 +18,7 @@ export class AuthPubSignalsV2 extends IDOwnershipPubSignals implements PubSignal | |||
this.challenge = this.pubSignals.challenge; | |||
} | |||
|
|||
async verifyQuery(_query: Query): Promise<void> { | |||
async verifyQuery(): Promise<void> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
won't it throw error if we try to pass here query in auth.ts checks?
No description provided.