Skip to content
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

Fix root_pk_raw and issuer_origin values #6097

Merged
merged 2 commits into from
Jul 23, 2024
Merged
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
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
Loading