duo-labs / py_webauthn

Pythonic WebAuthn 🐍
https://duo-labs.github.io/py_webauthn
BSD 3-Clause "New" or "Revised" License
856 stars 171 forks source link

Fix verification on Python 3 before 3.6 #64

Closed dsanders11 closed 4 years ago

dsanders11 commented 4 years ago

json.loads only supports bytes on Python 3.6+

nickmooney commented 4 years ago

Thanks for the PR, @dsanders11! I'm ready to merge it -- do you know off the top of your head if the calls to json.loads on assertion_client_extensions and registration_client_extensions might also be affected by this issue?

dsanders11 commented 4 years ago

@nickmooney, quite possibly. Since those values are supplied by the user of the library, though, it's less of an issue as the decode can be done by the developer. The ones in this PR are internal to the library and can't be worked around.

It wouldn't hurt to do a check like in _webauthn_b64_decode and decode if needed, but I'm not sure it's necessary.

nickmooney commented 4 years ago

Good stuff. Thank you for the PR!