mirror of
https://github.com/yuzu-emu/mbedtls.git
synced 2025-01-31 04:41:02 +00:00
Add mpi_sub_abs negative tests with a larger-in-size second operand
Add test cases for mbedtls_mpi_sub_abs() where the second operand has more limbs than the first operand (which, if the extra limbs are not all zero, implies that the function returns MBEDTLS_ERR_MPI_NEGATIVE_VALUE). This exposes a buffer overflow (reported in #4042). Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
This commit is contained in:
parent
5d453ee882
commit
9a3cf3174d
|
@ -472,18 +472,30 @@ mbedtls_mpi_add_int:10:"20395687835640197740576586692903457728019399331434826309
|
|||
Test mbedtls_mpi_add_int #2
|
||||
mbedtls_mpi_add_int:10:"2039568783564019774057658669290345772801939933143482630947726464532830627227012776329":-9871232:10:"2039568783564019774057658669290345772801939933143482630947726464532830627227002905097"
|
||||
|
||||
Base test mbedtls_mpi_sub_abs #1 (Test with larger second input)
|
||||
Base test mbedtls_mpi_sub_abs #1 (|B| > |A|)
|
||||
mbedtls_mpi_sub_abs:10:"5":10:"7":10:"0":MBEDTLS_ERR_MPI_NEGATIVE_VALUE
|
||||
|
||||
Base test mbedtls_mpi_sub_abs #2 (Test with larger second input)
|
||||
Base test mbedtls_mpi_sub_abs #2 (|B| > |A|)
|
||||
mbedtls_mpi_sub_abs:10:"-5":10:"-7":10:"0":MBEDTLS_ERR_MPI_NEGATIVE_VALUE
|
||||
|
||||
Base test mbedtls_mpi_sub_abs #3 (Test with larger second input)
|
||||
Base test mbedtls_mpi_sub_abs #3 (|B| > |A|)
|
||||
mbedtls_mpi_sub_abs:10:"-5":10:"7":10:"0":MBEDTLS_ERR_MPI_NEGATIVE_VALUE
|
||||
|
||||
Base test mbedtls_mpi_sub_abs #4 (Test with larger second input)
|
||||
Base test mbedtls_mpi_sub_abs #4 (|B| > |A|)
|
||||
mbedtls_mpi_sub_abs:10:"5":10:"-7":10:"0":MBEDTLS_ERR_MPI_NEGATIVE_VALUE
|
||||
|
||||
Base test mbedtls_mpi_sub_abs #1 (|B| >> |A| with more limbs)
|
||||
mbedtls_mpi_sub_abs:10:"5":16:"123456789abcdef01":10:"0":MBEDTLS_ERR_MPI_NEGATIVE_VALUE
|
||||
|
||||
Base test mbedtls_mpi_sub_abs #2 (|B| >> |A| with more limbs)
|
||||
mbedtls_mpi_sub_abs:10:"-5":16:"-123456789abcdef01":10:"0":MBEDTLS_ERR_MPI_NEGATIVE_VALUE
|
||||
|
||||
Base test mbedtls_mpi_sub_abs #3 (|B| >> |A| with more limbs)
|
||||
mbedtls_mpi_sub_abs:10:"-5":16:"123456789abcdef01":10:"0":MBEDTLS_ERR_MPI_NEGATIVE_VALUE
|
||||
|
||||
Base test mbedtls_mpi_sub_abs #4 (|B| >> |A| with more limbs)
|
||||
mbedtls_mpi_sub_abs:10:"5":16:"-123456789abcdef01":10:"0":MBEDTLS_ERR_MPI_NEGATIVE_VALUE
|
||||
|
||||
Base test mbedtls_mpi_sub_abs #1
|
||||
mbedtls_mpi_sub_abs:10:"7":10:"5":10:"2":0
|
||||
|
||||
|
|
Loading…
Reference in a new issue