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

fix mg_tls_pending #2988

Merged
merged 1 commit into from
Dec 17, 2024
Merged

fix mg_tls_pending #2988

merged 1 commit into from
Dec 17, 2024

Conversation

scaprile
Copy link
Collaborator

@scaprile scaprile commented Dec 16, 2024

MbedTLS: mbedtls_ssl_get_bytes_avail() = decrypted data to be read
OpenSSL: SSL_pending() = decrypted data to be read
Mongoose: 1 if we have a full record, 0 if not. Even if there is outstanding decripted data to be copied, we return 0

  • mg_tls_pending() now also returns decrypted data to be read for tls bultin, all tls stacks the same
  • handle_tls_recv() now asks mg_tls_pending() to get how to resize the recv buffer.

mg_tls_pending() will return 0 until a record has been received, then that record will be decrypted and record size returned. handle_tls_recv() will then try to resize the buffer to the smallest of record size or MG_MAX_RECV_SIZE

@scaprile scaprile requested a review from cpq December 16, 2024 19:36
@cpq cpq merged commit 1e1efa2 into master Dec 17, 2024
64 of 78 checks passed
@cpq cpq deleted the tlspoll branch December 17, 2024 14:24
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.

2 participants