Skip to contentSkip to conversation

Fix compilation on pre-EKM mbedTLS libraries.

PATCH Superseded Gert Doering 2 participants 2 messages Oct 9, 2020

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Fix compilation on pre-EKM mbedTLS libraries.

commit f0734e49956217 simplified key_state_export_keying_material(), changing the function prototype. For older mbedTLS versions, there is "always fail" dummy function which was overlooked in that change.

Fix prototype.

---
 src/openvpn/ssl_mbedtls.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
src/openvpn/ssl_mbedtls.c +2 -3
index bb5633b7..b100d03e 100644
@@ -252,11 +252,10 @@ 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;
Signature · 1 line
2.22.0
#1 lore raw

Am 09.10.20 um 22:33 schrieb Gert Doering:

Quoted 20 lines

commit f0734e49956217 simplified key_state_export_keying_material(), changing the function prototype. For older mbedTLS versions, there is "always fail" dummy function which was overlooked in that change.

Fix prototype.

---
 src/openvpn/ssl_mbedtls.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
src/openvpn/ssl_mbedtls.c +0 -0
index bb5633b7..b100d03e 100644
@@ -252,11 +252,10 @@ key_state_export_keying_material(struct tls_session *session,
     }
 }
 #else

src/openvpn/ssl_mbedtls.c key_state_export_keying_material(struct tls_session *session, · line 261

Quoted 10 lines
src/openvpn/ssl_mbedtls.c +2 -3
-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;

Well, if we fix, it we should fix all the way and not return NULL which gets coerced to false.

Arne