Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/pr/remove-tls1_2_or_earlier-from…
Browse files Browse the repository at this point in the history
…-ssl.h' into tls13-prototype

merge pr hannestschofenig#302 and hannestschofenig#300

Change-Id: I41f08200da5a5630e14ec826ebd94b6af3257994
CustomizedGitHooks: yes
  • Loading branch information
yuhaoth committed Jul 21, 2021
2 parents 4395af1 + c3ff929 commit 775f11e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 46 deletions.
10 changes: 8 additions & 2 deletions include/mbedtls/ssl.h
Original file line number Diff line number Diff line change
Expand Up @@ -1577,10 +1577,16 @@ struct mbedtls_ssl_context
mbedtls_ssl_transform *transform_in; /*!< current transform params (in) */
mbedtls_ssl_transform *transform_out; /*!< current transform params (in) */

#if defined(MBEDTLS_SSL_PROTO_TLS1_2_OR_EARLIER)
#if defined(MBEDTLS_SSL_PROTO_SSL3) || \
defined(MBEDTLS_SSL_PROTO_TLS1) || \
defined(MBEDTLS_SSL_PROTO_TLS1_1) || \
defined(MBEDTLS_SSL_PROTO_TLS1_2)
mbedtls_ssl_transform *transform; /*!< negotiated transform params */
mbedtls_ssl_transform *transform_negotiate; /*!< transform params in negotiation */
#endif /* MBEDTLS_SSL_PROTO_TLS1_2_OR_EARLIER */
#endif /* defined(MBEDTLS_SSL_PROTO_SSL3) || \
defined(MBEDTLS_SSL_PROTO_TLS1) || \
defined(MBEDTLS_SSL_PROTO_TLS1_1) || \
defined(MBEDTLS_SSL_PROTO_TLS1_2) */

#if defined(MBEDTLS_SSL_PROTO_TLS1_3_EXPERIMENTAL)
mbedtls_ssl_transform *transform_handshake;
Expand Down
44 changes: 0 additions & 44 deletions tests/suites/test_suite_mps.function
Original file line number Diff line number Diff line change
Expand Up @@ -528,50 +528,6 @@ static void build_mock_transforms( mbedtls_mps_transform_wrap_t *ptr0,
ptr1->mock.pad = pad;
}

static void write_version( int major, int minor, int transport,
unsigned char ver[2] )
{
#if defined(MBEDTLS_SSL_PROTO_DTLS)
if( transport == MBEDTLS_MPS_MODE_DATAGRAM )
{
if( minor == MBEDTLS_SSL_MINOR_VERSION_2 )
--minor; /* DTLS 1.0 stored as TLS 1.1 internally */

ver[0] = (unsigned char)( 255 - ( major - 2 ) );
ver[1] = (unsigned char)( 255 - ( minor - 1 ) );
}
else
#else
((void) transport);
#endif
{
ver[0] = (unsigned char) major;
ver[1] = (unsigned char) minor;
}
}

static void read_version( int *major, int *minor, int transport,
const unsigned char ver[2] )
{
#if defined(MBEDTLS_SSL_PROTO_DTLS)
if( transport == MBEDTLS_MPS_MODE_DATAGRAM )
{
*major = 255 - ver[0] + 2;
*minor = 255 - ver[1] + 1;

if( *minor == MBEDTLS_SSL_MINOR_VERSION_1 )
++*minor; /* DTLS 1.0 stored as TLS 1.1 internally */
}
else
#else
((void) transport);
#endif
{
*major = ver[0];
*minor = ver[1];
}
}

#define CHK( x ) \
do \
{ \
Expand Down

0 comments on commit 775f11e

Please sign in to comment.