-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
mpi_write_hlp is not efficient and can cause stack overflow #2190
Labels
Comments
RonEld
added
bug
tracking
component-crypto
Crypto primitives and low-level interfaces
labels
Nov 13, 2018
ARM Internal Ref: IOTSSL-2627 |
RonEld
pushed a commit
to RonEld/mbedtls
that referenced
this issue
Nov 20, 2018
Refactor `mpi_write_hlp()` to not be recursive, to fix stack overflows. Iterate over the `mbedtls_mpi` division of the radix requested, until it is zero. Each iteration, put the residue in the next LSB of the output buffer. Fixes Mbed-TLS#2190
RonEld
pushed a commit
to RonEld/mbedtls
that referenced
this issue
Nov 20, 2018
Refactor `mpi_write_hlp()` to not be recursive, to fix stack overflows. Iterate over the `mbedtls_mpi` division of the radix requested, until it is zero. Each iteration, put the residue in the next LSB of the output buffer. Fixes Mbed-TLS#2190
4 tasks
RonEld
pushed a commit
to RonEld/mbedtls
that referenced
this issue
Nov 27, 2018
Refactor `mpi_write_hlp()` to not be recursive, to fix stack overflows. Iterate over the `mbedtls_mpi` division of the radix requested, until it is zero. Each iteration, put the residue in the next LSB of the output buffer. Fixes Mbed-TLS#2190
RonEld
pushed a commit
to RonEld/mbedtls
that referenced
this issue
Nov 27, 2018
Refactor `mpi_write_hlp()` to not be recursive, to fix stack overflows. Iterate over the `mbedtls_mpi` division of the radix requested, until it is zero. Each iteration, put the residue in the next LSB of the output buffer. Fixes Mbed-TLS#2190
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Description
mpi_write_hlp is not efficient and can cause stack overflow.
It is a recursive function, and depending on the mpi given.
Bug
OS
Mbed OS
mbed TLS build:
Version: 2.13.1
OS version: 5.10
Expected behavior
test to succeed and not crash
Actual behavior
On Target Test :
features-mbedtls-tests-mbedtls-test_suite_mpi
causes stack overflow, in this function.Steps to reproduce
Run features-mbedtls-tests-mbedtls-test_suite_mpi On Target Test. ( tested on NRF52840_DK platform)
The text was updated successfully, but these errors were encountered: