Skip to content

Commit

Permalink
Fix root_pk_raw value (#6097)
Browse files Browse the repository at this point in the history
  • Loading branch information
hpeebles authored Jul 23, 2024
1 parent d34623f commit 04c0720
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions backend/libraries/proof_of_unique_personhood/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use ic_verifiable_credentials::VcFlowSigners;
use types::{CanisterId, TimestampMillis, UniquePersonProof, UniquePersonProofProvider};

const ISSUER_CANISTER_ID: CanisterId = CanisterId::from_slice(&[0, 0, 0, 0, 0, 240, 24, 173, 1, 1]);
const ISSUER_ORIGIN: &str = "id.decideai.xyz";
const ISSUER_ORIGIN: &str = "https://id.decideai.xyz/";
const NANOS_PER_MILLISECOND: u64 = 1_000_000;

pub fn verify_proof_of_unique_personhood(
Expand All @@ -14,6 +14,8 @@ pub fn verify_proof_of_unique_personhood(
ic_root_key: &[u8],
now: TimestampMillis,
) -> Result<UniquePersonProof, String> {
let root_pk_raw = &ic_root_key[ic_root_key.len().saturating_sub(96)..];

match ic_verifiable_credentials::validate_ii_presentation_and_claims(
credential_jwt,
principal,
Expand All @@ -27,7 +29,7 @@ pub fn verify_proof_of_unique_personhood(
credential_type: "ProofOfUniqueness".to_string(),
arguments: None,
},
ic_root_key,
root_pk_raw,
(now * NANOS_PER_MILLISECOND) as u128,
) {
Ok(_) => Ok(UniquePersonProof {
Expand Down

0 comments on commit 04c0720

Please sign in to comment.