mirror of
https://github.com/yuzu-mirror/mbedtls.git
synced 2026-04-04 22:19:05 +00:00
Add test for export keys functionality
Add test in `ssl-opts.sh` that the export keys callback is actually called.
This commit is contained in:
parent
cf28009839
commit
f75e252909
3 changed files with 24 additions and 6 deletions
|
|
@ -482,14 +482,17 @@ static int eap_tls_key_derivation ( void *p_expkey,
|
|||
eap_tls_keys *keys = (eap_tls_keys *)p_expkey;
|
||||
|
||||
( ( void ) kb );
|
||||
( ( void ) maclen );
|
||||
( ( void ) keylen );
|
||||
( ( void ) ivlen );
|
||||
memcpy( keys->master_secret, ms, sizeof( keys->master_secret ) );
|
||||
memcpy( keys->randbytes, client_random, 32 );
|
||||
memcpy( keys->randbytes + 32, server_random, 32 );
|
||||
keys->tls_prf_type = tls_prf_type;
|
||||
|
||||
if( opt.debug_level > 2 )
|
||||
{
|
||||
mbedtls_printf("exported maclen is %zu\n",maclen);
|
||||
mbedtls_printf("exported keylen is %zu\n",keylen);
|
||||
mbedtls_printf("exported ivlen is %zu\n",ivlen);
|
||||
}
|
||||
return( 0 );
|
||||
}
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -598,14 +598,17 @@ static int eap_tls_key_derivation ( void *p_expkey,
|
|||
eap_tls_keys *keys = (eap_tls_keys *)p_expkey;
|
||||
|
||||
( ( void ) kb );
|
||||
( ( void ) maclen );
|
||||
( ( void ) keylen );
|
||||
( ( void ) ivlen );
|
||||
memcpy( keys->master_secret, ms, sizeof( keys->master_secret ) );
|
||||
memcpy( keys->randbytes, client_random, 32 );
|
||||
memcpy( keys->randbytes + 32, server_random, 32 );
|
||||
keys->tls_prf_type = tls_prf_type;
|
||||
|
||||
if( opt.debug_level > 2 )
|
||||
{
|
||||
mbedtls_printf("exported maclen is %zu\n",maclen);
|
||||
mbedtls_printf("exported keylen is %zu\n",keylen);
|
||||
mbedtls_printf("exported ivlen is %zu\n",ivlen);
|
||||
}
|
||||
return( 0 );
|
||||
}
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue