-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Run ssl-opt.sh in more reduced configurations #5582
Merged
gilles-peskine-arm
merged 32 commits into
Mbed-TLS:development
from
gilles-peskine-arm:ssl-opt-auto-psk
Apr 21, 2022
Merged
Changes from 27 commits
Commits
Show all changes
32 commits
Select commit
Hold shift + click to select a range
fd222da
Fix the build when MBEDTLS_PLATFORM_C is unset
gilles-peskine-arm 7451e5a
Minimal TLS configuration: documentation improvements
gilles-peskine-arm 168f17c
New sample/test configuration: small DTLS 1.2
gilles-peskine-arm 82a4ab2
ssl-opt: automatically skip DTLS tests in builds without DTLS
gilles-peskine-arm a165b5c
Automatically skip tests for some absent features: tickets, ALPN
gilles-peskine-arm 3561526
Only run "Default" tests if the expected ciphersuite is enabled
gilles-peskine-arm 2fe796f
Add some missing dependencies: EXTENDED_MASTER_SECRET, CACHE
gilles-peskine-arm 6e86e54
Adapt tests for PSK in PSK-only builds
gilles-peskine-arm c6d197b
ssl-opt needs debug messages
gilles-peskine-arm 588d7a7
Add a missing requires_max_content_len
gilles-peskine-arm d7df877
Simplify the logic to select configurations
gilles-peskine-arm a266541
test-ref-configs: clarify configuration-related traces
gilles-peskine-arm aa162b5
Remove negative check for a message that no longer exists
gilles-peskine-arm 4c3f240
Fix unused function warning
gilles-peskine-arm 309ca65
calc_verify is only called in some configurations
gilles-peskine-arm 6f160ca
Skip some DTLS reordering tests in PSK-only builds
gilles-peskine-arm d725bf7
Minor documentation improvement
gilles-peskine-arm 59601d7
Documentation improvements
gilles-peskine-arm 1438e16
Add requirements of "Default"
gilles-peskine-arm c8d242f
set_maybe_calc_verify: $1 is intended to be auth_mode
gilles-peskine-arm 8bb96d9
Fix buffer size calculation
gilles-peskine-arm 99a732b
Fix off-by-one in buffer_size usage
gilles-peskine-arm d2d90af
Make mbedtls_ssl_get_bytes_avail tests more independent
gilles-peskine-arm b898b3d
Prepare to generalize maybe_requires_ciphersuite_enabled
gilles-peskine-arm 740b734
Move ticket, alpn detection into maybe_requires_ciphersuite_enabled
gilles-peskine-arm c912673
Automatically detect protocol version requirement from force_version
gilles-peskine-arm 70b8a69
Add changelog entry for #3998 fix
gilles-peskine-arm 2ecf4ff
Restore explicit version requirement on 1.3 HelloRetryRequest tests
gilles-peskine-arm 5417d48
Remove mostly-redundant test build
gilles-peskine-arm 7393ec5
test_cmake_out_of_source: validate that ssl-opt passed
gilles-peskine-arm a841c2a
test_cmake_out_of_source: run an ssl-opt test case that exists
gilles-peskine-arm 5bd0b51
Use terse output from lsof
gilles-peskine-arm File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
Bugfix | ||
* In configurations with MBEDTLS_SSL_DTLS_CONNECTION_ID enabled but not | ||
MBEDTLS_DEBUG_C, DTLS handshakes using CID would crash due to a null | ||
pointer dereference. Fix this. Fixes #3998. | ||
The fix was released, but not announced, in Mbed TLS 3.1.0. | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,108 @@ | ||
/** | ||
* \file config-ccm-psk-dtls1_2.h | ||
* | ||
* \brief Small configuration for DTLS 1.2 with PSK and AES-CCM ciphersuites | ||
*/ | ||
/* | ||
* 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. | ||
*/ | ||
/* | ||
* Minimal configuration for DTLS 1.2 with PSK and AES-CCM ciphersuites | ||
* | ||
* Distinguishing features: | ||
* - Optimized for small code size, low bandwidth (on an unreliable transport), | ||
* and low RAM usage. | ||
* - No asymmetric cryptography (no certificates, no Diffie-Hellman key | ||
* exchange). | ||
* - Fully modern and secure (provided the pre-shared keys are generated and | ||
* stored securely). | ||
* - Very low record overhead with CCM-8. | ||
* - Includes several optional DTLS features typically used in IoT. | ||
* | ||
* See README.txt for usage instructions. | ||
*/ | ||
|
||
/* System support */ | ||
//#define MBEDTLS_HAVE_TIME /* Optionally used in Hello messages */ | ||
/* Other MBEDTLS_HAVE_XXX flags irrelevant for this configuration */ | ||
|
||
/* Mbed TLS modules */ | ||
#define MBEDTLS_AES_C | ||
#define MBEDTLS_CCM_C | ||
#define MBEDTLS_CIPHER_C | ||
#define MBEDTLS_CTR_DRBG_C | ||
#define MBEDTLS_ENTROPY_C | ||
#define MBEDTLS_MD_C | ||
#define MBEDTLS_NET_C | ||
/* The library does not currently support enabling SHA-224 without SHA-256. | ||
* A future version of the library will have this option disabled | ||
* by default. */ | ||
#define MBEDTLS_SHA224_C | ||
#define MBEDTLS_SHA256_C | ||
#define MBEDTLS_SSL_CLI_C | ||
#define MBEDTLS_SSL_COOKIE_C | ||
#define MBEDTLS_SSL_SRV_C | ||
#define MBEDTLS_SSL_TLS_C | ||
#define MBEDTLS_TIMING_C | ||
|
||
/* TLS protocol feature support */ | ||
#define MBEDTLS_KEY_EXCHANGE_PSK_ENABLED | ||
#define MBEDTLS_SSL_PROTO_TLS1_2 | ||
#define MBEDTLS_SSL_PROTO_DTLS | ||
#define MBEDTLS_SSL_DTLS_ANTI_REPLAY | ||
#define MBEDTLS_SSL_DTLS_CLIENT_PORT_REUSE | ||
#define MBEDTLS_SSL_DTLS_CONNECTION_ID | ||
#define MBEDTLS_SSL_DTLS_HELLO_VERIFY | ||
#define MBEDTLS_SSL_MAX_FRAGMENT_LENGTH | ||
|
||
/* | ||
* Use only CCM_8 ciphersuites, and | ||
* save ROM and a few bytes of RAM by specifying our own ciphersuite list | ||
*/ | ||
#define MBEDTLS_SSL_CIPHERSUITES \ | ||
MBEDTLS_TLS_PSK_WITH_AES_256_CCM_8, \ | ||
MBEDTLS_TLS_PSK_WITH_AES_128_CCM_8 | ||
|
||
/* | ||
* Save RAM at the expense of interoperability: do this only if you control | ||
* both ends of the connection! (See comments in "mbedtls/ssl.h".) | ||
* The optimal size here depends on the typical size of records. | ||
*/ | ||
#define MBEDTLS_SSL_IN_CONTENT_LEN 256 | ||
#define MBEDTLS_SSL_OUT_CONTENT_LEN 256 | ||
|
||
/* Save RAM at the expense of ROM */ | ||
#define MBEDTLS_AES_ROM_TABLES | ||
|
||
/* Save some RAM by adjusting to your exact needs */ | ||
#define MBEDTLS_PSK_MAX_LEN 16 /* 128-bits keys are generally enough */ | ||
|
||
/* | ||
* You should adjust this to the exact number of sources you're using: default | ||
* is the "platform_entropy_poll" source, but you may want to add other ones | ||
* Minimum is 2 for the entropy test suite. | ||
*/ | ||
#define MBEDTLS_ENTROPY_MAX_SOURCES 2 | ||
|
||
/* These defines are present so that the config modifying scripts can enable | ||
* them during tests/scripts/test-ref-configs.pl */ | ||
//#define MBEDTLS_USE_PSA_CRYPTO | ||
//#define MBEDTLS_PSA_CRYPTO_C | ||
|
||
/* Error messages and TLS debugging traces | ||
* (huge code size increase, needed for tests/ssl-opt.sh) */ | ||
//#define MBEDTLS_DEBUG_C | ||
//#define MBEDTLS_ERROR_C |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
component_test_CID_no_debug
was added in #4989 as a non-regression test for #3998. Now, runningtest_suite_ssl
andcompat.sh
inconfig-ccm-psk-dtls1_2.h
is also a non-regression test for that bug. Is it useful to keepcomponent_test_CID_no_debug
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would say that it can be removed. A regression test for it will already exist, removing one whole build will save some time.