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

Implement TLS1.3 for windows client side #641

Open
wants to merge 89 commits into
base: main
Choose a base branch
from
Open

Implement TLS1.3 for windows client side #641

wants to merge 89 commits into from

Conversation

alfred2g
Copy link

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@codecov-commenter
Copy link

codecov-commenter commented May 22, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 80.39%. Comparing base (c345d77) to head (a798351).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #641   +/-   ##
=======================================
  Coverage   80.39%   80.39%           
=======================================
  Files          28       28           
  Lines        5992     5992           
=======================================
  Hits         4817     4817           
  Misses       1175     1175           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

source/socket_channel_handler.c Outdated Show resolved Hide resolved
source/windows/secure_channel_tls_handler.c Show resolved Hide resolved
source/windows/secure_channel_tls_handler.c Outdated Show resolved Hide resolved
source/windows/secure_channel_tls_handler.c Outdated Show resolved Hide resolved
source/windows/secure_channel_tls_handler.c Outdated Show resolved Hide resolved
source/windows/secure_channel_tls_handler.c Outdated Show resolved Hide resolved
source/windows/secure_channel_tls_handler.c Outdated Show resolved Hide resolved
return grbitEnabledProtocols;
}

static struct aws_channel_handler *s_tls_handler_new_win10_plus(
Copy link
Contributor

Choose a reason for hiding this comment

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

I'd rather these were named based on what we're checking for semantically, ie the win32 feature and not just a windows version.

source/windows/secure_channel_tls_handler.c Show resolved Hide resolved
source/windows/secure_channel_tls_handler.c Outdated Show resolved Hide resolved
Copy link
Contributor

@bretambrose bretambrose left a comment

Choose a reason for hiding this comment

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

Also, there aren't any new tests which seems surprising.

source/windows/secure_channel_tls_handler.c Outdated Show resolved Hide resolved
source/windows/secure_channel_tls_handler.c Show resolved Hide resolved
source/windows/secure_channel_tls_handler.c Outdated Show resolved Hide resolved
source/windows/secure_channel_tls_handler.c Show resolved Hide resolved
source/windows/secure_channel_tls_handler.c Outdated Show resolved Hide resolved
source/windows/secure_channel_tls_handler.c Outdated Show resolved Hide resolved
source/windows/secure_channel_tls_handler.c Outdated Show resolved Hide resolved
source/windows/secure_channel_tls_handler.c Outdated Show resolved Hide resolved
source/windows/secure_channel_tls_handler.c Outdated Show resolved Hide resolved
source/windows/secure_channel_tls_handler.c Outdated Show resolved Hide resolved
source/windows/secure_channel_tls_handler.c Show resolved Hide resolved
Comment on lines +1153 to +1157
memmove(
sc_handler->buffered_read_in_data_buf.buffer,
(sc_handler->buffered_read_in_data_buf.buffer + read_len) - input_buffers[3].cbBuffer,
input_buffers[3].cbBuffer);
sc_handler->buffered_read_in_data_buf.len = input_buffers[3].cbBuffer;
Copy link
Contributor

@sfod sfod Jun 19, 2024

Choose a reason for hiding this comment

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

Prior to this PR, an offset was used to pass the extra data to the decrypt operation (see old line 1069). Now, this extra data is being moved to the beginning of the buffer, but the offset logic is still present. Looks incorrect.

Also, a followup question/concern. We added additional memory copying. Do you know how frequent is this case when input_buffers[3].BufferType == SECBUFFER_EXTRA? If it appears all the time, it might affect the performance.

source/windows/secure_channel_tls_handler.c Show resolved Hide resolved
sc_handler->read_extra = input_buffers2[1].cbBuffer;
continue;
}
break;
Copy link
Contributor

Choose a reason for hiding this comment

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

I can't figure out why we don't want to try to decrypt extra data when sc_handler->buffered_read_in_data_buf.len == input_buffers2[1].cbBuffer. I think, a comment explaining this would be useful.

@sfod sfod mentioned this pull request Dec 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants