<feed xmlns='http://www.w3.org/2005/Atom'>
<title>u-boot.git/lib/lwip, branch v2025.04</title>
<subtitle>Unnamed repository; edit this file 'description' to name the repository.</subtitle>
<id>http://cgit.235523.xyz/u-boot.git/atom/lib/lwip?h=v2025.04</id>
<link rel='self' href='http://cgit.235523.xyz/u-boot.git/atom/lib/lwip?h=v2025.04'/>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/'/>
<updated>2025-02-12T18:37:19Z</updated>
<entry>
<title>net: use strnstr() for lwip_strnstr()</title>
<updated>2025-02-12T18:37:19Z</updated>
<author>
<name>Heinrich Schuchardt</name>
<email>heinrich.schuchardt@canonical.com</email>
</author>
<published>2025-02-03T09:12:02Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=331d75544fc843f93275eb3767753e4a0a712a39'/>
<id>urn:sha1:331d75544fc843f93275eb3767753e4a0a712a39</id>
<content type='text'>
Using strstr() instead of strnstr() creates a security concern.

Fixes: 1c41a7afaa15 ("net: lwip: build lwIP")
Signed-off-by: Heinrich Schuchardt &lt;heinrich.schuchardt@canonical.com&gt;
Reviewed-by: Jerome Forissier &lt;jerome.forissier@linaro.org&gt;
Reviewed-by: Ilias Apalodimas &lt;ilias.apalodimas@linaro.org&gt;
Signed-off-by: Jerome Forissier &lt;jerome.forissier@linaro.org&gt;
</content>
</entry>
<entry>
<title>net: lwip: tftp: fix find_option()</title>
<updated>2025-02-12T18:37:05Z</updated>
<author>
<name>Heinrich Schuchardt</name>
<email>heinrich.schuchardt@canonical.com</email>
</author>
<published>2025-02-03T09:11:59Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=10917df17f247d3b0a7f5ca992b97bd2728ef09e'/>
<id>urn:sha1:10917df17f247d3b0a7f5ca992b97bd2728ef09e</id>
<content type='text'>
Find_option() is used to retrieve the block size value in an option
acknowledgment in response to a request containing a block size option
according to RFC2348.

The format of an OACK response is described in RFC2347 as

+-------+---~~---+---+---~~---+---+---~~---+---+---~~---+---+
|  opc  |  opt1  | 0 | value1 | 0 |  optN  | 0 | valueN | 0 |
+-------+---~~---+---+---~~---+---+---~~---+---+---~~---+---+

The current implementation of find_option() only works if

* blksize is the first option
* lwip_strnstr() ignores the length parameter,
  i.e. is implemented via strstr()

The OACK messages starts with  0x00 0x06. If 'blksize' is the first option,
strstr() reports a match when the first parameter points to 0x06. Adding
the string length of 'blksize' plus 2 to the location of the 0x06 byte
points to the value.

Find_option() would report a match for option 'blksize' if the response
contained an option called 'foo_blksize_bar'. In this case find_option()
would return 'bar' as the value string.

If 'blksize' were the second option, find_option() would return a pointer
to the second character of the value string.

Furthermore find_option() does not detect if the value string is NUL
terminated. This may lead to a buffer overrun.

Provide an implementation that correctly steps from option to option.

Fixes: 27d7ccda94fa ("net: lwip: tftp: add support of blksize option to client")
Signed-off-by: Heinrich Schuchardt &lt;heinrich.schuchardt@canonical.com&gt;
Reviewed-by: Jerome Forissier &lt;jerome.forissier@linaro.org&gt;
Tested-by: Jerome Forissier &lt;jerome.forissier@linaro.org&gt; (qemu_arm64_lwip)
Signed-off-by: Jerome Forissier &lt;jerome.forissier@linaro.org&gt;
</content>
</entry>
<entry>
<title>mbedtls: remove MBEDTLS_HAVE_TIME</title>
<updated>2024-12-06T23:47:23Z</updated>
<author>
<name>Ilias Apalodimas</name>
<email>ilias.apalodimas@linaro.org</email>
</author>
<published>2024-12-06T10:56:45Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=45f05f681224d88d1b170063001b59edc8fc24cf'/>
<id>urn:sha1:45f05f681224d88d1b170063001b59edc8fc24cf</id>
<content type='text'>
When MbedTLS TLS features were added MBEDTLS_HAVE_TIME was defined as part
of enabling https:// support. However that pointed to the wrong function
which could crash if it received a NULL pointer.

Looking closer that function is not really needed, as it only seems to
increase the RNG entropy by using 4b of the current time and date.
The reason that was enabled is that lwIP was unconditionally requiring it,
although it's configurable and can be turned off.

Since lwIP doesn't use that field anywhere else, make it conditional and
disable it from our config.

Fixes: commit a564f5094f62 ("mbedtls: Enable TLS 1.2 support")
Reported-by: Heinrich Schuchardt &lt;heinrich.schuchardt@canonical.com&gt;
Signed-off-by: Ilias Apalodimas &lt;ilias.apalodimas@linaro.org&gt;
Reviewed-by: Heinrich Schuchardt &lt;xypron.glpk@gmx.de&gt;
Acked-by: Jerome Forissier &lt;jerome.forissier@linaro.org&gt;
</content>
</entry>
<entry>
<title>net: disable MBEDTLS in SPL</title>
<updated>2024-12-06T23:47:23Z</updated>
<author>
<name>Heinrich Schuchardt</name>
<email>heinrich.schuchardt@canonical.com</email>
</author>
<published>2024-12-06T11:37:09Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=c7401fc1d99b88a3a3d16519f07974473908cd46'/>
<id>urn:sha1:c7401fc1d99b88a3a3d16519f07974473908cd46</id>
<content type='text'>
Building SPL fails with MBEDTLS enabled.
Currently we don't need it there.

Signed-off-by: Heinrich Schuchardt &lt;heinrich.schuchardt@canonical.com&gt;
Acked-by: Jerome Forissier &lt;jerome.forissier@linaro.org&gt;
</content>
</entry>
<entry>
<title>lwip: fix code style issues</title>
<updated>2024-11-15T00:14:05Z</updated>
<author>
<name>Jerome Forissier</name>
<email>jerome.forissier@linaro.org</email>
</author>
<published>2024-11-07T11:27:57Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=356011f7ac25113d44869350d352a3fc64a7ee75'/>
<id>urn:sha1:356011f7ac25113d44869350d352a3fc64a7ee75</id>
<content type='text'>
Fix various code style issues in the lwIP code.

Reported-by: Tom Rini &lt;trini@konsulko.com&gt;
Signed-off-by: Jerome Forissier &lt;jerome.forissier@linaro.org&gt;
Acked-by: Ilias Apalodimas &lt;ilias.apalodimas@linaro.org&gt;
</content>
</entry>
<entry>
<title>net: lwip: Add Support Server Name Indication support</title>
<updated>2024-11-13T01:09:52Z</updated>
<author>
<name>Javier Tia</name>
<email>javier.tia@linaro.org</email>
</author>
<published>2024-11-10T08:28:39Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=1f444e915ec8e8abfb11dccb7b9d8340096695b4'/>
<id>urn:sha1:1f444e915ec8e8abfb11dccb7b9d8340096695b4</id>
<content type='text'>
SNI, or Server Name Indication, is an addition to the TLS encryption
protocol that enables a client device to specify the domain name it is
trying to reach in the first step of the TLS handshake, preventing
common name mismatch errors and not reaching to HTTPS server that
enforce this condition. Since most of the websites require it nowadays
add support for it.

It's worth noting that this is already sent to lwIP [0]

[0] https://github.com/lwip-tcpip/lwip/pull/47

Signed-off-by: Javier Tia &lt;javier.tia@linaro.org&gt;
Reviewed-by: Jerome Forissier &lt;jerome.forissier@linaro.org&gt;
Signed-off-by: Ilias Apalodimas &lt;ilias.apalodimas@linaro.org&gt;
</content>
</entry>
<entry>
<title>net: lwip: Update lwIP for mbedTLS &gt; 3.0 support and enable https</title>
<updated>2024-11-13T01:09:52Z</updated>
<author>
<name>Javier Tia</name>
<email>javier.tia@linaro.org</email>
</author>
<published>2024-11-10T08:28:38Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=514f18f8dcbdb7e5e556d0bfe567b61497fecf4c'/>
<id>urn:sha1:514f18f8dcbdb7e5e556d0bfe567b61497fecf4c</id>
<content type='text'>
The current code support mbedTLS 2.28. Since we are using a newer
version in U-Boot, update the necessary accessors and the lwIP codebase
to work with mbedTLS 3.6.0. It's worth noting that the patches are
already sent to lwIP [0]

While at it enable LWIP_ALTCP_TLS and enable TLS support in lwIP

[0] https://github.com/lwip-tcpip/lwip/pull/47

Signed-off-by: Javier Tia &lt;javier.tia@linaro.org&gt;
Acked-by: Jerome Forissier &lt;jerome.forissier@linaro.org&gt;
Signed-off-by: Ilias Apalodimas &lt;ilias.apalodimas@linaro.org&gt;
</content>
</entry>
<entry>
<title>net: lwip: tftp: add support of blksize option to client</title>
<updated>2024-10-16T17:11:57Z</updated>
<author>
<name>Jerome Forissier</name>
<email>jerome.forissier@linaro.org</email>
</author>
<published>2024-10-16T10:04:12Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=27d7ccda94fa03d15d4d4f6f359d9fa09c697679'/>
<id>urn:sha1:27d7ccda94fa03d15d4d4f6f359d9fa09c697679</id>
<content type='text'>
The TFTP protocol uses a default block size of 512 bytes. This value is
sub-optimal for ethernet devices, which have a MTU (Maximum Transmission
Unit) of 1500 bytes. When taking into acount the overhead of the IP and
UDP layers, this leaves 1468 bytes for the TFTP payload.

This patch introduces a new function: tftp_client_set_blksize() which
may be used to change the block size from the default. It has to be
called after tftp_client_init() and before tftp_get(). If the server
does not support the option, the client will still accept to receive
512-byte blocks.

Submitted upstream: https://savannah.nongnu.org/patch/index.php?10462

Signed-off-by: Jerome Forissier &lt;jerome.forissier@linaro.org&gt;
Acked-by: Ilias Apalodimas &lt;ilias.apalodimas@linaro.org&gt;
</content>
</entry>
<entry>
<title>net: lwip: tftp: bind to TFTP port only when in server mode</title>
<updated>2024-10-16T17:11:56Z</updated>
<author>
<name>Jerome Forissier</name>
<email>jerome.forissier@linaro.org</email>
</author>
<published>2024-10-16T10:04:04Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=5634ecc88e9fc9bd1bd422861ee4d9dbac851b32'/>
<id>urn:sha1:5634ecc88e9fc9bd1bd422861ee4d9dbac851b32</id>
<content type='text'>
The TFTP app should not bind to the TFTP server port when configured as
a client. Instead, the local port should be chosen from the dynamic
range (49152 ~ 65535) so that if the application is stopped and started
again, the remote server will not consider the new packets as part of
the same context (which would cause an error since a new RRQ would be
unexpected).

Submitted upstream: https://savannah.nongnu.org/patch/?10480

Signed-off-by: Jerome Forissier &lt;jerome.forissier@linaro.org&gt;
Reviewed-by: Ilias Apalodimas &lt;ilias.apalodimas@linaro.org&gt;
</content>
</entry>
<entry>
<title>net: lwip: build lwIP</title>
<updated>2024-10-16T17:11:56Z</updated>
<author>
<name>Jerome Forissier</name>
<email>jerome.forissier@linaro.org</email>
</author>
<published>2024-10-16T10:04:02Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=1c41a7afaa15dded7cc4c42be61fa811e034e97b'/>
<id>urn:sha1:1c41a7afaa15dded7cc4c42be61fa811e034e97b</id>
<content type='text'>
Build the lwIP library when NET_LWIP is enabled. The following files
are adaptation layers written specially for U-Boot:

 lib/lwip/u-boot/arch/cc.h
 lib/lwip/u-boot/arch/sys_arch.h (empty)
 lib/lwip/u-boot/limits.h (empty)
 lib/lwip/u-boot/lwipopts.h

They were initially contributed by Maxim in a previous RFC patch series.

The lwIP stack needs to be added as a Git subtree with the following
command:

 $ git subtree add --squash --prefix lib/lwip/lwip \
   https://github.com/lwip-tcpip/lwip.git  STABLE-2_2_0_RELEASE

Signed-off-by: Jerome Forissier &lt;jerome.forissier@linaro.org&gt;
Co-developed-by: Maxim Uvarov &lt;muvarov@gmail.com&gt;
Cc: Maxim Uvarov &lt;muvarov@gmail.com&gt;
Acked-by: Ilias Apalodimas &lt;ilias.apalodimas@linaro.org&gt;
</content>
</entry>
</feed>
