mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-03-31 10:20:45 +00:00
SNI + SSL async callback: make all keys async
When testing async callbacks with SNI, make all the keys async, not just the first one. Otherwise the test is fragile with respect to whether a key is used directly or through the async callbacks.
This commit is contained in:
parent
2636fade52
commit
e247989061
@ -897,7 +897,7 @@ typedef enum {
|
|||||||
|
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
ssl_async_key_slot_t slots[3]; /* key, key2, sni */
|
ssl_async_key_slot_t slots[4]; /* key, key2, sni1, sni2 */
|
||||||
size_t slots_used;
|
size_t slots_used;
|
||||||
ssl_async_inject_error_t inject_error;
|
ssl_async_inject_error_t inject_error;
|
||||||
int (*f_rng)(void *, unsigned char *, size_t);
|
int (*f_rng)(void *, unsigned char *, size_t);
|
||||||
@ -2387,16 +2387,20 @@ int main( int argc, char *argv[] )
|
|||||||
#if defined(MBEDTLS_SSL_ASYNC_PRIVATE)
|
#if defined(MBEDTLS_SSL_ASYNC_PRIVATE)
|
||||||
if( opt.async_private_delay2 >= 0 )
|
if( opt.async_private_delay2 >= 0 )
|
||||||
{
|
{
|
||||||
ret = ssl_async_set_key( &ssl_async_keys,
|
sni_entry *cur;
|
||||||
sni_info->cert, sni_info->key,
|
for( cur = sni_info; cur != NULL; cur = cur->next )
|
||||||
opt.async_private_delay2 );
|
|
||||||
if( ret < 0 )
|
|
||||||
{
|
{
|
||||||
mbedtls_printf( " Test error: ssl_async_set_key failed (%d)\n",
|
ret = ssl_async_set_key( &ssl_async_keys,
|
||||||
ret );
|
cur->cert, cur->key,
|
||||||
goto exit;
|
opt.async_private_delay2 );
|
||||||
|
if( ret < 0 )
|
||||||
|
{
|
||||||
|
mbedtls_printf( " Test error: ssl_async_set_key failed (%d)\n",
|
||||||
|
ret );
|
||||||
|
goto exit;
|
||||||
|
}
|
||||||
|
cur->key = NULL;
|
||||||
}
|
}
|
||||||
sni_info->key = NULL;
|
|
||||||
}
|
}
|
||||||
#endif /* MBEDTLS_SSL_ASYNC_PRIVATE */
|
#endif /* MBEDTLS_SSL_ASYNC_PRIVATE */
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user