Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Z
ZKAPAuthorizer
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
Administrator
ZKAPAuthorizer
Commits
2f9b4364
Commit
2f9b4364
authored
3 years ago
by
Jean-Paul Calderone
Browse files
Options
Downloads
Patches
Plain Diff
black and isort
parent
4fb2546a
No related branches found
Branches containing commit
No related tags found
1 merge request
!272
Defend against the length-contraction slot_testv_and_readv_and_writev DoS
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/_zkapauthorizer/tests/test_storage_server.py
+8
-4
8 additions, 4 deletions
src/_zkapauthorizer/tests/test_storage_server.py
with
8 additions
and
4 deletions
src/_zkapauthorizer/tests/test_storage_server.py
+
8
−
4
View file @
2f9b4364
...
...
@@ -24,14 +24,14 @@ from time import time
from
allmydata.storage.mutable
import
MutableShareFile
from
challenge_bypass_ristretto
import
random_signing_key
from
foolscap.referenceable
import
LocalReferenceable
from
hypothesis
import
given
,
note
,
assume
from
hypothesis
import
assume
,
given
,
note
from
hypothesis.strategies
import
integers
,
just
,
lists
,
one_of
,
tuples
from
testtools
import
TestCase
from
testtools.matchers
import
AfterPreprocessing
,
Equals
,
MatchesAll
from
twisted.internet.task
import
Clock
from
twisted.python.runtime
import
platform
from
.._storage_server
import
_ValidationResult
,
NewLengthRejected
from
.._storage_server
import
NewLengthRejected
,
_ValidationResult
from
..api
import
MorePassesRequired
,
ZKAPAuthorizerStorageServer
from
..storage_common
import
(
add_lease_message
,
...
...
@@ -440,7 +440,12 @@ class PassValidationTests(TestCase):
new_length
=
integers
(),
)
def
test_mutable_new_length_rejected
(
self
,
storage_index
,
secrets
,
sharenums
,
test_and_write_vectors_for_shares
,
new_length
,
self
,
storage_index
,
secrets
,
sharenums
,
test_and_write_vectors_for_shares
,
new_length
,
):
"""
If ``new_length`` is not ``None`` then ``slot_testv_and_readv_and_writev``
...
...
@@ -483,7 +488,6 @@ class PassValidationTests(TestCase):
else
:
self
.
fail
(
"
expected a failure but got {!r}
"
.
format
(
result
))
@given
(
storage_index
=
storage_indexes
(),
secrets
=
tuples
(
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment