Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions common/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,9 @@ export type {
UserIdType,
} from './src/utils/index.js';


// Constants exports
export type { Country3LetterCode } from './src/constants/index.js';


// Additional type exports
export type { Environment } from './src/utils/types.js';

Expand Down
4 changes: 0 additions & 4 deletions common/src/utils/aadhaar/mockData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ function computeUppercasePaddedName(name: string): number[] {
.map((char) => char.charCodeAt(0));
}


// Helper function to compute final commitment
export function computeCommitment(
secret: bigint,
Expand All @@ -61,8 +60,6 @@ export function computeCommitment(
return poseidon5([secret, qrHash, nullifier, packedCommitment, photoHash]);
}



// Helper function to compute packed commitment
export function computePackedCommitment(
extractedFields: ReturnType<typeof extractQRDataFields>
Expand All @@ -77,7 +74,6 @@ export function computePackedCommitment(
return BigInt(packBytesAndPoseidon(packedCommitmentArgs));
}


export function convertByteArrayToBigInt(byteArray: Uint8Array | number[]): bigint {
let result = 0n;
for (let i = 0; i < byteArray.length; i++) {
Expand Down
13 changes: 11 additions & 2 deletions packages/mobile-sdk-demo/metro.config.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -128,9 +128,18 @@ const config = {
candidatePaths.push(path.join(packageRoot, 'lib', `${subpath}.js`));
}

// Find the first existing file
// Guard against path traversal: normalize and ensure within packageRoot
const fs = require('fs');
for (const candidatePath of candidatePaths) {
const normalizedCandidates = candidatePaths
.map(p => path.resolve(p))
.filter(p => {
const relative = path.relative(packageRoot, p);
// keep only files strictly inside packageRoot
return relative !== '' && !relative.startsWith('..') && !path.isAbsolute(relative);
});

// Find the first existing file among safe candidates
for (const candidatePath of normalizedCandidates) {
if (fs.existsSync(candidatePath)) {
return {
type: 'sourceFile',
Expand Down
Loading