Skip to content
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

CID update to RFC 9146 #6264

Merged
merged 13 commits into from
Nov 29, 2022
Merged

CID update to RFC 9146 #6264

merged 13 commits into from
Nov 29, 2022

Conversation

hannestschofenig
Copy link
Contributor

@hannestschofenig hannestschofenig commented Sep 7, 2022

The DTLS 1.2 CID specification has been published as RFC 9146. This PR updates the implementation to match the RFC content.

Signed-off-by: Hannes Tschofenig hannes.tschofenig@arm.com

Description

The DTLS 1.2 CID specification was published as RFC 9146. This PR updates the implementation to match the RFC content.

There are two compile-time options, namely

  • Set MBEDTLS_SSL_DTLS_CONNECTION_ID to enable the connection id functionality.
  • Set MBEDTLS_SSL_DTLS_CONNECTION_ID_COMPAT to 0 (for the RFC 9146 version) and 1 (for the CID draft version draft-ietf-tls-dtls-connection-id-05).

Status

READY

Requires Backporting

NO. This PR does not require backporting.

Migrations

NO.

There are no changes to the API but enhancements to the API.

Additional comments

Todos

Steps to test or reproduce

The code has been tested against Californium.

The DTLS 1.2 CID specification has been published as RFC 9146. This PR updates the implementation to match the RFC content.

Signed-off-by: Hannes Tschofenig <hannes.tschofenig@arm.com>
@daverodgman daverodgman added enhancement needs-review Every commit must be reviewed by at least two team members, needs-reviewer This PR needs someone to pick it up for review size-s Estimated task size: small (~2d) priority-medium Medium priority - this can be reviewed as time permits labels Sep 12, 2022
@daverodgman daverodgman added this to To Do in Roadmap Board for Mbed TLS via automation Sep 12, 2022
@daverodgman
Copy link
Contributor

Looks like there is a compile issue with TLS 1.3-only configurations

@daverodgman daverodgman added needs-work and removed needs-review Every commit must be reviewed by at least two team members, needs-reviewer This PR needs someone to pick it up for review labels Sep 12, 2022
@plskeggs plskeggs mentioned this pull request Sep 13, 2022
2 tasks
plskeggs pushed a commit to plskeggs/sdk-mbedtls that referenced this pull request Sep 16, 2022
The DTLS 1.2 CID specification has been published as RFC 9146. This PR updates the implementation to match the RFC content.

Upstream PR: Mbed-TLS/mbedtls#6264

Signed-off-by: Hannes Tschofenig <hannes.tschofenig@arm.com>
@hannestschofenig
Copy link
Contributor Author

The CI rightly points out that the current Mbed TLS implementation only supports TLS 1.3 and not DTLS 1.3. Hence, if you enable only TLS 1.3 support then this feature is not applicable at this point in time.

@carlescufi
Copy link

@hannestschofenig does this PR superseed #5061? If so, why not close the older one?

@daverodgman daverodgman added this to Mbed TLS 3.3 / 2.28.2 in EPICs for Mbed TLS Oct 3, 2022
@daverodgman daverodgman added priority-high High priority - will be reviewed soon and removed priority-medium Medium priority - this can be reviewed as time permits labels Oct 3, 2022
@mpg mpg self-requested a review October 6, 2022 08:14
plskeggs pushed a commit to plskeggs/sdk-mbedtls that referenced this pull request Oct 13, 2022
The DTLS 1.2 CID specification has been published as RFC 9146. This PR updates the implementation to match the RFC content.

Upstream PR: Mbed-TLS/mbedtls#6264

Signed-off-by: Hannes Tschofenig <hannes.tschofenig@arm.com>
Ensure MBEDTLS_SSL_DTLS_CONNECTION_ID_COMPAT is unset where
MBEDTLS_SSL_DTLS_CONNECTION_ID is unset.

Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
@daverodgman daverodgman added needs-review Every commit must be reviewed by at least two team members, needs-ci Needs to pass CI tests and removed needs-work labels Oct 26, 2022
@boaks
Copy link

boaks commented Oct 27, 2022

I updated my local mbedtls to this PR in order to run Eclipse/Californium - mbedtls interoperability tests.

Tests are successful.

Thanks @hannestschofenig !

Ensure MBEDTLS_SSL_DTLS_CONNECTION_ID and MBEDTLS_SSL_DTLS_CONNECTION_ID_COMPAT
are unset when MBEDTLS_SSL_PROTO_DTLS is not set in tls13-only tests.

Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
@daverodgman daverodgman removed the needs-ci Needs to pass CI tests label Oct 28, 2022
We don't need to have two copies of the test with one of them depending
on legacy/compat CID: we can have just one copy, but make sure we run
ssl-opt.sh both in a build with standard CID and in a build with
legacy/compat - that's the job of all.sh (see next commit).

Signed-off-by: Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com>
CID is now enabled in the default config (as well as full), so it's
already tested in numerous all.sh components, not need to add one for
that.

We need a component for the legacy/compat option though as it's never
enabled in existing components. So, keep that one, but adjust the name
and fix a typo in a message.

Signed-off-by: Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com>
Roadmap Board for Mbed TLS automation moved this from Has Approval to In Development Nov 25, 2022
@boaks
Copy link

boaks commented Nov 25, 2022

@thomas-fossati

Hi Thomas,

If I remember well, you're the expert for the DTLS 1.2 CID / CBC support.
Would it be possible for you to have a look on it? that would be great and helps a lot.

@boaks
Copy link

boaks commented Nov 25, 2022

we don't want to waste your time testing versions that don't even pass our own CI.

That's only a short test, so the time spend doesn't matter.

@mpg
Copy link
Contributor

mpg commented Nov 25, 2022

I just pushed an updated version that should fix the CI failure. At least the component that was failing on the CI is not passing locally on my machine, hopefully I haven't broken anything else in the process.

I've also force-pushed to edit the commit message of the last 6 commits from Hannes and make the DCO check happy.

The previous HEAD before I force-pushed was 13fe72c - I've edited the messages from the last 6 commits without changing their content, and added 3 new commits on top: 1 to fix the failure, and 2 to address my own feedback about redundant tests. @d3zd3z @hannestschofenig please review!

@mpg mpg dismissed their stale review November 25, 2022 11:06

Feedback has been addressed.

@boaks
Copy link

boaks commented Nov 25, 2022

With commit 6a543ba

dtls_1_2_cid_cbc.pcapng.gz

it works from my side. My tests are not intensive, they mainly ensure a basic interoperability.

Tested ciphersuites:

"TLS-ECDHE-PSK-WITH-AES-128-CBC-SHA256"
"TLS-PSK-WITH-AES-128-GCM-SHA256"
"TLS-PSK-WITH-AES-256-GCM-SHA384"
"TLS-PSK-WITH-AES-128-CCM-8"
"TLS-PSK-WITH-AES-256-CCM-8"
"TLS-PSK-WITH-AES-128-CCM"
"TLS-PSK-WITH-AES-256-CCM"
"TLS-PSK-WITH-AES-128-CBC-SHA256"
"TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256"
"TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384"
"TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8"
"TLS-ECDHE-ECDSA-WITH-AES-256-CCM-8"
"TLS-ECDHE-ECDSA-WITH-AES-128-CCM"
"TLS-ECDHE-ECDSA-WITH-AES-256-CCM"
"TLS-ECDHE-ECDSA-WITH-AES-256-CBC-SHA"
"TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256"
"TLS-ECDHE-ECDSA-WITH-AES-256-CBC-SHA384"
"TLS-ECDHE-RSA-WITH-AES-128-GCM-SHA256"
"TLS-ECDHE-RSA-WITH-AES-256-GCM-SHA384"
"TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256"
"TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA"
"TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384"

@mpg
Copy link
Contributor

mpg commented Nov 25, 2022

Thanks! Basic interop is already great!

@mpg
Copy link
Contributor

mpg commented Nov 25, 2022

I've tested interop of the compat version with previous versions of Mbed TLS. Steps taken:

  1. In a checkout of the development branch, enable MBEDTLS_SSL_DTLS_CONNECTION_ID, build ssl_client2 and ssl_server2 and save them somewhere.
  2. In a checkout of this branch, build in the defaults config, test against the programs built at step 1, and observe numerous failures.
  3. In a checkout of this branch, set MBEDTLS_SSL_DTLS_CONNECTION_ID_COMPAT to 1, rebuild (with make, you need to run make clean first), test against the programs from step 1 again, and now the tests pass.

Testing against programs from test 1 consisted of:

P_SRV=/path/to/step1/ssl_server2 tests/ssl-opt.sh -f 'Connection ID' 
P_CLI=/path/to/step1/ssl_client2 tests/ssl-opt.sh -f 'Connection ID'

@mpg mpg added needs-review Every commit must be reviewed by at least two team members, and removed needs-work needs-ci Needs to pass CI tests labels Nov 25, 2022
@mpg
Copy link
Contributor

mpg commented Nov 28, 2022

CI's good. @hannestschofenig @d3zd3z Please review the latest commits.

Copy link
Contributor

@d3zd3z d3zd3z left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. I wonder if MMBEDTLS is the yummier version.

@bensze01 bensze01 moved this from In Development to Has Approval in Roadmap Board for Mbed TLS Nov 28, 2022
@mpg mpg added approved Design and code approved - may be waiting for CI or backports and removed needs-review Every commit must be reviewed by at least two team members, labels Nov 29, 2022
@mpg mpg merged commit ffc330f into Mbed-TLS:development Nov 29, 2022
Roadmap Board for Mbed TLS automation moved this from Has Approval to Done Nov 29, 2022
@mpg
Copy link
Contributor

mpg commented Nov 29, 2022

Aw, we managed to forget the ChangeLog entry. See #6681

plskeggs pushed a commit to plskeggs/sdk-mbedtls that referenced this pull request Feb 24, 2023
The DTLS 1.2 CID specification has been published as RFC 9146. This PR updates the implementation to match the RFC content.

Upstream PR: Mbed-TLS/mbedtls#6264

Signed-off-by: Hannes Tschofenig <hannes.tschofenig@arm.com>
gilles-peskine-arm added a commit to gilles-peskine-arm/mbedtls that referenced this pull request Aug 30, 2023
Mbed-TLS#6264 was missing a changelog entry.
Unfortunately we didn't catch it when preparing the 3.3.0 release.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Design and code approved - may be waiting for CI or backports component-tls enhancement priority-high High priority - will be reviewed soon size-s Estimated task size: small (~2d)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants