mirror of https://github.com/Yubico/python-fido2
Fix curve check for ES384 and ES512 verify().
Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
This commit is contained in:
parent
963eae041a
commit
e82f231da9
|
@ -150,7 +150,7 @@ class ES384(CoseKey):
|
|||
_HASH_ALG = hashes.SHA384()
|
||||
|
||||
def verify(self, message, signature):
|
||||
if self[-1] != 1:
|
||||
if self[-1] != 2:
|
||||
raise ValueError("Unsupported elliptic curve")
|
||||
ec.EllipticCurvePublicNumbers(
|
||||
bytes2int(self[-2]), bytes2int(self[-3]), ec.SECP384R1()
|
||||
|
@ -177,7 +177,7 @@ class ES512(CoseKey):
|
|||
_HASH_ALG = hashes.SHA512()
|
||||
|
||||
def verify(self, message, signature):
|
||||
if self[-1] != 1:
|
||||
if self[-1] != 3:
|
||||
raise ValueError("Unsupported elliptic curve")
|
||||
ec.EllipticCurvePublicNumbers(
|
||||
bytes2int(self[-2]), bytes2int(self[-3]), ec.SECP521R1()
|
||||
|
|
Loading…
Reference in New Issue