Skip to content

Commit

Permalink
Wrap mbedtls_ssl_conf_dtls_cookies with macro
Browse files Browse the repository at this point in the history
Fix link error for this function

Change-Id: I603cbaeabccf969c2785198409c0d59f3afa889f
CustomizedGitHooks: yes
Signed-off-by: Jerry Yu <[email protected]>
  • Loading branch information
yuhaoth committed Jul 19, 2021
1 parent a6144ca commit 035a343
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 4 deletions.
4 changes: 2 additions & 2 deletions include/mbedtls/ssl.h
Original file line number Diff line number Diff line change
Expand Up @@ -2774,7 +2774,7 @@ void mbedtls_ssl_conf_cookies(mbedtls_ssl_config* conf,
mbedtls_ssl_cookie_check_t* f_cookie_check,
void* p_cookie,
unsigned int rr_conf);
#else
#endif /* MBEDTLS_SSL_PROTO_TLS1_3_EXPERIMENTAL */
/**
* \brief Register callbacks for DTLS cookies
* (Server only. DTLS only.)
Expand Down Expand Up @@ -2807,7 +2807,7 @@ void mbedtls_ssl_conf_dtls_cookies( mbedtls_ssl_config *conf,
mbedtls_ssl_cookie_write_t *f_cookie_write,
mbedtls_ssl_cookie_check_t *f_cookie_check,
void *p_cookie );
#endif /* MBEDTLS_SSL_PROTO_TLS1_3_EXPERIMENTAL */


/**
* \brief Set client's transport-level identification info.
Expand Down
1 change: 1 addition & 0 deletions include/mbedtls/ssl_internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -1170,6 +1170,7 @@ int mbedtls_ssl_handshake_server_step( mbedtls_ssl_context *ssl );
int mbedtls_ssl_handshake_client_step_tls1_3( mbedtls_ssl_context *ssl );
int mbedtls_ssl_handshake_server_step_tls1_3( mbedtls_ssl_context *ssl );
void mbedtls_ssl_handshake_wrapup( mbedtls_ssl_context *ssl );
void mbedtls_ssl_handshake_wrapup_tls13( mbedtls_ssl_context *ssl );

int mbedtls_ssl_handle_pending_alert( mbedtls_ssl_context *ssl );

Expand Down
3 changes: 2 additions & 1 deletion programs/fuzz/fuzz_dtlsserver.c
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,9 @@ int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) {

if( mbedtls_ssl_cookie_setup( &cookie_ctx, dummy_random, &ctr_drbg ) != 0 )
goto exit;

#if defined(MBEDTLS_SSL_DTLS_HELLO_VERIFY)
mbedtls_ssl_conf_dtls_cookies( &conf, mbedtls_ssl_cookie_write, mbedtls_ssl_cookie_check, &cookie_ctx );
#endif

if( mbedtls_ssl_setup( &ssl, &conf ) != 0 )
goto exit;
Expand Down
2 changes: 1 addition & 1 deletion tests/suites/test_suite_ssl.function
Original file line number Diff line number Diff line change
Expand Up @@ -939,7 +939,7 @@ int mbedtls_endpoint_init( mbedtls_endpoint *ep, int endpoint_type, int pk_alg,
ret = mbedtls_ssl_setup( &( ep->ssl ), &( ep->conf ) );
TEST_ASSERT( ret == 0 );

#if defined(MBEDTLS_SSL_PROTO_DTLS) && defined(MBEDTLS_SSL_SRV_C)
#if defined(MBEDTLS_SSL_PROTO_DTLS) && defined(MBEDTLS_SSL_SRV_C) && defined(MBEDTLS_SSL_DTLS_HELLO_VERIFY)
if( endpoint_type == MBEDTLS_SSL_IS_SERVER && dtls_context != NULL )
mbedtls_ssl_conf_dtls_cookies( &( ep->conf ), NULL, NULL, NULL );
#endif
Expand Down

0 comments on commit 035a343

Please sign in to comment.