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

[Backport 2.28] Remove NULLing of ssl context in TLS1.2 transform population #8386

Conversation

paul-elliott-arm
Copy link
Member

@paul-elliott-arm paul-elliott-arm commented Oct 18, 2023

Description

Remove a piece of code that was meant to ensure non-usage of the ssl context (by NULL-ing it) under conditions where it should not be used, as this now makes less sense. Backport of #8384

PR checklist

Please tick as appropriate and edit the reasons (e.g.: "backport: not needed because this is a new feature")

  • changelog not required (minor change)
  • backport not required (This is the backport)
  • tests not required (current tests will cover)

Notes for the submitter

Please refer to the contributing guidelines, especially the
checklist for PR contributors.

@paul-elliott-arm paul-elliott-arm added needs-review Every commit must be reviewed by at least two team members, component-tls needs-ci Needs to pass CI tests needs-reviewer This PR needs someone to pick it up for review priority-high High priority - will be reviewed soon size-xs Estimated task size: extra small (a few hours at most) labels Oct 18, 2023
@paul-elliott-arm paul-elliott-arm self-assigned this Oct 18, 2023
@paul-elliott-arm paul-elliott-arm changed the base branch from development to mbedtls-2.28 October 18, 2023 14:17
Remove a piece of code that was meant to ensure non-usage of the ssl
context (by NULL-ing it) under conditions where it should not be used,
as this now makes less sense.

Signed-off-by: Paul Elliott <paul.elliott@arm.com>
@@ -1004,8 +1004,7 @@ static int ssl_populate_transform(mbedtls_ssl_transform *transform,
!defined(MBEDTLS_SSL_EXPORT_KEYS) && \
!defined(MBEDTLS_SSL_DTLS_CONNECTION_ID) && \
!defined(MBEDTLS_DEBUG_C)
ssl = NULL; /* make sure we don't use it except for those cases */
(void) ssl;
(void) ssl; /* ssl is unused except for those cases */
Copy link
Contributor

@tom-cosgrove-arm tom-cosgrove-arm Nov 3, 2023

Choose a reason for hiding this comment

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

Could we actually use the compiler to help us do this? With this after the (void) ssl?

#define ssl ssl_argument_must_not_be_accessed

Copy link
Contributor

Choose a reason for hiding this comment

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

It's not really important that the function doesn't use ssl for other purposes. KISS.

Copy link
Contributor

@gilles-peskine-arm gilles-peskine-arm left a comment

Choose a reason for hiding this comment

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

LGTM

@tom-cosgrove-arm tom-cosgrove-arm 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, needs-ci Needs to pass CI tests needs-reviewer This PR needs someone to pick it up for review labels Dec 15, 2023
@tom-cosgrove-arm tom-cosgrove-arm added this pull request to the merge queue Dec 21, 2023
Merged via the queue into Mbed-TLS:mbedtls-2.28 with commit 0071830 Dec 21, 2023
6 checks passed
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 priority-high High priority - will be reviewed soon size-xs Estimated task size: extra small (a few hours at most)
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants