Closed Viicos closed 1 year ago
The prepare_key method of ECAlgorithm can return a EllipticCurvePublicKey object, which does not implement the sign method, resulting in an AttributeError when ECAlgorithm.sign is called with this prepared key.
prepare_key
ECAlgorithm
EllipticCurvePublicKey
sign
AttributeError
ECAlgorithm.sign
https://github.com/jpadilla/pyjwt/blob/50c763c67e93b63fb199c4c9b3c4a05ed90b5172/jwt/algorithms.py#L429-L455
Edit: Same thing for the following public keys, used in other algorithm classes: RSAPublicKey, Ed25519PublicKey, Ed448PublicKey.
RSAPublicKey
Ed25519PublicKey
Ed448PublicKey
The
prepare_key
method ofECAlgorithm
can return aEllipticCurvePublicKey
object, which does not implement thesign
method, resulting in anAttributeError
whenECAlgorithm.sign
is called with this prepared key.https://github.com/jpadilla/pyjwt/blob/50c763c67e93b63fb199c4c9b3c4a05ed90b5172/jwt/algorithms.py#L429-L455
Edit: Same thing for the following public keys, used in other algorithm classes:
RSAPublicKey
,Ed25519PublicKey
,Ed448PublicKey
.