theupdateframework/tuf — pull request #99 by zhengyuyu (2013-08-29 23:17:45+00:00)
Title: Fix the slow retrieval attack issue

download.py: Add a timeout and rewrite the _fileobject.read()

test_slow_retrieval_attack.py: Add a new kind of slow retrieval attack

slow_retrieval_server.py: Modification for new kind of slow retrieval attack

slow retrieval attack test:

(tuf)yuyuzheng@ubuntu:~/Documents/tuf/tuf/tests/system_tests$ python test_slow_retrieval_attack.py
Slow server is active on port: 34911 ...
Communication with slow server aborted. Terminate the slow server.

mode_1 Slow Retrieval Attack was Successful!

Slow server is active on port: 34776 ...
Communication with slow server aborted. Terminate the slow server.

mode_2 Slow Retrieval Attack was Successful!

Slow server is active on port: 42898 ...
TUF ...
Download exits with timed out! Successfully avoid slow retrieval attack!

Communication with slow server aborted. Terminate the slow server.

Slow server is active on port: 43668 ...
TUF ...
Download exits with Unable to update 'timestamp.txt'.! Successfully avoid slow retrieval attack!

Communication with slow server aborted. Terminate the slow server.