-
Notifications
You must be signed in to change notification settings - Fork 860
DTLS: add api to enforce records do not span datagrams #8642
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
base: master
Are you sure you want to change the base?
Conversation
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.
Copilot reviewed 8 out of 9 changed files in this pull request and generated 2 comments.
Files not reviewed (1)
- doc/dox_comments/header_files/ssl.h: Language not supported
tests/api/test_dtls.c
Outdated
WOLFSSL_CTX *ctx_c = NULL, *ctx_s = NULL; | ||
WOLFSSL *ssl_c = NULL, *ssl_s = NULL; | ||
struct test_memio_ctx test_ctx; | ||
char * readBuf[50]; |
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.
The declaration of 'readBuf' as an array of char pointers is likely incorrect for use with wolfSSL_read, which expects a contiguous byte buffer. Consider changing it to 'unsigned char readBuf[50];' or 'char readBuf[50];' if signedness is not an issue.
char * readBuf[50]; | |
unsigned char readBuf[50]; |
Copilot is powered by AI, so mistakes are possible. Review output carefully before use.
tests/api/test_dtls.c
Outdated
WOLFSSL_CTX *ctx_c = NULL, *ctx_s = NULL; | ||
WOLFSSL *ssl_c = NULL, *ssl_s = NULL; | ||
struct test_memio_ctx test_ctx; | ||
char * readBuf[50]; |
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.
The declaration of 'readBuf' as an array of char pointers is likely unintended here, as wolfSSL_read is expected to write raw bytes into a contiguous buffer. Consider using 'unsigned char readBuf[50];' or 'char readBuf[50];' to avoid potential memory issues.
char * readBuf[50]; | |
unsigned char readBuf[50]; |
Copilot is powered by AI, so mistakes are possible. Review output carefully before use.
c818750
to
b8c12fb
Compare
retest this |
- 0: Records cannot span datagrams. | ||
- 1: Records can span datagrams (default behavior). | ||
*/ | ||
int wolfSSL_dtls_set_records_can_span_datagrams(WOLFSSL* ssl, int value); |
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.
Since the RFC explicitly prohibits this, I would make this a compile time const. Its not something that users are going to be changing dynamically.
Each DTLS record MUST fit within a single datagram.
Jenkins retest this please for long-running job |
cbab2d0
to
7147388
Compare
changes: - alert is sent if SanityCheckCipherText fails, with or without `WOLFSSL_EXTRA_ALERTS` defined - HandleDTLSDecryptFailed is invoked if `SanityCheckCipherText` fails
7147388
to
72a3693
Compare
retest this please |
Description
DTLS records should not span UDP datagrams, this PR adds an API to enforce it.