IdentityPython / pyjwkest

Implementation of JWT, JWS, JWE and JWK
Apache License 2.0
94 stars 55 forks source link

ECKey serialize may create invalid JWKS parameters #98

Open schlenk opened 4 years ago

schlenk commented 4 years ago

Take a key for P-256 with x=24014791858128669844935517199947753409425201576699879295797457599559336031L

The jwkest.long2intarr() method turns that into an array of just 31 instead of 32 octets, which is too short for the base64 encoded value put into a JWKS file.

This can lead to problems when other libraries try to use that key, the pyjwkest library roundtrips it just fine.