[PATCH 1/2] mongoose: Fix includes for wolfSSL build

40 views
Skip to first unread message

Bastian Germann

unread,
Oct 7, 2022, 12:50:32 PM10/7/22
to swup...@googlegroups.com, Bastian Germann
Fixes: 0c5b7d2160 ("mongoose: updated to 6.18")
Signed-off-by: Bastian Germann <ba...@debian.org>
---
mongoose/mongoose.h | 5 +++++
1 file changed, 5 insertions(+)

diff --git a/mongoose/mongoose.h b/mongoose/mongoose.h
index 332830e..bed23ca 100644
--- a/mongoose/mongoose.h
+++ b/mongoose/mongoose.h
@@ -1224,8 +1224,13 @@ struct mg_tls {

#if MG_ENABLE_OPENSSL

+#ifdef CONFIG_SSL_IMPL_WOLFSSL
+#include <wolfssl/openssl/err.h>
+#include <wolfssl/openssl/ssl.h>
+#else
#include <openssl/err.h>
#include <openssl/ssl.h>
+#endif

struct mg_tls {
SSL_CTX *ctx;
--
2.37.2

James Hilliard

unread,
Oct 10, 2022, 12:50:07 AM10/10/22
to Bastian Germann, swup...@googlegroups.com
On Fri, Oct 7, 2022 at 12:50 PM Bastian Germann <ba...@debian.org> wrote:
>
> Fixes: 0c5b7d2160 ("mongoose: updated to 6.18")
> Signed-off-by: Bastian Germann <ba...@debian.org>
> ---
> mongoose/mongoose.h | 5 +++++
> 1 file changed, 5 insertions(+)
>
> diff --git a/mongoose/mongoose.h b/mongoose/mongoose.h
> index 332830e..bed23ca 100644
> --- a/mongoose/mongoose.h
> +++ b/mongoose/mongoose.h

Modifications to mongoose.c/mongoose.h should be sent upstream to:
https://github.com/cesanta/mongoose

> @@ -1224,8 +1224,13 @@ struct mg_tls {
>
> #if MG_ENABLE_OPENSSL
>
> +#ifdef CONFIG_SSL_IMPL_WOLFSSL
> +#include <wolfssl/openssl/err.h>
> +#include <wolfssl/openssl/ssl.h>

This could go here instead maybe?
https://github.com/sbabic/swupdate/blob/c8341e29b2dea2ebf08fcb0b771d4e416ab8018a/mongoose/mongoose_interface.c#L31

> +#else
> #include <openssl/err.h>
> #include <openssl/ssl.h>
> +#endif
>
> struct mg_tls {
> SSL_CTX *ctx;
> --
> 2.37.2
>
> --
> You received this message because you are subscribed to the Google Groups "swupdate" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to swupdate+u...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/swupdate/20221007165028.21365-2-bage%40debian.org.

Stefano Babic

unread,
Oct 10, 2022, 4:15:14 AM10/10/22
to Bastian Germann, swup...@googlegroups.com
Hi Bastian,

On 07.10.22 18:50, Bastian Germann wrote:
> Fixes: 0c5b7d2160 ("mongoose: updated to 6.18")

But mongoose was updated with ce8702ce7e to 7.8 - see on -master.
Best regards,
Stefano

--
=====================================================================
DENX Software Engineering GmbH, Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, 82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sba...@denx.de
=====================================================================

Bastian Germann

unread,
Oct 10, 2022, 4:48:29 AM10/10/22
to Stefano Babic, swup...@googlegroups.com
Am 10.10.22 um 10:15 schrieb Stefano Babic:
> Hi Bastian,
>
> On 07.10.22 18:50, Bastian Germann wrote:
>> Fixes: 0c5b7d2160 ("mongoose: updated to 6.18")
>
> But mongoose was updated with  ce8702ce7e to 7.8 - see on -master.

I know. But still this one fixes that commit since the thing was broken since then.
The 2/2 patch has a fix for the update.

Stefano Babic

unread,
Oct 10, 2022, 10:01:10 AM10/10/22
to James Hilliard, Bastian Germann, swup...@googlegroups.com
On 10.10.22 06:49, James Hilliard wrote:
> On Fri, Oct 7, 2022 at 12:50 PM Bastian Germann <ba...@debian.org> wrote:
>>
>> Fixes: 0c5b7d2160 ("mongoose: updated to 6.18")
>> Signed-off-by: Bastian Germann <ba...@debian.org>
>> ---
>> mongoose/mongoose.h | 5 +++++
>> 1 file changed, 5 insertions(+)
>>
>> diff --git a/mongoose/mongoose.h b/mongoose/mongoose.h
>> index 332830e..bed23ca 100644
>> --- a/mongoose/mongoose.h
>> +++ b/mongoose/mongoose.h
>
> Modifications to mongoose.c/mongoose.h should be sent upstream to:
> https://github.com/cesanta/mongoose

This is of course the preferred way, so we have not to patch again
ourselves when a new Mongoose's version is released. Anyway, I am not
against to merge this in SWUpdate until it flows to mongoose's mainline.

>
>> @@ -1224,8 +1224,13 @@ struct mg_tls {
>>
>> #if MG_ENABLE_OPENSSL
>>
>> +#ifdef CONFIG_SSL_IMPL_WOLFSSL
>> +#include <wolfssl/openssl/err.h>
>> +#include <wolfssl/openssl/ssl.h>
>
> This could go here instead maybe?
> https://github.com/sbabic/swupdate/blob/c8341e29b2dea2ebf08fcb0b771d4e416ab8018a/mongoose/mongoose_interface.c#L31

I guess not - mongoose.c uses just plain mongoose.h and does not include
mongoose_interface (and it is correct), but then the wrong headers (from
openSSL) are included instead of the ones from Wolfssl.


Best regards,
Stefano

>
>> +#else
>> #include <openssl/err.h>
>> #include <openssl/ssl.h>
>> +#endif
>>
>> struct mg_tls {
>> SSL_CTX *ctx;
>> --
>> 2.37.2
>>
>> --
>> You received this message because you are subscribed to the Google Groups "swupdate" group.
>> To unsubscribe from this group and stop receiving emails from it, send an email to swupdate+u...@googlegroups.com.
>> To view this discussion on the web visit https://groups.google.com/d/msgid/swupdate/20221007165028.21365-2-bage%40debian.org.
>

Reply all
Reply to author
Forward
0 new messages