lint code

This commit is contained in:
clowwindy 2014-10-31 16:14:28 +08:00
parent c553e7a725
commit 89dc6031e8
2 changed files with 8 additions and 6 deletions

View File

@ -9,10 +9,11 @@ cache:
before_install:
- sudo apt-get update -qq
- sudo apt-get install -qq build-essential libssl-dev swig python-m2crypto python-numpy dnsutils
- pip install m2crypto salsa20 pep8 nose
- pip install m2crypto salsa20 pep8 pyflakes nose
- sudo tests/socksify/install.sh
script:
- pep8 .
- pyflakes .
- python tests/nose_plugin.py
- python tests/test.py -c tests/table.json
- python tests/test.py -c tests/aes.json

View File

@ -21,19 +21,20 @@
# SOFTWARE.
import logging
from ctypes import CDLL, c_char_p, c_int, c_long, byref,\
create_string_buffer, c_void_p
__all__ = ['ciphers']
libcrypto = None
loaded = False
buf_size = 2048
def load_openssl():
global loaded, libcrypto, CDLL, c_char_p, c_int, c_long, byref,\
create_string_buffer, c_void_p, buf
from ctypes import CDLL, c_char_p, c_int, c_long, byref,\
create_string_buffer, c_void_p
global loaded, libcrypto, buf
from ctypes.util import find_library
for p in ('crypto', 'eay32', 'libeay32'):
libcrypto_path = find_library(p)
@ -152,7 +153,7 @@ def test():
BLOCK_SIZE = 16384
rounds = 1 * 1024
plain = urandom(BLOCK_SIZE * rounds)
import M2Crypto.EVP
# import M2Crypto.EVP
# cipher = M2Crypto.EVP.Cipher('aes_128_cfb', 'k' * 32, 'i' * 16, 1,
# key_as_bytes=0, d='md5', salt=None, i=1,
# padding=1)