From 9d33a59b609d04c129396dba4ddb56d2cee07f97 Mon Sep 17 00:00:00 2001 From: clowwindy Date: Wed, 10 Dec 2014 23:15:24 +0800 Subject: [PATCH] add libsodium tests --- .travis.yml | 3 +++ tests/chacha20.json | 10 ++++++++++ tests/libsodium/install.sh | 9 +++++++++ tests/salsa20-ctr.json | 10 ++++++++++ tests/salsa20.json | 2 +- 5 files changed, 33 insertions(+), 1 deletion(-) create mode 100644 tests/chacha20.json create mode 100755 tests/libsodium/install.sh create mode 100644 tests/salsa20-ctr.json diff --git a/.travis.yml b/.travis.yml index 286c5df..4a11a47 100644 --- a/.travis.yml +++ b/.travis.yml @@ -13,6 +13,7 @@ before_install: - sudo apt-get install -qq build-essential libssl-dev swig python-m2crypto python-numpy dnsutils - pip install m2crypto salsa20 pep8 pyflakes nose - sudo tests/socksify/install.sh + - sudo tests/libsodium/install.sh script: - pep8 . - pyflakes . @@ -24,6 +25,8 @@ script: - python tests/test.py -c tests/aes-cfb8.json - python tests/test.py -c tests/rc4-md5.json - python tests/test.py -c tests/salsa20.json + - python tests/test.py -c tests/chacha20.json + - python tests/test.py -c tests/salsa20-ctr.json - python tests/test.py -c tests/table.json - python tests/test.py -c tests/server-multi-ports.json - python tests/test.py -s tests/server-multi-passwd.json -c tests/server-multi-passwd-client-side.json diff --git a/tests/chacha20.json b/tests/chacha20.json new file mode 100644 index 0000000..541a9be --- /dev/null +++ b/tests/chacha20.json @@ -0,0 +1,10 @@ +{ + "server":"127.0.0.1", + "server_port":8388, + "local_port":1081, + "password":"salsa20_password", + "timeout":60, + "method":"chacha20", + "local_address":"127.0.0.1", + "fast_open":false +} diff --git a/tests/libsodium/install.sh b/tests/libsodium/install.sh new file mode 100755 index 0000000..be57b90 --- /dev/null +++ b/tests/libsodium/install.sh @@ -0,0 +1,9 @@ +#!/bin/bash + +if [ ! -d libsodium-1.0.1 ]; then + wget https://github.com/jedisct1/libsodium/releases/download/1.0.1/libsodium-1.0.1.tar.gz || exit 1 + tar xf libsodium-1.0.1.tar.gz || exit 1 +fi +pushd libsodium-1.0.1 +./configure && make && make install || exit 1 +popd diff --git a/tests/salsa20-ctr.json b/tests/salsa20-ctr.json new file mode 100644 index 0000000..5ca6c45 --- /dev/null +++ b/tests/salsa20-ctr.json @@ -0,0 +1,10 @@ +{ + "server":"127.0.0.1", + "server_port":8388, + "local_port":1081, + "password":"salsa20_password", + "timeout":60, + "method":"salsa20-ctr", + "local_address":"127.0.0.1", + "fast_open":false +} diff --git a/tests/salsa20.json b/tests/salsa20.json index 5ca6c45..7e30380 100644 --- a/tests/salsa20.json +++ b/tests/salsa20.json @@ -4,7 +4,7 @@ "local_port":1081, "password":"salsa20_password", "timeout":60, - "method":"salsa20-ctr", + "method":"salsa20", "local_address":"127.0.0.1", "fast_open":false }