ssl_server2: get op_name from context in ssl_async_resume as well

This commit is contained in:
Gilles Peskine 2018-04-30 16:37:23 +02:00
parent ef30742a27
commit f5a9996088

View file

@ -1039,7 +1039,7 @@ static int ssl_async_resume( mbedtls_ssl_context *ssl,
mbedtls_ssl_conf_get_async_config_data( ssl->conf );
ssl_async_key_slot_t *key_slot = &config_data->slots[ctx->slot];
int ret;
const char *op_name = NULL;
const char *op_name;
if( ctx->remaining_delay > 0 )
{
@ -1052,14 +1052,12 @@ static int ssl_async_resume( mbedtls_ssl_context *ssl,
switch( ctx->operation_type )
{
case ASYNC_OP_DECRYPT:
op_name = "decrypt";
ret = mbedtls_pk_decrypt( key_slot->pk,
ctx->input, ctx->input_len,
output, output_len, output_size,
config_data->f_rng, config_data->p_rng );
break;
case ASYNC_OP_SIGN:
op_name = "sign";
ret = mbedtls_pk_sign( key_slot->pk,
ctx->md_alg,
ctx->input, ctx->input_len,
@ -1073,6 +1071,8 @@ static int ssl_async_resume( mbedtls_ssl_context *ssl,
break;
}
op_name = ssl_async_operation_names[ctx->operation_type];
if( config_data->inject_error == SSL_ASYNC_INJECT_ERROR_RESUME )
{
mbedtls_printf( "Async resume callback: %s done but injected error\n",