Repository navigation
Conversation
|
This is currently in draft, pending a proper test |
EVP_PKEY_derive() should be able to cope with a too big buffer for fixed size outputs. However, we don't test that. This change modifies the PKEYKDF tests to ask EVP_PKEY_derive() what the desired output buffer size is, and as long as the returned value isn't absurd (indicating that anything goes), the output buffer is made to be twice as big as what is expected. Tests openssl#18517
|
The test that checks this is in #18536 |
kdf_derive() calls EVP_KDF_derive(), but didn't do enough to adapt its input buffer length arguments to fit the requirements to call EVP_KDF_derive(). Fixes openssl#18517
I decided to rebase this PR on top of that one |
| } | ||
|
|
||
| return EVP_KDF_derive(pkdfctx->kdfctx, secret, outlen, NULL); | ||
| if (kdfsize != SIZE_MAX) { |
There was a problem hiding this comment.
This looks odd. Why is this necessary?
There was a problem hiding this comment.
Because depending on the mode (EXTRACT_AND_EXPAND, EXTRACT_ONLY or EXPAND_ONLY), the output size may be fixed or indefinite. Kinda documented here:
Lines 157 to 160 in d2399d8
|
Ping |
|
This pull request is ready to merge |
EVP_PKEY_derive() should be able to cope with a too big buffer for fixed size outputs. However, we don't test that. This change modifies the PKEYKDF tests to ask EVP_PKEY_derive() what the desired output buffer size is, and as long as the returned value isn't absurd (indicating that anything goes), the output buffer is made to be twice as big as what is expected. Tests #18517 Reviewed-by: Paul Dale <[email protected]> Reviewed-by: Tomas Mraz <[email protected]> (Merged from #18533)
kdf_derive() calls EVP_KDF_derive(), but didn't do enough to adapt its input buffer length arguments to fit the requirements to call EVP_KDF_derive(). Fixes #18517 Reviewed-by: Paul Dale <[email protected]> Reviewed-by: Tomas Mraz <[email protected]> (Merged from #18533)
|
Merged 3.0: master: |
EVP_PKEY_derive() should be able to cope with a too big buffer for fixed size outputs. However, we don't test that. This change modifies the PKEYKDF tests to ask EVP_PKEY_derive() what the desired output buffer size is, and as long as the returned value isn't absurd (indicating that anything goes), the output buffer is made to be twice as big as what is expected. Tests #18517 Reviewed-by: Paul Dale <[email protected]> Reviewed-by: Tomas Mraz <[email protected]> (Merged from #18533) (cherry picked from commit a0587aa)
kdf_derive() calls EVP_KDF_derive(), but didn't do enough to adapt its input buffer length arguments to fit the requirements to call EVP_KDF_derive(). Fixes #18517 Reviewed-by: Paul Dale <[email protected]> Reviewed-by: Tomas Mraz <[email protected]> (Merged from #18533) (cherry picked from commit e906eab)
|
I have a suspicion this might have broken some tests... Why this didn't show up before it was merged is odd. |
|
That's interesting... that run is as if only the test/evp_test.c change was there, but not the correction of kdf_exch.c (i.e, it looks exactly the same as the runs of #18536) |
|
|
|
Ah, found it... your master branch is behind, so doesn't contain the fix of kdf_exch.c, but you're testing with a more up to date 3.0, which tests exactly the bug in question. Update the master branch in paulidale/openssl and you're gonna be fine |
EVP_PKEY_derive() should be able to cope with a too big buffer for fixed size outputs. However, we don't test that. This change modifies the PKEYKDF tests to ask EVP_PKEY_derive() what the desired output buffer size is, and as long as the returned value isn't absurd (indicating that anything goes), the output buffer is made to be twice as big as what is expected. Tests #18517 Reviewed-by: Paul Dale <[email protected]> Reviewed-by: Tomas Mraz <[email protected]> (Merged from openssl/openssl#18533) (cherry picked from commit a0587aa)
kdf_derive() calls EVP_KDF_derive(), but didn't do enough to adapt its input buffer length arguments to fit the requirements to call EVP_KDF_derive(). Fixes #18517 Reviewed-by: Paul Dale <[email protected]> Reviewed-by: Tomas Mraz <[email protected]> (Merged from openssl/openssl#18533) (cherry picked from commit e906eab)
EVP_PKEY_derive() should be able to cope with a too big buffer for fixed size outputs. However, we don't test that. This change modifies the PKEYKDF tests to ask EVP_PKEY_derive() what the desired output buffer size is, and as long as the returned value isn't absurd (indicating that anything goes), the output buffer is made to be twice as big as what is expected. Tests #18517 Reviewed-by: Paul Dale <[email protected]> Reviewed-by: Tomas Mraz <[email protected]> (Merged from openssl/openssl#18533) (cherry picked from commit a0587aa)
kdf_derive() calls EVP_KDF_derive(), but didn't do enough to adapt its input buffer length arguments to fit the requirements to call EVP_KDF_derive(). Fixes #18517 Reviewed-by: Paul Dale <[email protected]> Reviewed-by: Tomas Mraz <[email protected]> (Merged from openssl/openssl#18533) (cherry picked from commit e906eab)
EVP_PKEY_derive() should be able to cope with a too big buffer for fixed size outputs. However, we don't test that. This change modifies the PKEYKDF tests to ask EVP_PKEY_derive() what the desired output buffer size is, and as long as the returned value isn't absurd (indicating that anything goes), the output buffer is made to be twice as big as what is expected. Tests #18517 Reviewed-by: Paul Dale <[email protected]> Reviewed-by: Tomas Mraz <[email protected]> (Merged from openssl/openssl#18533) (cherry picked from commit a0587aa)
kdf_derive() calls EVP_KDF_derive(), but didn't do enough to adapt its input buffer length arguments to fit the requirements to call EVP_KDF_derive(). Fixes #18517 Reviewed-by: Paul Dale <[email protected]> Reviewed-by: Tomas Mraz <[email protected]> (Merged from openssl/openssl#18533) (cherry picked from commit e906eab)
EVP_PKEY_derive() should be able to cope with a too big buffer for fixed size outputs. However, we don't test that. This change modifies the PKEYKDF tests to ask EVP_PKEY_derive() what the desired output buffer size is, and as long as the returned value isn't absurd (indicating that anything goes), the output buffer is made to be twice as big as what is expected. Tests openssl#18517 Reviewed-by: Paul Dale <[email protected]> Reviewed-by: Tomas Mraz <[email protected]> (Merged from openssl#18533) (cherry picked from commit a0587aa)
kdf_derive() calls EVP_KDF_derive(), but didn't do enough to adapt its input buffer length arguments to fit the requirements to call EVP_KDF_derive(). Fixes openssl#18517 Reviewed-by: Paul Dale <[email protected]> Reviewed-by: Tomas Mraz <[email protected]> (Merged from openssl#18533) (cherry picked from commit e906eab)
kdf_derive() calls EVP_KDF_derive(), but didn't do enough to adapt its input
buffer length arguments to fit the requirements to call EVP_KDF_derive().
Fixes #18517