Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,11 @@ before_install:
- git fetch origin master:refs/remotes/origin/master
- curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
- chmod +x ./cc-test-reporter
- pushd "$(mktemp -d)"
- git clone https://github.com/tomato42/python-ecdsa.git
- cd python-ecdsa
- python setup.py install
- popd

install:
- if [[ -e build-requirements-${TRAVIS_PYTHON_VERSION}.txt ]]; then travis_retry pip install -r build-requirements-${TRAVIS_PYTHON_VERSION}.txt; else travis_retry pip install -r build-requirements.txt; fi
Expand Down
9 changes: 7 additions & 2 deletions tlslite/utils/ecc.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,13 @@ def decodeX962Point(data, curve=ecdsa.NIST256p):
yCoord = bytesToNumber(parser.getFixBytes(bytelength))
if parser.getRemainingLength():
raise DecodeError("Invalid length of point encoding for curve")
return ecdsa.ellipticcurve.Point(curve.curve, xCoord, yCoord)

if not xCoord or not yCoord:
raise DecodeError("Zero as key share from peer")
if not curve.curve.contains_point(xCoord, yCoord):
raise DecodeError("Key share from peer is not a valid point on curve")
# pylint: disable=c-extension-no-member
return ecdsa.ellipticcurve.PointJacobi(curve.curve, xCoord, yCoord, 1)
# pylint: enable=c-extension-no-member

def encodeX962Point(point):
"""Encode a point in X9.62 format"""
Expand Down