Compare commits
2 Commits
c1b058ce4e
...
9412817a66
Author | SHA1 | Date |
---|---|---|
|
9412817a66 | |
|
d06542f99c |
|
@ -19,17 +19,12 @@ hyper-util = { version = "0.1", features = ["full"] }
|
||||||
julianday = "1.2.0"
|
julianday = "1.2.0"
|
||||||
lazy_static = "1"
|
lazy_static = "1"
|
||||||
lox-library = { git = "https://gitlab.torproject.org/vecna/lox.git", version = "0.1.0" }
|
lox-library = { git = "https://gitlab.torproject.org/vecna/lox.git", version = "0.1.0" }
|
||||||
#scraper = "0.18"
|
|
||||||
select = "0.6.0"
|
select = "0.6.0"
|
||||||
serde = "1.0.195"
|
serde = "1.0.195"
|
||||||
serde_json = "1.0"
|
serde_json = "1.0"
|
||||||
serde_with = {version = "3.5.0", features = ["json"]}
|
serde_with = {version = "3.5.0", features = ["json"]}
|
||||||
sha1 = "0.10"
|
sha1 = "0.10"
|
||||||
sha2 = "0.10"
|
|
||||||
sha3 = "0.10"
|
sha3 = "0.10"
|
||||||
sled = "0.34.7"
|
sled = "0.34.7"
|
||||||
time = "0.3.30"
|
time = "0.3.30"
|
||||||
tokio = { version = "1", features = ["full"] }
|
tokio = { version = "1", features = ["full"] }
|
||||||
|
|
||||||
# probably not needed once I can query an API
|
|
||||||
rand = { version = "0.8", features = ["std_rng"]}
|
|
||||||
|
|
|
@ -3,12 +3,11 @@
|
||||||
|
|
||||||
use crate::{get_date, CONFIG, COUNTRY_CODES};
|
use crate::{get_date, CONFIG, COUNTRY_CODES};
|
||||||
|
|
||||||
use curve25519_dalek::{RistrettoPoint, Scalar};
|
use curve25519_dalek::{ristretto::RistrettoBasepointTable, Scalar};
|
||||||
use ed25519_dalek::{Signature, Signer, SigningKey, Verifier, VerifyingKey};
|
use ed25519_dalek::{Signature, Signer, SigningKey, Verifier, VerifyingKey};
|
||||||
use lox_library::{cred::Lox, proto::positive_report as lox_pr, IssuerPubKey};
|
use lox_library::{cred::Lox, proto::positive_report as lox_pr, IssuerPubKey};
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
use sha1::{Digest, Sha1};
|
use sha1::{Digest, Sha1};
|
||||||
use sha2::Sha512;
|
|
||||||
use std::option::Option;
|
use std::option::Option;
|
||||||
|
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
|
@ -106,12 +105,14 @@ impl PositiveReport {
|
||||||
/// Verify everything except the Lox proof.
|
/// Verify everything except the Lox proof.
|
||||||
/// Parameters:
|
/// Parameters:
|
||||||
/// - The bucket ID for the bucket containing this bridge
|
/// - The bucket ID for the bucket containing this bridge
|
||||||
|
/// - A basepoint table for computing multiples of H
|
||||||
/// - The bridge verifying key for this bridge (if bridge token is required)
|
/// - The bridge verifying key for this bridge (if bridge token is required)
|
||||||
/// These parameters are assumed to be correct and are NOT checked against
|
/// These parameters are assumed to be correct and are NOT checked against
|
||||||
/// the fingerprint listed in the report.
|
/// the fingerprint listed in the report.
|
||||||
pub fn verify_excluding_lox_proof(
|
pub fn verify_excluding_lox_proof(
|
||||||
self,
|
self,
|
||||||
bucket: Scalar,
|
bucket: Scalar,
|
||||||
|
Htable: &RistrettoBasepointTable,
|
||||||
bridge_key: Option<VerifyingKey>,
|
bridge_key: Option<VerifyingKey>,
|
||||||
) -> bool {
|
) -> bool {
|
||||||
// Verify bridge token
|
// Verify bridge token
|
||||||
|
@ -132,11 +133,8 @@ impl PositiveReport {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Verify knowledge of bucket ID
|
// Verify knowledge of bucket ID
|
||||||
let H = RistrettoPoint::hash_from_bytes::<Sha512>(
|
|
||||||
format!("{}{}", lox_pr::H_GENERATOR_STRING, self.lox_proof.date).as_bytes(),
|
|
||||||
);
|
|
||||||
let BP = self.lox_proof.BP;
|
let BP = self.lox_proof.BP;
|
||||||
if bucket * H != BP {
|
if &bucket * Htable != BP {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
true
|
true
|
||||||
|
|
Loading…
Reference in New Issue