mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-07-30 22:43:08 +03:00
Document BAD_INPUT_DATA error in key material exporter
Signed-off-by: Max Fillinger <maximilian.fillinger@foxcrypto.com>
This commit is contained in:
@ -5800,7 +5800,9 @@ int mbedtls_ssl_tls_prf(const mbedtls_tls_prf_types prf,
|
|||||||
* this distinction. If use_context is 0 and TLS 1.3 is used, context and
|
* this distinction. If use_context is 0 and TLS 1.3 is used, context and
|
||||||
* context_len are ignored and a 0-length context is used.
|
* context_len are ignored and a 0-length context is used.
|
||||||
*
|
*
|
||||||
* \return 0 on success. An SSL specific error on failure.
|
* \return 0 on success.
|
||||||
|
* \return MBEDTLS_ERR_SSL_BAD_INPUT_DATA if the handshake is not yet completed.
|
||||||
|
* \return An SSL-specific error on failure.
|
||||||
*/
|
*/
|
||||||
int mbedtls_ssl_export_keying_material(mbedtls_ssl_context *ssl,
|
int mbedtls_ssl_export_keying_material(mbedtls_ssl_context *ssl,
|
||||||
uint8_t *out, const size_t key_len,
|
uint8_t *out, const size_t key_len,
|
||||||
|
@ -10147,6 +10147,7 @@ int mbedtls_ssl_export_keying_material(mbedtls_ssl_context *ssl,
|
|||||||
const int use_context)
|
const int use_context)
|
||||||
{
|
{
|
||||||
if (!mbedtls_ssl_is_handshake_over(ssl)) {
|
if (!mbedtls_ssl_is_handshake_over(ssl)) {
|
||||||
|
/* TODO: Change this to a more appropriate error code when one is available. */
|
||||||
return MBEDTLS_ERR_SSL_BAD_INPUT_DATA;
|
return MBEDTLS_ERR_SSL_BAD_INPUT_DATA;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user