[Openvpn-devel,v2] Fix compilation on pre-EKM mbedTLS libraries.

Message ID 20201010081435.2154-1-gert@greenie.muc.de
State Accepted
Headers show
Series
  • [Openvpn-devel,v2] Fix compilation on pre-EKM mbedTLS libraries.
Related show

Commit Message

Gert Doering Oct. 10, 2020, 8:14 a.m.
commit f0734e49956217 simplified key_state_export_keying_material(),
changing the function prototype.  For older mbedTLS versions, there
is an "always fail" dummy function which was overlooked in that change.

Fix prototype.

v2: also adjust function return (NULL -> false)

Signed-off-by: Gert Doering <gert@greenie.muc.de>
---
 src/openvpn/ssl_mbedtls.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

Comments

Steffan Karger Oct. 10, 2020, 9:08 a.m. | #1
Hi,

On 10-10-2020 10:14, Gert Doering wrote:
> commit f0734e49956217 simplified key_state_export_keying_material(),
> changing the function prototype.  For older mbedTLS versions, there
> is an "always fail" dummy function which was overlooked in that change.
> 
> Fix prototype.
> 
> v2: also adjust function return (NULL -> false)
> 
> Signed-off-by: Gert Doering <gert@greenie.muc.de>
> ---
>  src/openvpn/ssl_mbedtls.c | 7 +++----
>  1 file changed, 3 insertions(+), 4 deletions(-)
> 
> diff --git a/src/openvpn/ssl_mbedtls.c b/src/openvpn/ssl_mbedtls.c
> index bb5633b7..11fbeae4 100644
> --- a/src/openvpn/ssl_mbedtls.c
> +++ b/src/openvpn/ssl_mbedtls.c
> @@ -252,14 +252,13 @@ key_state_export_keying_material(struct tls_session *session,
>      }
>  }
>  #else
> -unsigned char*
> +bool
>  key_state_export_keying_material(struct tls_session *session,
>                                   const char* label, size_t label_size,
> -                                 size_t ekm_size,
> -                                 struct gc_arena *gc)
> +                                 void *ekm, size_t ekm_size)
>  {
>      /* Dummy function to avoid ifdefs in the common code */
> -    return NULL;
> +    return false;
>  }
>  #endif /* HAVE_EXPORT_KEYING_MATERIAL */
>  
> 

Sorry, totally missed this. Fix looks good.

Acked-by: Steffan Karger <steffan@karger.me>

-Steffan
Gert Doering Oct. 10, 2020, 9:11 a.m. | #2
Patch has been applied to the master branch.

commit 14bd92b7e4a698678200f439ddda1ee321bb8ee8
Author: Gert Doering
Date:   Sat Oct 10 10:14:35 2020 +0200

     Fix compilation on pre-EKM mbedTLS libraries.

     Signed-off-by: Gert Doering <gert@greenie.muc.de>
     Acked-by: Steffan Karger <steffan@karger.me>
     Message-Id: <20201010081435.2154-1-gert@greenie.muc.de>
     URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg21198.html
     Signed-off-by: Gert Doering <gert@greenie.muc.de>


--
kind regards,

Gert Doering

Patch

diff --git a/src/openvpn/ssl_mbedtls.c b/src/openvpn/ssl_mbedtls.c
index bb5633b7..11fbeae4 100644
--- a/src/openvpn/ssl_mbedtls.c
+++ b/src/openvpn/ssl_mbedtls.c
@@ -252,14 +252,13 @@  key_state_export_keying_material(struct tls_session *session,
     }
 }
 #else
-unsigned char*
+bool
 key_state_export_keying_material(struct tls_session *session,
                                  const char* label, size_t label_size,
-                                 size_t ekm_size,
-                                 struct gc_arena *gc)
+                                 void *ekm, size_t ekm_size)
 {
     /* Dummy function to avoid ifdefs in the common code */
-    return NULL;
+    return false;
 }
 #endif /* HAVE_EXPORT_KEYING_MATERIAL */