Skip to content

Commit

Permalink
Merge d5269a3 into 9912a51
Browse files Browse the repository at this point in the history
  • Loading branch information
tomato42 committed May 25, 2020
2 parents 9912a51 + d5269a3 commit defeb7d
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,10 @@ matrix:
dist: xenial
sudo: true
env: PYCRYPTO=true
- python: 3.7
dist: xenial
sudo: true
env: PYCRYPTODOME=true
- python: 2.7
env: GMPY=true
- python: 3.4
Expand Down Expand Up @@ -122,6 +126,7 @@ install:
- if [[ $TACKPY == 'true' ]]; then travis_retry pip install tackpy; fi
- if [[ $M2CRYPTO == 'true' ]]; then travis_retry pip install --pre m2crypto; fi
- if [[ $PYCRYPTO == 'true' ]]; then travis_retry pip install pycrypto; fi
- if [[ $PYCRYPTODOME == 'true' ]]; then travis_retry pip install pycryptodome; fi
- if [[ $GMPY == 'true' ]]; then travis_retry pip install gmpy; fi
- travis_retry pip install -r requirements.txt
- if [[ $CC_COV == 'true' ]]; then ./cc-test-reporter before-build; fi
Expand Down
9 changes: 8 additions & 1 deletion tlslite/utils/cryptomath.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,18 @@
gmpyLoaded = False

#Try to load pycrypto
# pylint: disable=invalid-name
try:
import Crypto.Cipher.AES
pycryptoLoaded = True
# check if we're not using pycryptodome
try:
Crypto.Cipher.AES.AESCipher(b'2' * (128//8))
pycryptoLoaded = True
except AttributeError:
pycryptoLoaded = False
except ImportError:
pycryptoLoaded = False
# pylint: enable=invalid-name


# **************************************************************************
Expand Down

0 comments on commit defeb7d

Please sign in to comment.