We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9396ca0 commit 72900fcCopy full SHA for 72900fc
tlslite/utils/ecc.py
@@ -20,7 +20,11 @@ def decodeX962Point(data, curve=ecdsa.NIST256p):
20
yCoord = bytesToNumber(parser.getFixBytes(bytelength))
21
if parser.getRemainingLength():
22
raise DecodeError("Invalid length of point encoding for curve")
23
- return ecdsa.ellipticcurve.Point(curve.curve, xCoord, yCoord)
+ if not xCoord or not yCoord:
24
+ raise DecodeError("Zero as key share from peer")
25
+ if not curve.curve.contains_point(xCoord, yCoord):
26
+ raise DecodeError("Key share from peer is not a valid point on curve")
27
+ return ecdsa.ellipticcurve.PointJacobi(curve.curve, xCoord, yCoord, 1)
28
29
30
def encodeX962Point(point):
0 commit comments