-
Notifications
You must be signed in to change notification settings - Fork 481
Description
Describe the bug
I'm trying to add sha256+rsa2048 signature authentification to the KhiCAS launcher external app (like I did for the Casio Graph 90/fxcg50)
https://www-fourier.univ-grenoble-alpes.fr/~parisse/numworks/launch.tgz
but if I enable signature check then there is a crash (reset) immediatly after the end of check_signature.
To Reproduce
Build the launcher app and install khicas.nwa on your calc, it runs OK (assuming KhiCAS is installed in slot B).
Enable signature check by uncommenting #define WITH_SIGNATURE at the beginning of src/main.cpp, uncomment #define DEBUG as well to see the debug messages, build again, now it crashes immediatly after leaving the function check_signature.
Observe that the crash does not happen during crypto operations, the values displayed are correct inside check_signature. These operations should work OK since it's the same code as on the Casio (sha code is from MicroPython, and I tried with 2 big integers libraries, tommath and GMP, GMP is working since it is used inside KhiCAS).
But between the return instruction in check_signature and the next instruction in main, it crashes and resets. I have no idea what's happening and how to further investigate the issue. Could it be a stack overflow? Or something related to the "unusual" link process?
Environment
N0120 device with Epsilon 24 beta