Improve documentation of async operation start callbacks

This commit is contained in:
Gilles Peskine 2018-01-06 03:12:45 +01:00
parent 7ab013a08a
commit ab50f83a93

View file

@ -551,28 +551,29 @@ typedef int mbedtls_ssl_get_timer_t( void * ctx );
* *
* \param connection_ctx Pointer to the connection context set in the * \param connection_ctx Pointer to the connection context set in the
* SSL configuration * SSL configuration
* \param p_operation_ctx On output, pointer to the operation context. * \param p_operation_ctx On success, pointer to the operation context.
* This pointer will be passed later to the resume * This must be a non-null pointer. Success means
* or detach function. The value is only used if * that an operation was started, and the return
* an operation is started, i.e. if this callback * status is 0 or \c MBEDTLS_ERR_SSL_ASYNC_IN_PROGRESS.
* returns 0 or \c MBEDTLS_ERR_SSL_ASYNC_IN_PROGRESS. * This pointer will be passed to later calls to the
* resume or cancel function. If the callback fails,
* the value is ignored.
* \param cert Certificate containing the public key * \param cert Certificate containing the public key
* \param md_alg Hash algorithm * \param md_alg Hash algorithm
* \param hash Buffer containing the hash. This buffer is * \param hash Buffer containing the hash. This buffer is
* no longer valid when the function returns. * no longer valid when the function returns.
* \param hash_len Size of the \c hash buffer in bytes * \param hash_len Size of the \c hash buffer in bytes
* *
* \return - 0 if the SSL stack should call the resume callback * \return - 0 if the operation was started successfully and the SSL
* immediately. The resume function may provide the * stack should call the resume callback immediately.
* or may itself return * - \c MBEDTLS_ERR_SSL_ASYNC_IN_PROGRESS if the operation
* \c MBEDTLS_ERR_SSL_ASYNC_IN_PROGRESS. * was started successfully and the SSL stack should return
* - \c MBEDTLS_ERR_SSL_ASYNC_IN_PROGRESS if the SSL stack * immediately without calling the resume callback yet.
* should return immediately without calling the resume
* callback.
* - \c MBEDTLS_ERR_SSL_HW_ACCEL_FALLTHROUGH if the external * - \c MBEDTLS_ERR_SSL_HW_ACCEL_FALLTHROUGH if the external
* processor does not support this key. The SSL stack will * processor does not support this key. The SSL stack will
* use the associated private key object instead. * use the private key object instead.
* - Any other error is propagated up the call chain. * - Any other error indicates a fatal failure and is
* propagated up the call chain.
*/ */
typedef int mbedtls_ssl_async_sign_t( void *connection_ctx, typedef int mbedtls_ssl_async_sign_t( void *connection_ctx,
void **p_operation_ctx, void **p_operation_ctx,
@ -604,27 +605,28 @@ typedef int mbedtls_ssl_async_sign_t( void *connection_ctx,
* *
* \param connection_ctx Pointer to the connection context set in the * \param connection_ctx Pointer to the connection context set in the
* SSL configuration * SSL configuration
* \param p_operation_ctx On output, pointer to the operation context. * \param p_operation_ctx On success, pointer to the operation context.
* This pointer will be passed later to the resume * This must be a non-null pointer. Success means
* or detach function. The value is only used if * that an operation was started, and the return
* an operation is started, i.e. if this callback * status is 0 or \c MBEDTLS_ERR_SSL_ASYNC_IN_PROGRESS.
* returns 0 or \c MBEDTLS_ERR_SSL_ASYNC_IN_PROGRESS. * This pointer will be passed to later calls to the
* resume or cancel function. If the callback fails,
* the value is ignored.
* \param cert Certificate containing the public key * \param cert Certificate containing the public key
* \param input Buffer containing the input ciphertext. This buffer * \param input Buffer containing the input ciphertext. This buffer
* is no longer valid when the function returns. * is no longer valid when the function returns.
* \param input_len Size of the \c input buffer in bytes * \param input_len Size of the \c input buffer in bytes
* *
* \return - 0 if the SSL stack should call the resume callback * \return - 0 if the operation was started successfully and the SSL
* immediately. The resume function may provide the * stack should call the resume callback immediately.
* or may itself return * - \c MBEDTLS_ERR_SSL_ASYNC_IN_PROGRESS if the operation
* \c MBEDTLS_ERR_SSL_ASYNC_IN_PROGRESS. * was started successfully and the SSL stack should return
* - \c MBEDTLS_ERR_SSL_ASYNC_IN_PROGRESS if the SSL stack * immediately without calling the resume callback yet.
* should return immediately without calling the resume
* callback.
* - \c MBEDTLS_ERR_SSL_HW_ACCEL_FALLTHROUGH if the external * - \c MBEDTLS_ERR_SSL_HW_ACCEL_FALLTHROUGH if the external
* processor does not support this key. The SSL stack will * processor does not support this key. The SSL stack will
* use the associated private key object instead. * use the private key object instead.
* - Any other error is propagated up the call chain. * - Any other error indicates a fatal failure and is
* propagated up the call chain.
*/ */
typedef int mbedtls_ssl_async_decrypt_t( void *connection_ctx, typedef int mbedtls_ssl_async_decrypt_t( void *connection_ctx,
void **p_operation_ctx, void **p_operation_ctx,