patchlwIP - A Lightweight TCP/IP stack - Patches: patch #10368, Multiple fixes and enhancements in...

 
 

You are not allowed to post comments on this tracker with your current authentication level.

patch #10368: Multiple fixes and enhancements in ALTCP TLS MBEDTLS

Submitter:  Hamza Hajeir <hamzahajeir>
Submitted:  Tue 27 Jun 2023 01:04:18 PM UTC
   
 
Category:  apps Priority:  6
Status:  None Privacy:  Public
Assigned to:  None Open/Closed:  Open
Planned Release:  None

Thu 27 Jul 2023 11:58:41 AM UTC, comment #1: 

Hi again

Here's a patch regarding write apiflags management (0011).

Which stores provided apiflags, and adds TCP_WRITE_FLAG_MORE to altcp_write if there's data left telling the write function not to add PUSH flag to the current segment.

Regards,
Hamza Hajeir

(file #54977)

Hamza Hajeir <hamzahajeir>
Tue 27 Jun 2023 01:04:18 PM UTC, original submission:  

Hello LwIP community!

I'm providing patches of several and various fixes and enhancements targeting altcp_tls_mbedtls.c file, as follows:
0001- Copies the TCP flags out of the received puf, in which the application can receive the correct PUSH flag set and act accordingly, either by waiting other fragments or immediately process it.
The patch also adds a condition to the while loop to save unnecessare wasted cycles when there's no available buffer in rx or rx_app buffers.

0002- Correctly free clients' tls configurations on close, preventing certain memory leak. Servers are excluded from thie free operation; because they share the same config. In an upcoming patch freeing the LISTEN connection close.

0003- Simple fixes of abort calls management.

0004- Freeing the SSL ticket and cache contexts by an appropriate call.

0005- Ensure conf-> (pkey,cert,ca) pointers value NULL when free.

0006- Adds the return value of mbedtls APIs: handshake and setup.

0007- Correctly close and free the tls configurations of a LISTEN pcb.

0008- Make use of handshake steps instead of one block call. This frees the CPU for good amount of time when handshake is in the process of receiving/sending data against the network.

0009- I'm not very sure, but this frees rx_app buffer on dealloc.

And in altcp_tls_mbedtls_mem.c:
0010- Corrects wrongly identified mbedTLS memory calloc/free configuration, more details in: https://savannah.nongnu.org/bugs/?64299

The previous patches are based on a partially merged lwip library, which I cherry-picked only mbedtls-related commits in master and release 2.1.x branch to 2.1.2 release maintained by espressif (esp-lwip), So one might notice some lines differences to the current master branch.

Beside, I've reviewed some of them multiple times, so these are not chronologically in order. Given this, there might happen some ease-to-spot conflicts.


Sincerely,
Hamza Hajeir

Hamza Hajeir <hamzahajeir>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attached Files
file #54977:  0011-altcp_tls_mbedtls-Manage-write-apiflags.patch added by hamzahajeir (3KiB - application/octet-stream - Write apiflags management)
file #54887:  0009-altcp_tls_mbedtls-free-rx_app-on-dealloc.patch added by hamzahajeir (1010B - application/octet-stream - Batch 3)
file #54884:  0006-altcp_tls_mbedtls-Add-mbedtls-return-values.patch added by hamzahajeir (1KiB - application/octet-stream - Batch 2)
file #54879:  0001-altcp_tls_mbedtls-Copy-received-TCP-flags.patch added by hamzahajeir (1KiB - application/octet-stream - Batch 1)
file #54881:  0003-altcp_tls_mbedtls-Fix-abort-management.patch added by hamzahajeir (1KiB - application/octet-stream - Batch 1)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by hamzahajeir (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

     

    Follow 11 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2023-07-27 hamzahajeir Attached File- Added 0011-altcp_tls_mbedtls-Manage-write-apiflags.patch, #54977
    2023-06-27 hamzahajeir Attached File- Added 0009-altcp_tls_mbedtls-free-rx_app-on-dealloc.patch, #54887
        Attached File- Added 0010-altcp_tls_mbedtls-correct-ALTCP_MBEDTLS_PLATFORM_ALL.patch, #54888
    2023-06-27 hamzahajeir Attached File- Added 0005-altcp_tls_mbedtls-Mark-freed-members-to-prevent-doub.patch, #54883
        Attached File- Added 0006-altcp_tls_mbedtls-Add-mbedtls-return-values.patch, #54884
        Attached File- Added 0007-altcp_tls_mbedtls-Correctly-close-and-free-LISTEN-co.patch, #54885
        Attached File- Added 0008-altcp_tls_mbedtls-Use-handshake-steps-rather-than-a-.patch, #54886
    2023-06-27 hamzahajeir Attached File- Added 0001-altcp_tls_mbedtls-Copy-received-TCP-flags.patch, #54879
        Attached File- Added 0002-altcp_tls_mbedtls-Free-client-s-TLS-config-on-deallo.patch, #54880
        Attached File- Added 0003-altcp_tls_mbedtls-Fix-abort-management.patch, #54881
        Attached File- Added 0004-altcp_tls_mbedtls-Free-SSL-cache-and-session-tickets.patch, #54882

    Back to the top

    Powered by Savane 3.13-02a9.
    Corresponding source code