mirror of
https://github.com/selfxyz/self.git
synced 2026-02-19 02:24:25 -05:00
fix: use pubsignals length of 20 (#1675)
This commit is contained in:
@@ -92,7 +92,7 @@ interface IGCPJWTVerifier {
|
||||
uint256[2] calldata pA,
|
||||
uint256[2][2] calldata pB,
|
||||
uint256[2] calldata pC,
|
||||
uint256[19] calldata pubSignals
|
||||
uint256[20] calldata pubSignals
|
||||
) external view returns (bool);
|
||||
}
|
||||
|
||||
@@ -450,7 +450,7 @@ contract IdentityRegistryKycImplV1 is IdentityRegistryKycStorageV1, IIdentityReg
|
||||
uint256[2] calldata pA,
|
||||
uint256[2][2] calldata pB,
|
||||
uint256[2] calldata pC,
|
||||
uint256[19] calldata pubSignals
|
||||
uint256[20] calldata pubSignals
|
||||
) external onlyProxy onlyTEE {
|
||||
// Check if the proof is valid
|
||||
if (!IGCPJWTVerifier(_gcpJwtVerifier).verifyProof(pA, pB, pC, pubSignals)) revert INVALID_PROOF();
|
||||
@@ -459,19 +459,19 @@ contract IdentityRegistryKycImplV1 is IdentityRegistryKycStorageV1, IIdentityReg
|
||||
if (pubSignals[0] != _gcpRootCAPubkeyHash) revert INVALID_ROOT_CA();
|
||||
|
||||
// Check if the TEE image hash is valid
|
||||
bytes memory imageHash = GCPJWTHelper.unpackAndConvertImageHash(pubSignals[4], pubSignals[5], pubSignals[6]);
|
||||
bytes memory imageHash = GCPJWTHelper.unpackAndConvertImageHash(pubSignals[5], pubSignals[6], pubSignals[7]);
|
||||
if (!IPCR0Manager(_PCR0Manager).isPCR0Set(imageHash)) revert INVALID_IMAGE();
|
||||
|
||||
// Unpack the pubkey and register it
|
||||
uint256 pubkeyCommitment = GCPJWTHelper.unpackAndDecodeHexPubkey(pubSignals[1], pubSignals[2], pubSignals[3]);
|
||||
_isRegisteredPubkeyCommitment[pubkeyCommitment] = true;
|
||||
|
||||
uint256 currentYear = 2000 + pubSignals[7] * 10 + pubSignals[8];
|
||||
uint256 currentMonth = pubSignals[9] * 10 + pubSignals[10];
|
||||
uint256 currentDay = pubSignals[11] * 10 + pubSignals[12];
|
||||
uint256 currentHour = pubSignals[13] * 10 + pubSignals[14];
|
||||
uint256 currentMinute = pubSignals[15] * 10 + pubSignals[16];
|
||||
uint256 currentSecond = pubSignals[17] * 10 + pubSignals[18];
|
||||
uint256 currentYear = 2000 + pubSignals[8] * 10 + pubSignals[9];
|
||||
uint256 currentMonth = pubSignals[10] * 10 + pubSignals[11];
|
||||
uint256 currentDay = pubSignals[12] * 10 + pubSignals[13];
|
||||
uint256 currentHour = pubSignals[14] * 10 + pubSignals[15];
|
||||
uint256 currentMinute = pubSignals[16] * 10 + pubSignals[17];
|
||||
uint256 currentSecond = pubSignals[18] * 10 + pubSignals[19];
|
||||
uint256 currentTimestamp = Formatter.toTimeStampWithSeconds(
|
||||
currentYear,
|
||||
currentMonth,
|
||||
|
||||
@@ -29,7 +29,7 @@ contract MockGCPJWTVerifier {
|
||||
uint256[2] calldata pA,
|
||||
uint256[2][2] calldata pB,
|
||||
uint256[2] calldata pC,
|
||||
uint256[19] calldata pubSignals
|
||||
uint256[20] calldata pubSignals
|
||||
) external view returns (bool) {
|
||||
// Silence unused variable warnings
|
||||
pA;
|
||||
|
||||
@@ -128,6 +128,7 @@ describe("KYC Registration test", function () {
|
||||
p0,
|
||||
p1,
|
||||
p2,
|
||||
0n,
|
||||
testImageHash.p0,
|
||||
testImageHash.p1,
|
||||
testImageHash.p2,
|
||||
@@ -242,6 +243,7 @@ describe("KYC Registration test", function () {
|
||||
1n,
|
||||
2n,
|
||||
3n,
|
||||
0n,
|
||||
4n,
|
||||
5n,
|
||||
6n,
|
||||
@@ -273,6 +275,7 @@ describe("KYC Registration test", function () {
|
||||
1n,
|
||||
2n,
|
||||
3n,
|
||||
0n,
|
||||
4n,
|
||||
5n,
|
||||
6n,
|
||||
@@ -322,6 +325,7 @@ describe("KYC Registration test", function () {
|
||||
1n,
|
||||
2n,
|
||||
3n,
|
||||
0n,
|
||||
4n,
|
||||
5n,
|
||||
6n,
|
||||
@@ -356,6 +360,7 @@ describe("KYC Registration test", function () {
|
||||
p0,
|
||||
p1,
|
||||
p2,
|
||||
0n,
|
||||
177384435506496807268973340845468654286294928521500580044819492874465981028n,
|
||||
175298970718174405520284770870231222447414486446296682893283627688949855078n,
|
||||
13360n,
|
||||
@@ -379,6 +384,7 @@ describe("KYC Registration test", function () {
|
||||
p0,
|
||||
p1,
|
||||
p2,
|
||||
0n,
|
||||
177384435506496807268973340845468654286294928521500580044819492874465981028n,
|
||||
175298970718174405520284770870231222447414486446296682893283627688949855078n,
|
||||
13360n,
|
||||
@@ -417,6 +423,7 @@ describe("KYC Registration test", function () {
|
||||
1n,
|
||||
2n,
|
||||
3n,
|
||||
0n,
|
||||
4n,
|
||||
5n,
|
||||
6n,
|
||||
@@ -434,6 +441,7 @@ describe("KYC Registration test", function () {
|
||||
1n,
|
||||
2n,
|
||||
3n,
|
||||
0n,
|
||||
4n,
|
||||
5n,
|
||||
6n,
|
||||
@@ -451,6 +459,7 @@ describe("KYC Registration test", function () {
|
||||
1n,
|
||||
2n,
|
||||
3n,
|
||||
0n,
|
||||
4n,
|
||||
5n,
|
||||
6n,
|
||||
|
||||
Reference in New Issue
Block a user