Rename mbedtls_ssl_async_{get,set}_data for clarity
Rename to mbedtls_ssl_get_async_operation_data and
mbedtls_ssl_set_async_operation_data so that they're about
"async operation data" and not about some not-obvious "data".
diff --git a/include/mbedtls/ssl.h b/include/mbedtls/ssl.h
index b7dc98b..ec9018a 100644
--- a/include/mbedtls/ssl.h
+++ b/include/mbedtls/ssl.h
@@ -574,8 +574,8 @@
* is needed for later processing, because the \p hash buffer
* is no longer valid after this function returns.
*
- * This function may call mbedtls_ssl_async_set_data() to
- * store an operation context for later retrieval
+ * This function may call mbedtls_ssl_set_async_operation_data()
+ * to store an operation context for later retrieval
* by the resume callback.
*
* \note For RSA signatures, this function must produce output
@@ -598,7 +598,8 @@
* [RFC 4492 section 5.4](https://tools.ietf.org/html/rfc4492#section-5.4).
*
* \param ssl The SSL connection instance. It should not be
- * modified other than via mbedtls_ssl_async_set_data().
+ * modified other than via
+ * mbedtls_ssl_set_async_operation_data().
* \param cert Certificate containing the public key.
* In simple cases, this is one of the pointers passed to
* mbedtls_ssl_conf_own_cert() when configuring the SSL
@@ -650,8 +651,8 @@
* is needed for later processing, because the \p input buffer
* is no longer valid after this function returns.
*
- * This function may call mbedtls_ssl_async_set_data() to
- * store an operation context for later retrieval
+ * This function may call mbedtls_ssl_set_async_operation_data()
+ * to store an operation context for later retrieval
* by the resume callback.
*
* \warning RSA decryption as used in TLS is subject to a potential
@@ -664,7 +665,8 @@
* invalid padding.
*
* \param ssl The SSL connection instance. It should not be
- * modified other than via mbedtls_ssl_async_set_data().
+ * modified other than via
+ * mbedtls_ssl_set_async_operation_data().
* \param cert Certificate containing the public key.
* In simple cases, this is one of the pointers passed to
* mbedtls_ssl_conf_own_cert() when configuring the SSL
@@ -709,13 +711,14 @@
* does not wait for the operation to complete. This allows
* the handshake step to be non-blocking.
*
- * This function may call mbedtls_ssl_async_get_data() to
- * retrieve an operation context set by the start callback.
- * It may call mbedtls_ssl_async_set_data() to modify this
- * context.
+ * This function may call mbedtls_ssl_get_async_operation_data()
+ * to retrieve an operation context set by the start callback.
+ * It may call mbedtls_ssl_set_async_operation_data() to modify
+ * this context.
*
* \param ssl The SSL connection instance. It should not be
- * modified other than via mbedtls_ssl_async_set_data().
+ * modified other than via
+ * mbedtls_ssl_set_async_operation_data().
* \param output Buffer containing the output (signature or decrypted
* data) on success.
* \param output_len On success, number of bytes written to \p output.
@@ -744,8 +747,8 @@
* This callback is called if an SSL connection is closed
* while an asynchronous operation is in progress.
*
- * This function may call mbedtls_ssl_async_get_data() to
- * retrieve an operation context set by the start callback.
+ * This function may call mbedtls_ssl_get_async_operation_data()
+ * to retrieve an operation context set by the start callback.
*
* \param ssl The SSL connection instance. It should not be
* modified.
@@ -1582,11 +1585,12 @@
* \param ssl The SSL context to access.
*
* \return The asynchronous operation user context that was last
- * set during the current handshake. If mbedtls_ssl_set_data()
- * has not been called during the current handshake yet,
- * this function returns \c NULL.
+ * set during the current handshake. If
+ * mbedtls_ssl_set_async_operation_data() has not yet been
+ * called during the current handshake, this function returns
+ * \c NULL.
*/
-void *mbedtls_ssl_async_get_data( const mbedtls_ssl_context *ssl );
+void *mbedtls_ssl_get_async_operation_data( const mbedtls_ssl_context *ssl );
/**
* \brief Retrieve the asynchronous operation user context.
@@ -1596,10 +1600,10 @@
*
* \param ssl The SSL context to access.
* \param ctx The new value of the asynchronous operation user context.
- * Call mbedtls_ssl_get_data() later during the same handshake
- * to retrieve this value.
+ * Call mbedtls_ssl_get_async_operation_data() later during the
+ * same handshake to retrieve this value.
*/
-void mbedtls_ssl_async_set_data( mbedtls_ssl_context *ssl,
+void mbedtls_ssl_set_async_operation_data( mbedtls_ssl_context *ssl,
void *ctx );
#endif /* MBEDTLS_SSL_ASYNC_PRIVATE */
diff --git a/library/ssl_srv.c b/library/ssl_srv.c
index 5439f6d..2b25e09 100644
--- a/library/ssl_srv.c
+++ b/library/ssl_srv.c
@@ -2852,7 +2852,7 @@
if( ret != MBEDTLS_ERR_SSL_ASYNC_IN_PROGRESS )
{
ssl->handshake->async_in_progress = 0;
- mbedtls_ssl_async_set_data( ssl, NULL );
+ mbedtls_ssl_set_async_operation_data( ssl, NULL );
}
MBEDTLS_SSL_DEBUG_RET( 2, "ssl_resume_server_key_exchange", ret );
return( ret );
@@ -3406,7 +3406,7 @@
if( ret != MBEDTLS_ERR_SSL_ASYNC_IN_PROGRESS )
{
ssl->handshake->async_in_progress = 0;
- mbedtls_ssl_async_set_data( ssl, NULL );
+ mbedtls_ssl_set_async_operation_data( ssl, NULL );
}
MBEDTLS_SSL_DEBUG_RET( 2, "ssl_decrypt_encrypted_pms", ret );
return( ret );
diff --git a/library/ssl_tls.c b/library/ssl_tls.c
index 04f3458..3819b6f 100644
--- a/library/ssl_tls.c
+++ b/library/ssl_tls.c
@@ -6499,7 +6499,7 @@
return( conf->p_async_config_data );
}
-void *mbedtls_ssl_async_get_data( const mbedtls_ssl_context *ssl )
+void *mbedtls_ssl_get_async_operation_data( const mbedtls_ssl_context *ssl )
{
if( ssl->handshake == NULL )
return( NULL );
@@ -6507,7 +6507,7 @@
return( ssl->handshake->user_async_ctx );
}
-void mbedtls_ssl_async_set_data( mbedtls_ssl_context *ssl,
+void mbedtls_ssl_set_async_operation_data( mbedtls_ssl_context *ssl,
void *ctx )
{
if( ssl->handshake != NULL )
diff --git a/programs/ssl/ssl_server2.c b/programs/ssl/ssl_server2.c
index b1f2382..876f815 100644
--- a/programs/ssl/ssl_server2.c
+++ b/programs/ssl/ssl_server2.c
@@ -997,7 +997,7 @@
memcpy( ctx->input, input, input_len );
ctx->input_len = input_len;
ctx->remaining_delay = config_data->slots[slot].delay;
- mbedtls_ssl_async_set_data( ssl, ctx );
+ mbedtls_ssl_set_async_operation_data( ssl, ctx );
if( ctx->remaining_delay == 0 )
return( 0 );
@@ -1031,7 +1031,7 @@
size_t *output_len,
size_t output_size )
{
- ssl_async_operation_context_t *ctx = mbedtls_ssl_async_get_data( ssl );
+ ssl_async_operation_context_t *ctx = mbedtls_ssl_get_async_operation_data( ssl );
ssl_async_key_context_t *config_data =
mbedtls_ssl_conf_get_async_config_data( ssl->conf );
ssl_async_key_slot_t *key_slot = &config_data->slots[ctx->slot];
@@ -1085,7 +1085,7 @@
static void ssl_async_cancel( mbedtls_ssl_context *ssl )
{
- ssl_async_operation_context_t *ctx = mbedtls_ssl_async_get_data( ssl );
+ ssl_async_operation_context_t *ctx = mbedtls_ssl_get_async_operation_data( ssl );
mbedtls_printf( "Async cancel callback.\n" );
mbedtls_free( ctx );
}