mbedtls/ChangeLog.d
Nick Child b6d5693be2 pk.c: Ensure hash_len equals hash in pk_hashlen_helper
The function `pk_hashlen_helper` exists to ensure a valid hash_len is
used in pk_verify and pk_sign functions. This function has been
used to adjust to the corrsponding hash_len if the user passes in 0
for the hash_len argument based on the md algorithm given. If the user
does not pass in 0 as the hash_len, then it is not adjusted. This is
problematic if the user gives a hash_len and hash buffer that is less than the
associated length of the md algorithm. This error would go unchecked
and eventually lead to buffer overread when given to specific pk_sign/verify
functions, since they both ignore the hash_len argument if md_alg is not MBEDTLS_MD_NONE.

This commit, adds a conditional to `pk_hashlen_helper` so that an
error is thrown if the user specifies a hash_length (not 0) and it is
not equal to the expected for the associated message digest algorithm.
This aligns better with the api documentation where it states "If
hash_len is 0, then the length associated with md_alg is used instead,
or an error returned if it is invalid"

Signed-off-by: Nick Child <nick.child@ibm.com>
Signed-off-by: Nayna Jain <nayna@linux.ibm.com>
2021-06-29 09:31:06 -04:00
..
00README.md 2.24.0 is still covered by the old policy 2020-10-01 00:35:49 +02:00
add-missing-parenthesis.txt Improve changelog entry for #4217 2021-04-27 17:08:26 +01:00
aescrypt2.txt Remove the sample program aescrypt2 2021-04-28 15:57:30 +02:00
allow_alt_cmac_without_des.txt Add documentation for change in CMAC self-test behaviour 2021-04-30 10:09:52 +02:00
aria-alt.txt Changelog entry for the ARIA_ALT and CAMELLIA_ALT fixes 2021-05-25 18:45:04 +02:00
bugfix_PR3616.txt Changelog update #3175 2020-09-27 23:51:21 +03:00
ciphersuite-sha1-sha384-guard.txt Fix dependency for TLS-RSA-WITH-CAMELLIA-256-GCM-SHA384 2021-05-19 16:57:40 +02:00
ciphersuite-sha384-guard.txt Fix dependencies on SHA384 cipher suites 2021-05-19 16:58:08 +02:00
dhm_min_bitlen.txt Enforce dhm_min_bitlen exactly, not just the byte size 2021-04-01 14:20:03 +02:00
dtls_sample_use_read_timeout.txt Actually use the READ_TIMEOUT_MS in the sample DTLS client and server 2021-03-15 16:43:08 -04:00
ecp-window-size.txt Reduce the default ECP window size 2021-06-07 21:27:51 +02:00
ensure_hash_len_is_valid.txt pk.c: Ensure hash_len equals hash in pk_hashlen_helper 2021-06-29 09:31:06 -04:00
fix-invalid-id-error-code.txt Add change log 2021-04-01 14:55:04 +02:00
fix-mingw-build.txt fix changelog entry 2021-05-12 14:37:24 -04:00
fix-pk-parse-key-error-code.txt Fix an incorrect error code addition in pk_parse_key_pkcs8_unencrypted_der 2021-04-15 11:19:56 +01:00
fix-printf-specifiers.txt Improve wording of ChangeLog entry 2021-03-10 17:14:10 +00:00
fix-ssl-cf-hmac-alt.txt Fix misuse of MD API in SSL constant-flow HMAC 2021-05-19 10:40:02 +02:00
fix_memsan_build_clang11.txt Fix memsan build with clang 11 2021-03-05 14:24:03 +00:00
fix_return_type_for_invalid_crypto_key.txt Add Change log entry for bug fix. 2021-04-01 10:01:32 +01:00
host_test-int32.txt Fix build error when int32_t is not int 2021-05-18 16:43:00 +02:00
issue1792.txt Fix Changelog, add separate test functions for hash of all-zero bits 2021-04-07 19:16:18 +02:00
issue4176.txt Reword changelog - Test Resource Leak 2021-06-21 16:57:28 +01:00
make-generate-tests-python.txt Changelog entry for no longer explicitly invoking python2 2021-05-06 11:35:18 +02:00
mbed-can-do-timing.txt config: Allow Mbed to implement TIMING_C 2021-06-09 14:09:11 +01:00
mbedtls_debug_print_mpi.txt Simplify mbedtls_debug_print_mpi and fix the case of empty bignums 2021-06-07 21:41:59 +02:00
mpi_exp_mod-zero.txt Changelog for the fix to mbedtls_mpi_exp_mod(A=0) 2021-06-22 12:39:17 +02:00
mpi_gcd-0.txt mbedtls_mpi_gcd: fix the case B==0 2021-06-22 12:39:17 +02:00
mpi_random.txt Changelog entry for adding mbedtls_mpi_random() 2021-06-02 21:31:24 +02:00
mpi_read_negative_zero.txt Fix multiplication producing a negative zero 2021-06-22 12:39:17 +02:00
mpi_read_zero.txt Changelog entry for the mbedtls_mpi_read_xxx changes 2021-06-22 12:39:17 +02:00
one-shot-mac.txt Add change log 2021-06-22 13:43:13 +02:00
pkcs1_v21_sign_ext.txt Removed trailing whitespace 2021-01-10 15:40:33 +01:00
posix-define.txt Add changelog for posix definition 2021-05-12 15:00:55 -06:00
psa-aead-output-size-macros-1.0.txt Update changelog 2021-04-27 04:41:43 +02:00
psa-builtin-keys-implementation.txt Add changelog for MBEDTLS_PSA_CRYPTO_BUILTIN_KEYS 2021-04-15 15:06:52 +02:00
psa-read-only-keys.txt Refuse to destroy read-only keys 2021-05-28 12:53:15 +02:00
psa-rsa-verify-alt-fix.txt Add ChangeLog entry 2021-06-22 12:57:05 +02:00
psa-without-genprime-fix.txt psa: Support RSA signature without MBEDTLS_GENPRIME 2021-05-21 10:21:27 +01:00
psa_key_derivation-bad_workflow.txt Fix missing state check for tls12_prf output 2021-06-14 18:08:26 +02:00
psa_sign_message.txt Add changelog entry for #4357 2021-05-17 22:20:11 +02:00
random-range.txt Add changelog entry for non-uniform MPI random generation 2021-06-02 21:39:30 +02:00
remove-config-psa-crypto.txt Changelog entry for the removal of config-psa-crypto.h in 2.x 2021-05-05 18:01:04 +02:00
session-cache.txt Add ChangeLog entry 2021-05-21 05:29:01 +01:00
spm_build.txt Move the inclusion of crypto_spe.h to psa/crypto_platform.h 2021-06-23 14:45:17 +02:00
undefined_reference_without_psa.txt Fix missing compilation guard around psa_crypto_driver_wrappers.c 2021-05-19 21:03:46 +02:00
winsock.txt Fix fd range for select on Windows 2021-06-20 23:17:39 +02:00