Skip to content

Commit

Permalink
Merge pull request Mbed-TLS#390 from lhuang04/tls13_prototype_server_…
Browse files Browse the repository at this point in the history
…alpn_compile_error

Fix compiler error when ALPN is enabled in server.
  • Loading branch information
hannestschofenig authored Mar 1, 2022
2 parents 61d55e5 + 0a4241e commit c5d09b6
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions library/ssl_tls13_server.c
Original file line number Diff line number Diff line change
Expand Up @@ -1300,7 +1300,7 @@ static int ssl_tls13_parse_supported_versions_ext( mbedtls_ssl_context *ssl,
static int ssl_tls13_parse_alpn_ext( mbedtls_ssl_context *ssl,
const unsigned char *buf, size_t len )
{
const unsigned char *end const = buf + len;
const unsigned char *end = buf + len;
size_t list_len;

const char **cur_ours;
Expand Down Expand Up @@ -1347,7 +1347,7 @@ static int ssl_tls13_parse_alpn_ext( mbedtls_ssl_context *ssl,
cur_cli_len = *cur_cli++;

if( cur_cli_len == cur_ours_len &&
memcmp( cur_cli, *cur_ours, cur_len ) == 0 )
memcmp( cur_cli, *cur_ours, cur_ours_len ) == 0 )
{
ssl->alpn_chosen = *cur_ours;
return( 0 );
Expand Down Expand Up @@ -2568,7 +2568,7 @@ static int ssl_tls13_client_hello_parse( mbedtls_ssl_context *ssl,
MBEDTLS_SSL_DEBUG_RET( 1, ( "ssl_tls13_parse_alpn_ext" ), ret );
return( ret );
}
ssl->handshake->extensions_present |= ALPN_EXTENSION;
ssl->handshake->extensions_present |= MBEDTLS_SSL_EXT_ALPN;
break;
#endif /* MBEDTLS_SSL_ALPN */

Expand Down Expand Up @@ -2865,7 +2865,7 @@ static int ssl_tls13_write_alpn_ext(
{
*olen = 0;

if( ( ssl->handshake->extensions_present & ALPN_EXTENSION ) == 0 ||
if( ( ssl->handshake->extensions_present & MBEDTLS_SSL_EXT_ALPN ) == 0 ||
ssl->alpn_chosen == NULL )
{
return( 0 );
Expand Down

0 comments on commit c5d09b6

Please sign in to comment.