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

error when decrypting JWTs on big endian architectures (mips,powerpc,sparc) #18

Closed
zandbelt opened this issue Aug 3, 2014 · 3 comments

Comments

@zandbelt
Copy link
Member

zandbelt commented Aug 3, 2014

test code 'test_jwt_decryption' fails on big endian architectures (mips, powerpc, sparc):

| `/usr/bin/apxs2 -q CC`  -DLINUX -D_REENTRANT -D_GNU_SOURCE -D_LARGEFILE64_SOURCE -I/usr/include/apr-1.0   -Isrc -o test/test test/*.c src/jose/apr_jwt.c src/jose/apr_jwk.c src/jose/apr_jws.c src/jose/apr_jwe.c -lapr-1 -laprutil-1 -lldap -llber  -lssl -lcrypto  -ljansson 
| test/test
| Failed:  # test_jwt_decryption: error in apr_jwe_decrypt_jwt: result "0" != expected "1"
| make[1]: *** [test] Error 1 
@latinovic
Copy link
Contributor

Hi,
adding following linein apr_jwe.c for BE
solves this issue for me.

else 
memcpy(p, &al, sizeof(uint64_t));

@latinovic
Copy link
Contributor

I will create pull request with needed changes.

latinovic added a commit to latinovic/mod_auth_openidc that referenced this issue Aug 5, 2014
  - For big endian, p does not get info about
  Additional Authentication Data length (al).
  - Run test_jwt_decryption.
zandbelt pushed a commit that referenced this issue Aug 9, 2014
@zandbelt zandbelt closed this as completed Aug 9, 2014
@zandbelt zandbelt reopened this Aug 9, 2014
@zandbelt
Copy link
Member Author

zandbelt commented Aug 9, 2014

closed in 5353424

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

2 participants