diff mbox series

[2/2] mongoose: Compatibility macro for SSL_set1_host

Message ID 20221007165028.21365-3-bage@debian.org
State Superseded
Headers show
Series mongoose: Fix build with wolfSSL | expand

Commit Message

Bastian Germann Oct. 7, 2022, 4:50 p.m. UTC
SSL_set1_host is missing from wolfSSL's OpenSSL compatibility layer.
It was introduced with mongoose 7.8 and earlier versions relied on
X509_VERIFY_PARAM_set1_host. Use that function again for wolfSSL.

Link: https://github.com/cesanta/mongoose/commit/d65ce3b59698fbbd32222e43
Fixes: 569c1d7870 ("mongoose: Update to version 7.8")
Signed-off-by: Bastian Germann <bage@debian.org>
---
 mongoose/mongoose.h | 2 ++
 1 file changed, 2 insertions(+)

Comments

James Hilliard Oct. 10, 2022, 4:42 a.m. UTC | #1
On Fri, Oct 7, 2022 at 12:50 PM Bastian Germann <bage@debian.org> wrote:
>
> SSL_set1_host is missing from wolfSSL's OpenSSL compatibility layer.

Shouldn't this be fixed in wolfSSL's OpenSSL compatibility layer instead?

> It was introduced with mongoose 7.8 and earlier versions relied on
> X509_VERIFY_PARAM_set1_host. Use that function again for wolfSSL.
>
> Link: https://github.com/cesanta/mongoose/commit/d65ce3b59698fbbd32222e43
> Fixes: 569c1d7870 ("mongoose: Update to version 7.8")
> Signed-off-by: Bastian Germann <bage@debian.org>
> ---
>  mongoose/mongoose.h | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/mongoose/mongoose.h b/mongoose/mongoose.h
> index bed23ca..8de25d5 100644
> --- a/mongoose/mongoose.h
> +++ b/mongoose/mongoose.h
> @@ -1227,6 +1227,8 @@ struct mg_tls {
>  #ifdef CONFIG_SSL_IMPL_WOLFSSL
>  #include <wolfssl/openssl/err.h>
>  #include <wolfssl/openssl/ssl.h>
> +#define SSL_set1_host(param, name_null_term) \
> +        X509_VERIFY_PARAM_set1_host(SSL_get0_param(param), name_null_term, 0);
>  #else
>  #include <openssl/err.h>
>  #include <openssl/ssl.h>
> --
> 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+unsubscribe@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/swupdate/20221007165028.21365-3-bage%40debian.org.
Bastian Germann Oct. 10, 2022, 4:44 p.m. UTC | #2
Am 10.10.22 um 06:42 schrieb James Hilliard:
> On Fri, Oct 7, 2022 at 12:50 PM Bastian Germann <bage@debian.org> wrote:
>>
>> SSL_set1_host is missing from wolfSSL's OpenSSL compatibility layer.
> 
> Shouldn't this be fixed in wolfSSL's OpenSSL compatibility layer instead?

I have added a feature request: https://github.com/wolfSSL/wolfssl/issues/5681
diff mbox series

Patch

diff --git a/mongoose/mongoose.h b/mongoose/mongoose.h
index bed23ca..8de25d5 100644
--- a/mongoose/mongoose.h
+++ b/mongoose/mongoose.h
@@ -1227,6 +1227,8 @@  struct mg_tls {
 #ifdef CONFIG_SSL_IMPL_WOLFSSL
 #include <wolfssl/openssl/err.h>
 #include <wolfssl/openssl/ssl.h>
+#define SSL_set1_host(param, name_null_term) \
+        X509_VERIFY_PARAM_set1_host(SSL_get0_param(param), name_null_term, 0);
 #else
 #include <openssl/err.h>
 #include <openssl/ssl.h>