Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cjose_base64url_decode returns inconsistent output #86

Open
divyaraghavendran opened this issue Apr 2, 2019 · 0 comments
Open

cjose_base64url_decode returns inconsistent output #86

divyaraghavendran opened this issue Apr 2, 2019 · 0 comments

Comments

@divyaraghavendran
Copy link

I am using the cjose library to create a JWT which will be used while exchanging information with a third-party client.

I found that sometimes, the library returns the below error:
JWT library error: invalid argument in file:jwe.c and func:_cjose_jwe_set_cek_aes_cbc
and line:448
This happens on my call to cjose_jwe_encrypt(jwk, header, (uint8_t*)compact_jws, comp_jws_len, &err);

I traced down the problem, and what I found was the value returned from cjose_base64url_decode() sometimes changes i.e. the output string value returned changes randomly, even though the provided input and inlen remains the same.
I cannot find any reason for this return value to vary even though the input remains constant.

Would it be possible to provide a fix for this or a workaround?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant