File tree Expand file tree Collapse file tree 2 files changed +15
-1
lines changed
Expand file tree Collapse file tree 2 files changed +15
-1
lines changed Original file line number Diff line number Diff line change 7676 # dist: xenial
7777 # sudo: true
7878 # env: PYCRYPTO=true
79+ - python : 3.7
80+ dist : xenial
81+ sudo : true
82+ env : PYCRYPTODOME=true
7983 - python : 2.7
8084 env : GMPY=true
8185 - python : 3.5
@@ -132,6 +136,7 @@ install:
132136 - if [[ $TACKPY == 'true' ]]; then travis_retry pip install tackpy; fi
133137 - if [[ $M2CRYPTO == 'true' ]]; then travis_retry pip install --pre m2crypto; fi
134138 - if [[ $PYCRYPTO == 'true' ]]; then travis_retry pip install pycrypto; fi
139+ - if [[ $PYCRYPTODOME == 'true' ]]; then travis_retry pip install pycryptodome; fi
135140 - if [[ $GMPY == 'true' ]]; then travis_retry pip install gmpy; fi
136141 - travis_retry pip install -r requirements.txt
137142 - if [[ $CC_COV == 'true' ]]; then ./cc-test-reporter before-build; fi
Original file line number Diff line number Diff line change 5050 gmpyLoaded = False
5151
5252#Try to load pycrypto
53+ # pylint: disable=invalid-name
5354try :
5455 import Crypto .Cipher .AES
55- pycryptoLoaded = True
56+ # check if we're not using pycryptodome
57+ try :
58+ # pycrypto defaults to ECB when just key is provided
59+ # pycryptodome requires specifying the mode of operation
60+ Crypto .Cipher .AES .AESCipher (b'2' * (128 // 8 ))
61+ pycryptoLoaded = True
62+ except AttributeError :
63+ pycryptoLoaded = False
5664except ImportError :
5765 pycryptoLoaded = False
66+ # pylint: enable=invalid-name
5867
5968
6069# **************************************************************************
You can’t perform that action at this time.
0 commit comments