You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
==> Starting check()...
test_gcm_aead (unit.test_aead.TestAEAD) ... /startdir/PKGBUILD: line 30: 424 Aborted (core dumped) python -m unittest discover --start-directory tests -v
==> ERROR: A failure occurred in check().
Aborting...
In sodium/crypto_aead_aes256gcm.h I see that mlen_p is a pointer to a 64-bit long long:
int crypto_aead_aes256gcm_decrypt(unsigned char *m,
unsigned long long *mlen_p,
unsigned char *nsec,
const unsigned char *c,
unsigned long long clen,
const unsigned char *ad,
unsigned long long adlen,
const unsigned char *npub,
const unsigned char *k)
In __init.py__ in the 'ctypes' wrapper I see:
mlen = ctypes.c_ulonglong()
..
ret = nacl.crypto_aead_aes256gcm_decrypt(
m, mlen,
None,
ctxt, ctypes.c_ulonglong(len(ctxt)),
aad, ctypes.c_ulonglong(len(aad)),
nonce, key)
...
ret = nacl.crypto_aead_chacha20poly1305_ietf_decrypt(
m, mlen,
None,
ctxt, ctypes.c_ulonglong(len(ctxt)),
aad, ctypes.c_ulonglong(len(aad)),
nonce, key)
...
This works fine on 64-bit, but not on 32-bit. The tests crash with segfault.
When I change the calls to use a ctypes.byref the tests work fine:
ret = nacl.crypto_aead_aes256gcm_decrypt(
m, ctypes.byref(mlen),
None,
ctxt, ctypes.c_ulonglong(len(ctxt)),
aad, ctypes.c_ulonglong(len(aad)),
nonce, key)
...
ret = nacl.crypto_aead_chacha20poly1305_ietf_decrypt(
m, ctypes.byref(mlen),
None,
ctxt, ctypes.c_ulonglong(len(ctxt)),
aad, ctypes.c_ulonglong(len(aad)),
nonce, key)
The text was updated successfully, but these errors were encountered:
andreasbaumann
changed the title
Crash with parameter passing in crypto_aead_aes256gcm_decrypt and rypto_aead_chacha20poly1305_ietf_decrypt
Crash with parameter passing in crypto_aead_aes256gcm_decrypt and crypto_aead_chacha20poly1305_ietf_decrypt
Sep 15, 2017
Tests fail on 32-bit Intel:
In
sodium/crypto_aead_aes256gcm.h
I see thatmlen_p
is a pointer to a 64-bit long long:In
__init.py__
in the 'ctypes' wrapper I see:This works fine on 64-bit, but not on 32-bit. The tests crash with segfault.
When I change the calls to use a
ctypes.byref
the tests work fine:See also debugging session on https://bbs.archlinux32.org/viewtopic.php?pid=219#p219.
The text was updated successfully, but these errors were encountered: