mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-07-28 00:21:48 +03:00
Add ssl_set_client_transport_id()
This commit is contained in:
committed by
Paul Bakker
parent
fb2d22371f
commit
43c021874d
@ -351,6 +351,26 @@ static int ssl_parse_ticket( ssl_context *ssl,
|
||||
}
|
||||
#endif /* POLARSSL_SSL_SESSION_TICKETS */
|
||||
|
||||
#if defined(POLARSSL_SSL_PROTO_DTLS)
|
||||
int ssl_set_client_transport_id( ssl_context *ssl,
|
||||
const unsigned char *info,
|
||||
size_t ilen )
|
||||
{
|
||||
if( ssl->endpoint != SSL_IS_SERVER )
|
||||
return( POLARSSL_ERR_SSL_BAD_INPUT_DATA );
|
||||
|
||||
polarssl_free( ssl->cli_id );
|
||||
|
||||
if( ( ssl->cli_id = polarssl_malloc( ilen ) ) == NULL )
|
||||
return( POLARSSL_ERR_SSL_MALLOC_FAILED );
|
||||
|
||||
memcpy( ssl->cli_id, info, ilen );
|
||||
ssl->cli_id_len = ilen;
|
||||
|
||||
return( 0 );
|
||||
}
|
||||
#endif /* POLARSSL_SSL_PROTO_DTLS */
|
||||
|
||||
#if defined(POLARSSL_SSL_SERVER_NAME_INDICATION)
|
||||
/*
|
||||
* Wrapper around f_sni, allowing use of ssl_set_own_cert() but
|
||||
|
Reference in New Issue
Block a user