Various bugfixes and other accounting for changes since the cherry-picks below.

pull/2712/head
jMyles 2019-09-16 23:08:44 -07:00
parent 2a19120871
commit 067369ed45
3 changed files with 15 additions and 15 deletions

View File

@ -700,8 +700,8 @@ class Bob(Character):
hrac, map_id = self.construct_hrac_and_map_id(alice_verifying_key, label)
_unknown_ursulas, _known_ursulas, m = self.follow_treasure_map(map_id=map_id, block=True)
capsule.set_correctness_keys("receiving", self.public_keys(DecryptingPower))
capsule.set_correctness_keys("verifying", alice_verifying_key)
capsule.set_correctness_keys(receiving=self.public_keys(DecryptingPower))
capsule.set_correctness_keys(verifying=alice_verifying_key)
new_work_orders, complete_work_orders = self.work_orders_for_capsules(
map_id=map_id,

View File

@ -93,7 +93,7 @@ class PolicyMessageKit(MessageKit):
@sender.setter
def sender(self, enrico):
# Here we set the delegating correctness key to the policy public key (which happens to be composed on enrico, but for which of course he doesn't have the corresponding private key).
self.capsule.set_correctness_keys("delegating", enrico.policy_pubkey)
self.capsule.set_correctness_keys(delegating=enrico.policy_pubkey)
self._sender = enrico
def __bytes__(self):

View File

@ -31,11 +31,11 @@ def test_federated_bob_full_retrieve_flow(federated_ursulas,
# The side channel delivers all that Bob needs at this point:
# - A single MessageKit, containing a Capsule
# - A representation of the data source
the_message_kit, the_data_source = capsule_side_channel()
the_message_kit = capsule_side_channel()
alices_verifying_key = federated_alice.stamp.as_umbral_pubkey()
delivered_cleartexts = federated_bob.retrieve(message_kit=the_message_kit,
enrico=the_data_source,
delivered_cleartexts = federated_bob.retrieve(the_message_kit,
enrico=capsule_side_channel.enrico,
alice_verifying_key=alices_verifying_key,
label=enacted_federated_policy.label)
@ -96,26 +96,26 @@ def test_bob_joins_policy_and_retrieves(federated_alice,
alices_verifying_key = federated_alice.stamp.as_umbral_pubkey()
# Bob takes the message_kit and retrieves the message within
delivered_cleartexts = bob.retrieve(message_kit=message_kit,
delivered_cleartexts = bob.retrieve(message_kit,
enrico=enrico,
alice_verifying_key=alices_verifying_key,
label=policy.label)
label=policy.label,
retain_cfrags=True)
assert plaintext == delivered_cleartexts[0]
# Bob tries to retrieve again, but without using the cached CFrags, it fails.
with pytest.raises(TypeError):
delivered_cleartexts = bob.retrieve(message_kit=message_kit,
delivered_cleartexts = bob.retrieve(message_kit,
enrico=enrico,
alice_verifying_key=alices_verifying_key,
label=policy.label)
# Bob can retrieve again if he sets cache=True.
cleartexts_delivered_a_second_time = bob.retrieve(message_kit=message_kit,
cleartexts_delivered_a_second_time = bob.retrieve(message_kit,
enrico=enrico,
alice_verifying_key=alices_verifying_key,
label=policy.label,
retain_cfrags=True)
use_attached_cfrags=True)
# Indeed, they're the same cleartexts.
assert delivered_cleartexts == cleartexts_delivered_a_second_time
@ -125,11 +125,11 @@ def test_bob_joins_policy_and_retrieves(federated_alice,
assert len(failed_revocations) == 0
# One thing to note here is that Bob *can* still retrieve with the cached CFrags, even though this Policy has been revoked. #892
_cleartexts = bob.retrieve(message_kit=message_kit,
_cleartexts = bob.retrieve(message_kit,
enrico=enrico,
alice_verifying_key=alices_verifying_key,
label=policy.label,
retain_cfrags=True,
use_precedent_work_orders=True,
)
assert _cleartexts == delivered_cleartexts # TODO: 892
@ -137,7 +137,7 @@ def test_bob_joins_policy_and_retrieves(federated_alice,
message_kit.capsule.clear_cfrags()
with pytest.raises(Ursula.NotEnoughUrsulas):
_cleartexts = bob.retrieve(message_kit=message_kit,
_cleartexts = bob.retrieve(message_kit,
enrico=enrico,
alice_verifying_key=alices_verifying_key,
label=policy.label,