diff --git a/src/_zkapauthorizer/tests/test_storage_protocol.py b/src/_zkapauthorizer/tests/test_storage_protocol.py index c027dfd42d06b4f4d8fa77581576382a7fc7bea7..30057e186e5f5ed6f8f2df706e18dc71a423a04d 100644 --- a/src/_zkapauthorizer/tests/test_storage_protocol.py +++ b/src/_zkapauthorizer/tests/test_storage_protocol.py @@ -1014,85 +1014,6 @@ class ShareTests(TestCase): ), ) - @given( - storage_index=storage_indexes(), - secrets=tuples( - write_enabler_secrets(), - lease_renew_secrets(), - lease_cancel_secrets(), - ), - test_and_write_vectors_for_shares=slot_test_and_write_vectors_for_shares(), - ) - def test_client_cannot_control_lease_behavior( - self, storage_index, secrets, test_and_write_vectors_for_shares - ): - """ - If the client passes ``renew_leases`` to *slot_testv_and_readv_and_writev* - it fails with ``TypeError``, no lease is updated, and no share data is - written. - """ - # First, tell the client to let us violate the protocol. It is the - # server's responsibility to defend against this attack. - self.local_remote_server.check_args = False - - # The nice Python API doesn't let you do this so we drop down to - # the layer below. We also use positional arguments because they - # transit the network differently from keyword arguments. Yay. - d = self.local_remote_server.callRemote( - "slot_testv_and_readv_and_writev", - # passes - _encode_passes( - self.pass_factory.get( - slot_testv_and_readv_and_writev_message(storage_index), - 1, - ), - ), - # storage_index - storage_index, - # secrets - secrets, - # tw_vectors - {k: v.for_call() for (k, v) in test_and_write_vectors_for_shares.items()}, - # r_vector - [], - # add_leases - True, - ) - - # The operation should fail. - self.expectThat( - d, - failed( - AfterPreprocessing( - lambda f: f.value, - IsInstance(TypeError), - ), - ), - ) - - # There should be no shares at the given storage index. - d = self.client.slot_readv( - storage_index, - # Surprise. shares=None means all shares. - shares=None, - r_vector=list( - list(map(write_vector_to_read_vector, vector.write_vector)) - for vector in test_and_write_vectors_for_shares.values() - ), - ) - self.expectThat( - d, - succeeded( - Equals({}), - ), - ) - - # And there should be no leases on those non-shares. - self.expectThat( - list(self.anonymous_storage_server.get_slot_leases(storage_index)), - Equals([]), - ) - def assert_read_back_data( self, storage_index, secrets, test_and_write_vectors_for_shares