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

segmentation fault in AESNI_decrypt.part.1 #199

Closed
Luro02 opened this issue Aug 17, 2018 · 1 comment
Closed

segmentation fault in AESNI_decrypt.part.1 #199

Luro02 opened this issue Aug 17, 2018 · 1 comment

Comments

@Luro02
Copy link

Luro02 commented Aug 17, 2018

this issue is very similiar to #198

PoC:

#!/usr/bin/env python3
from Cryptodome.Cipher import AES # conda install pycryptodomex

key_0 = bytearray.fromhex('00000000000000000000000000000000')
src_0 = bytearray.fromhex('00000000000000000000000000000000')
key_1 = bytearray.fromhex('000000000000000000000000000000')
src_1 = bytearray.fromhex('00000000000000000000000000000000')

aes_key = AES.new(key_0, AES.MODE_ECB).decrypt(src_0)
AES.new(aes_key, AES.MODE_ECB).decrypt(key_1)

GDB:

(gdb) run test.py
Starting program: /home/lucas/miniconda3/bin/python test.py
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".

Program received signal SIGSEGV, Segmentation fault.
0x00007fffef1e1598 in AESNI_decrypt.part.1 ()
   from /home/lucas/miniconda3/lib/python3.6/site-packages/Cryptodome/Util/../Cipher/_raw_aesni.cpython-36m-x86_64-linux-gnu.so
(gdb) backtrace
#0  0x00007fffef1e1598 in AESNI_decrypt.part.1 ()
   from /home/lucas/miniconda3/lib/python3.6/site-packages/Cryptodome/Util/../Cipher/_raw_aesni.cpython-36m-x86_64-linux-gnu.so
#1  0x00007ffff2d53ec0 in ffi_call_unix64 ()
   from /home/lucas/miniconda3/lib/python3.6/lib-dynload/../../libffi.so.6
#2  0x00007ffff2d5387d in ffi_call ()
   from /home/lucas/miniconda3/lib/python3.6/lib-dynload/../../libffi.so.6
#3  0x00007ffff202daf4 in cdata_call ()
   from /home/lucas/miniconda3/lib/python3.6/site-packages/_cffi_backend.cpython-36m-x86_64-linux-gnu.so
#4  0x0000555555663bcb in _PyObject_FastCallDict ()
#5  0x00005555556f0f4e in call_function ()
#6  0x000055555571594a in _PyEval_EvalFrameDefault ()
#7  0x00005555556eaf8b in fast_function ()
#8  0x00005555556f0ed5 in call_function ()
#9  0x000055555571594a in _PyEval_EvalFrameDefault ()
#10 0x00005555556eaf8b in fast_function ()
#11 0x00005555556f0ed5 in call_function ()
#12 0x000055555571594a in _PyEval_EvalFrameDefault ()
#13 0x00005555556eaf8b in fast_function ()
#14 0x00005555556f0ed5 in call_function ()
#15 0x000055555571594a in _PyEval_EvalFrameDefault ()
#16 0x00005555556ebcb9 in PyEval_EvalCodeEx ()
#17 0x00005555556eca4c in PyEval_EvalCode ()
#18 0x0000555555768c44 in run_mod ()
---Type <return> to continue, or q <return> to quit---
#19 0x0000555555769041 in PyRun_FileExFlags ()
#20 0x0000555555769244 in PyRun_SimpleFileExFlags ()
#21 0x000055555576cd24 in Py_Main ()
#22 0x000055555563475e in main ()

@Luro02 Luro02 closed this as completed Aug 17, 2018
@Luro02
Copy link
Author

Luro02 commented Aug 17, 2018

fixed with commit d1739c6

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