-
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
[Backport 3.6] Fix doc on GCM API #9762
base: mbedtls-3.6
Are you sure you want to change the base?
[Backport 3.6] Fix doc on GCM API #9762
Conversation
This commit updates GCM buffer overlap documentation to explicitly support overlapping encryption/decryption buffers for GCM. Signed-off-by: Harry Ramsey <[email protected]>
This commit adds test cases for input and output buffer overlap. The data for the test cases is a duplicate of existing encrypt/decrypt test cases. The two test functions gcm_<encrypt/decrypt>_input_output_buffer_overlap are modified to use a single malloc buffer rounded to the nearest 128-bits/16-bytes for input and output. Signed-off-by: Harry Ramsey <[email protected]>
if (buffer_len % 16 != 0) { | ||
buffer_len += (16 - (buffer_len % 16)); | ||
} | ||
TEST_CALLOC(buffer, buffer_len); |
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.
Regarding test faliures, can TEST_CALLOC not be used in 3.6?
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.
TEST_CALLOC
is available and (should be) identical in all supported branches.
You don't need if NULL goto exit
: that's built into the macro. Furthermore, buffer
will actually be null on success when buffer_len == 0
. That may be the cause of the CI failures? It would be the same in development though.
This commit fixes issues with TEST_CALLOC in GCM buffer overlap tests cases. Signed-off-by: Harry Ramsey <[email protected]>
This commit fixes an issue with check_names failing due to not being defined as a macro in Mbed TLS. This is instead defined by alternative implementations of MBEDTLS_GCM. Signed-off-by: Harry Ramsey <[email protected]>
This commit fixes an issue in the GCM shared buffer test case where input data could be of length 0 and an adequate buffer was not allocated. Signed-off-by: Harry Ramsey <[email protected]>
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.
LGTM
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.
Looks good apart from the no-check-names commit. This should not be needed on this branch, did you cherry-pick from development
when backporting?
This commit fixes documentation specifying buffer overlap on GCM decryption functions. Signed-off-by: Harry Ramsey <[email protected]>
Description
This is a backport of #7977.
PR checklist
Please remove the segment/s on either side of the | symbol as appropriate, and add any relevant link/s to the end of the line.
If the provided content is part of the present PR remove the # symbol.
Notes for the submitter
Please refer to the contributing guidelines, especially the
checklist for PR contributors.
Help make review efficient: