Merge pull request #431 from wolfgang/patch-1

Don't hash data passed to nacl library in Ed25519PublicKey.verify
This commit is contained in:
Kevin Mai-Husan Chia 2021-03-17 15:45:46 +08:00 committed by GitHub
commit d2c2a5f933
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -24,9 +24,8 @@ class Ed25519PublicKey(PublicKey):
def verify(self, data: bytes, signature: bytes) -> bool: def verify(self, data: bytes, signature: bytes) -> bool:
verify_key = VerifyKey(self.to_bytes()) verify_key = VerifyKey(self.to_bytes())
h = SHA256.new(data)
try: try:
verify_key.verify(h, signature) verify_key.verify(data, signature)
except BadSignatureError: except BadSignatureError:
return False return False
return True return True