We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent a2b489d commit 5c386d1Copy full SHA for 5c386d1
1 file changed
client/http_client.py
@@ -59,7 +59,10 @@ async def async_auth_flow(self, request):
59
computed_signature = signing_key.sign([content])
60
signature_ok = received_signature.same_as(computed_signature)
61
if not signature_ok:
62
- # TODO: Give allocation back to pool
+ # If the signature validation fails, we give the allocation for the signing key
63
+ # back to the pool. This is to prevent an attacker exhausting the pool (denial of
64
+ # service) by sending lots of badly signed messages.
65
+ allocation.give_back()
66
raise InvalidSignatureError()
67
68
def __init__(self, local_pool: Pool, peer_pool: Pool):
0 commit comments