Skip to content

Commit

Permalink
Refine components for tls13-prototype
Browse files Browse the repository at this point in the history
- Prefix all prototype components with `test_prototype`
  - Create a duplicate component if it is same with exist one.
- Overwrite `tls13-only.h` with upstream version. And create
  user configs for prototype.
- `test_tls13_only_*` are duplicated with minor changes.
- Add non-0-RTT components
- Change `with_padding` to `without_padding`
- Enable asan for all prototype components

The purpose is to
- Reduce the differences with upstream.
- List the components which MUST be passed in prototype.

Signed-off-by: Jerry Yu <[email protected]>
  • Loading branch information
yuhaoth committed Dec 14, 2022
1 parent b5e49a1 commit f826bef
Show file tree
Hide file tree
Showing 4 changed files with 543 additions and 272 deletions.
26 changes: 26 additions & 0 deletions tests/configs/tls13-only-prototype-no-middlebox.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
/* MBEDTLS_USER_CONFIG_FILE for testing.
* Only used for a few test configurations.
*
* Typical usage (note multiple levels of quoting):
* make CFLAGS="'-DMBEDTLS_USER_CONFIG_FILE=\"../tests/configs/tls13-only-prototype-no-middlebox.h\"'"
*/

/*
* Copyright The Mbed TLS Contributors
* SPDX-License-Identifier: Apache-2.0
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

#include "tls13-only-prototype.h"
#undef MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE
36 changes: 36 additions & 0 deletions tests/configs/tls13-only-prototype.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
/* MBEDTLS_USER_CONFIG_FILE for testing.
* Only used for a few test configurations.
*
* Typical usage (note multiple levels of quoting):
* make CFLAGS="'-DMBEDTLS_USER_CONFIG_FILE=\"../tests/configs/tls13-only-prototype.h\"'"
*/

/*
* Copyright The Mbed TLS Contributors
* SPDX-License-Identifier: Apache-2.0
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

#include "tls13-only.h"

// /* Enable TLS 1.3 and core 1.3 features */
// #define MBEDTLS_ZERO_RTT
// #define MBEDTLS_SSL_EARLY_DATA

/* Disable invasive tests */
/* For prototype, `TLS 1.3 srv Certificate msg - wrong vector lengths` will fail */
#undef MBEDTLS_TEST_HOOKS

#undef MBEDTLS_SSL_RENEGOTIATION
#undef MBEDTLS_SSL_CONTEXT_SERIALIZATION
8 changes: 2 additions & 6 deletions tests/configs/tls13-only.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@

/* Enable TLS 1.3 and core 1.3 features */
#define MBEDTLS_SSL_PROTO_TLS1_3
#define MBEDTLS_ZERO_RTT
#define MBEDTLS_SSL_EARLY_DATA
#define MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE

/* Disable TLS 1.2 and 1.2-specific features */
#undef MBEDTLS_SSL_ENCRYPT_THEN_MAC
Expand All @@ -35,9 +34,6 @@
#undef MBEDTLS_SSL_DTLS_ANTI_REPLAY
#undef MBEDTLS_SSL_DTLS_HELLO_VERIFY
#undef MBEDTLS_SSL_DTLS_CLIENT_PORT_REUSE
#undef MBEDTLS_SSL_RENEGOTIATION
#undef MBEDTLS_SSL_CONTEXT_SERIALIZATION

/* Enable some invasive tests */
/* For prototype, `TLS 1.3 srv Certificate msg - wrong vector lengths` will fail */
// #define MBEDTLS_TEST_HOOKS
#define MBEDTLS_TEST_HOOKS
Loading

0 comments on commit f826bef

Please sign in to comment.