Skip to content
Snippets Groups Projects
Commit a442f03a authored by Martin Lees's avatar Martin Lees
Browse files

Fix signature + extension

parent 27175eec
No related branches found
No related tags found
1 merge request!2Feature/update proposal extensions
...@@ -326,7 +326,7 @@ class UpdateProposalEndDate(GrapheneObject): ...@@ -326,7 +326,7 @@ class UpdateProposalEndDate(GrapheneObject):
super(UpdateProposalEndDate, self).__init__( super(UpdateProposalEndDate, self).__init__(
OrderedDict([ OrderedDict([
('end_date', PointInTime(kwargs["end_date"])), ('end_date', PointInTime(kwargs['update_proposal_end_date'])),
])) ]))
......
...@@ -103,7 +103,13 @@ def recover_public_key(digest, signature, i, message=None): ...@@ -103,7 +103,13 @@ def recover_public_key(digest, signature, i, message=None):
if not isinstance(message, bytes_types): if not isinstance(message, bytes_types):
message = py23_bytes(message, "utf-8") message = py23_bytes(message, "utf-8")
sigder = encode_dss_signature(r, s) sigder = encode_dss_signature(r, s)
public_key = ec.EllipticCurvePublicNumbers(Q._Point__x, Q._Point__y, ec.SECP256K1()).public_key(default_backend()) try:
public_key = ec.EllipticCurvePublicNumbers(Q._Point__x, Q._Point__y, ec.SECP256K1()).public_key(
default_backend())
except:
Q_point = Q.to_affine()
public_key = ec.EllipticCurvePublicNumbers(int(Q_point.x()), int(Q_point.y()), ec.SECP256K1()).public_key(
default_backend())
public_key.verify(sigder, message, ec.ECDSA(hashes.SHA256())) public_key.verify(sigder, message, ec.ECDSA(hashes.SHA256()))
return public_key return public_key
else: else:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment