mirror of
https://github.com/curl/curl.git
synced 2026-04-14 15:01:47 +03:00
mbedtls: fix ECJPAKE matching
It did not require a full-length match, so empty or prefix tokens map to
ECJPAKE would silently add that cipher to the configured list.
Follow-up to fba9afebba
Reported by Codex Security
Closes #21264
This commit is contained in:
parent
135665036f
commit
59c8de7897
1 changed files with 3 additions and 1 deletions
|
|
@ -265,9 +265,11 @@ static uint16_t mbed_cipher_suite_walk_str(const char **str, const char **end)
|
|||
{
|
||||
uint16_t id = Curl_cipher_suite_walk_str(str, end);
|
||||
size_t len = *end - *str;
|
||||
static const char ecjpake_suite[] = "TLS_ECJPAKE_WITH_AES_128_CCM_8";
|
||||
|
||||
if(!id) {
|
||||
if(curl_strnequal("TLS_ECJPAKE_WITH_AES_128_CCM_8", *str, len))
|
||||
if((len == sizeof(ecjpake_suite) - 1) &&
|
||||
curl_strnequal(ecjpake_suite, *str, len))
|
||||
id = MBEDTLS_TLS_ECJPAKE_WITH_AES_128_CCM_8;
|
||||
}
|
||||
return id;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue