fix #675 ECDSA verification fail when padding is added
Signed-off-by: Anthony Liu <antliu@gmail.com>
This commit is contained in:
parent
470e2f3d5b
commit
04630cea43
|
@ -61,6 +61,8 @@ class ECDSA256P1Public(KeyClass):
|
|||
return 72
|
||||
|
||||
def verify(self, signature, payload):
|
||||
# strip possible paddings added during sign
|
||||
signature = signature[:signature[1] + 2]
|
||||
k = self.key
|
||||
if isinstance(self.key, ec.EllipticCurvePrivateKey):
|
||||
k = self.key.public_key()
|
||||
|
|
Loading…
Reference in New Issue