python-jose icon indicating copy to clipboard operation
python-jose copied to clipboard

Use correct iv size (#281)

Open jkamp-aws opened this issue 3 years ago • 3 comments

Use a 12 byte IV for GCM based algorithms and 16 byte IV for CBC based ones. This makes a JWE compatible with other libraries based on OpenSSL which can only use a 12 byte IV for GCM.

jkamp-aws avatar Aug 24 '22 08:08 jkamp-aws

Would be nice if this could be merged as it fixes #281, @mpdavis?

floxay avatar Aug 28 '23 13:08 floxay

Please fix it, this problem is very annoying

mikhaililin21027 avatar Nov 01 '23 15:11 mikhaililin21027

Confirming this issue is preventing validation of generated JWEs for non-CBC algorithms.

TBoshoven avatar Apr 05 '24 18:04 TBoshoven

Folks - is there a concern for resolving this issue?

I've opened the following issue for jose here: https://github.com/panva/jose/issues/678

However, the primary maintainer of that package (who also opened this issue) has identified that python-jose is not following the RFC spec for JWE. It seems like this package should follow the specification. If there is no concern for following the JWE spec to adhere to the IV length requirements for AES GCM modes, can we merge this?

There are only two block cipher modes supported in backends/cryptography_backend.py today: https://github.com/twwildey/python-jose/blob/master/jose/backends/cryptography_backend.py#L424

As such, this change should be safe to merge. Can we please illustrate our concerns/problems so that this can be fixed promptly?

(This replicates my comment from https://github.com/mpdavis/python-jose/issues/281 here)

twwildey avatar May 28 '24 19:05 twwildey

@panva @mikhaililin21027 Any advice on how we can fix these linting issues that are blocking a merge?

twwildey avatar May 29 '24 16:05 twwildey

Any advice on how we can fix these linting issues that are blocking a merge?

I'm not a maintainer here.

panva avatar May 29 '24 16:05 panva

I've created another PR with an equivalent change: https://github.com/mpdavis/python-jose/pull/355

twwildey avatar May 29 '24 22:05 twwildey

I have merged changes from the other PR. As such, I am closing this PR in favor of https://github.com/mpdavis/python-jose/pull/355.

twwildey avatar May 30 '24 01:05 twwildey