|
@@ -60,6 +60,7 @@ pub const UNTRUSTED_INTERVAL: u32 = 30;
|
|
|
muCMZProtocol! { trust_promotion<credential_expiry, eligibility_max_age>,
|
|
|
L: Lox { id: R, bucket: H, trust_level: R, level_since: H, invites_remaining: R, blockages: R },
|
|
|
M: MigrationKey { lox_id: R, from_bucket: H} ,
|
|
|
+ M.lox_id = L.id,
|
|
|
M.from_bucket = L.bucket,
|
|
|
(credential_expiry..eligibility_max_age).contains(L.level_since),
|
|
|
}
|
|
@@ -139,7 +140,6 @@ impl BridgeAuth {
|
|
|
|L: &mut Lox, M: &mut MigrationKey| {
|
|
|
L.set_privkey(&self.lox_priv);
|
|
|
M.set_privkey(&self.migrationkey_priv);
|
|
|
- M.lox_id = L.id;
|
|
|
let eligibility_max_age = today - UNTRUSTED_INTERVAL;
|
|
|
Ok(trust_promotion::Params {
|
|
|
credential_expiry: (eligibility_max_age - 511).into(),
|
|
@@ -239,8 +239,13 @@ mod tests {
|
|
|
"Trust promotion response from server should succeed"
|
|
|
);
|
|
|
let (response, enc) = trust_promo_response.unwrap();
|
|
|
- let creds =
|
|
|
- trust_promotion::handle_response(th.ba.migration_pub, tp_client_state, response, enc);
|
|
|
+ let creds = trust_promotion::handle_response(
|
|
|
+ th.ba.migration_pub.clone(),
|
|
|
+ tp_client_state,
|
|
|
+ response,
|
|
|
+ enc,
|
|
|
+ );
|
|
|
assert!(creds.is_ok(), "Handle response should succeed");
|
|
|
+ th.verify_migration(&creds.unwrap());
|
|
|
}
|
|
|
}
|