Skip to contentSkip to conversation

Introduce get_key_by_management_key_id helper function

PATCH Superseded Arne Schwabe 4 participants 11 messages May 17, 2023 – Jul 11, 2023

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 Introduce get_key_by_management_key_id helper function

This function allows us to map from a management key id to a key structure and also allows this function to be reused.

---
 src/openvpn/ssl_common.h | 20 ++++++++++++++++++++
 src/openvpn/ssl_verify.c | 17 +++++++----------
 2 files changed, 27 insertions(+), 10 deletions(-)
src/openvpn/ssl_common.h +20 -0
index 27b029479..ebfd25432 100644
@@ -722,4 +722,24 @@ get_primary_key(const struct tls_multi *multi)
     return &multi->session[TM_ACTIVE].key[KS_PRIMARY];
 }
 
+#ifdef ENABLE_MANAGEMENT
+/**
+ * Gets the \c key_state  object that belong to the management key id or
+ * return NULL if not found.
+ */
+static inline struct key_state *
+get_key_by_management_key_id(struct tls_multi *multi, unsigned int mda_key_id)
+{
+    for (int i = 0; i < KEY_SCAN_SIZE; ++i)
+    {
+        struct key_state *ks = get_key_scan(multi, i);
+        if (ks->mda_key_id == mda_key_id)
+        {
+            return ks;
+        }
+    }
+    return NULL;
+}
+#endif
+
 #endif /* SSL_COMMON_H_ */
src/openvpn/ssl_verify.c +7 -10
index 1b589f1a6..4c78c2b2c 100644
@@ -1268,22 +1268,19 @@ tls_authentication_status(struct tls_multi *multi)
 bool
 tls_authenticate_key(struct tls_multi *multi, const unsigned int mda_key_id, const bool auth, const char *client_reason)
 {
-    bool ret = false;
+    struct key_state *ks = NULL;
     if (multi)
     {
-        int i;
+
         auth_set_client_reason(multi, client_reason);
-        for (i = 0; i < KEY_SCAN_SIZE; ++i)
+        ks = get_key_by_management_key_id(multi, mda_key_id);
+
+        if (ks)
         {
-            struct key_state *ks = get_key_scan(multi, i);
-            if (ks->mda_key_id == mda_key_id)
-            {
-                ks->mda_status = auth ? ACF_SUCCEEDED : ACF_FAILED;
-                ret = true;
-            }
+            ks->mda_status = auth ? ACF_SUCCEEDED : ACF_FAILED;
         }
     }
-    return ret;
+    return (bool) ks;
 }
 #endif /* ifdef ENABLE_MANAGEMENT */
 
Signature · 1 line
2.39.2 (Apple Git-143)
#1 lore raw

PATCH 2/2 Fix CR_RESPONSE mangaement message using wrong key_id

the management interface expects the management key id instead of the openvpn key id. In the past they often were the same for low ids which hid the bug quite well.

Also do not pick uninitialised keystates (management key_id is not valid in these) and provide better logging when a key state is not found.

Change-Id If9fa1165a0e886b570b3738546ed810a32367cbe
---
 src/openvpn/push.c       | 4 ++--
 src/openvpn/ssl_common.h | 2 +-
 src/openvpn/ssl_verify.c | 5 +++++
 3 files changed, 8 insertions(+), 3 deletions(-)
src/openvpn/push.c +2 -2
index 8e9627199..8f0a534ac 100644
@@ -267,9 +267,9 @@ receive_cr_response(struct context *c, const struct buffer *buffer)
     struct tls_session *session = &c->c2.tls_multi->session[TM_ACTIVE];
     struct man_def_auth_context *mda = session->opt->mda_context;
     struct env_set *es = session->opt->es;
-    int key_id = get_primary_key(c->c2.tls_multi)->key_id;
+    unsigned int mda_key_id = get_primary_key(c->c2.tls_multi)->mda_key_id;
 
-    management_notify_client_cr_response(key_id, mda, es, m);
+    management_notify_client_cr_response(mda_key_id, mda, es, m);
 #endif
 #if ENABLE_PLUGIN
     verify_crresponse_plugin(c->c2.tls_multi, m);
src/openvpn/ssl_common.h +1 -1
index ebfd25432..be0f18746 100644
@@ -733,7 +733,7 @@ get_key_by_management_key_id(struct tls_multi *multi, unsigned int mda_key_id)
     for (int i = 0; i < KEY_SCAN_SIZE; ++i)
     {
         struct key_state *ks = get_key_scan(multi, i);
-        if (ks->mda_key_id == mda_key_id)
+        if (ks->mda_key_id == mda_key_id && ks->state > S_UNDEF)
         {
             return ks;
         }
src/openvpn/ssl_verify.c +5 -0
index 4c78c2b2c..567f55ea3 100644
@@ -1279,6 +1279,11 @@ tls_authenticate_key(struct tls_multi *multi, const unsigned int mda_key_id, con
         {
             ks->mda_status = auth ? ACF_SUCCEEDED : ACF_FAILED;
         }
+        else
+        {
+            msg(D_TLS_DEBUG_LOW, "%s: no key state found for management key id "
+                "%d", __func__, mda_key_id);
+        }
     }
     return (bool) ks;
 }
Signature · 1 line
2.39.2 (Apple Git-143)
#2 lore raw

Re: [Openvpn-devel] [PATCH 2/2] Fix CR_RESPONSE mangaement message using wrong key_id

Hi,

While this bugfix should be merged, I'm a conflicted about the way these two patches are split up. It just makes reviewing harder than it should be. They actually form two independent changes but with one half intersecting with the other for no reason.

Quoted 31 lines · Arne Schwabe

the management interface expects the management key id instead of the openvpn key id. In the past they often were the same for low ids which hid the bug quite well.

Also do not pick uninitialised keystates (management key_id is not valid in these) and provide better logging when a key state is not found.

Change-Id If9fa1165a0e886b570b3738546ed810a32367cbe
---
 src/openvpn/push.c       | 4 ++--
 src/openvpn/ssl_common.h | 2 +-
 src/openvpn/ssl_verify.c | 5 +++++
 3 files changed, 8 insertions(+), 3 deletions(-)
src/openvpn/push.c +2 -2
index 8e9627199..8f0a534ac 100644
@@ -267,9 +267,9 @@ receive_cr_response(struct context *c, const struct
 buffer *buffer)
     struct tls_session *session = &c->c2.tls_multi->session[TM_ACTIVE];
     struct man_def_auth_context *mda = session->opt->mda_context;
     struct env_set *es = session->opt->es;
-    int key_id = get_primary_key(c->c2.tls_multi)->key_id;
+    unsigned int mda_key_id =
 get_primary_key(c->c2.tls_multi)->mda_key_id;
 
-    management_notify_client_cr_response(key_id, mda, es, m);
+    management_notify_client_cr_response(mda_key_id, mda, es, m);
 #endif
Quoted 1 line

#if ENABLE_PLUGIN

     verify_crresponse_plugin(c->c2.tls_multi, m);
Quoted 1 line

I think, this patch could end here the bugfix is complete without the need for 1/2.

The rest of the patch depends on 1/2, but is not required for the above. It could be combined with 1/2 and submitted as a follow up refactoring patch.

Quoted 27 lines
src/openvpn/ssl_common.h +1 -1
index ebfd25432..be0f18746 100644
@@ -733,7 +733,7 @@ get_key_by_management_key_id(struct tls_multi *multi,
 unsigned int mda_key_id)
     for (int i = 0; i < KEY_SCAN_SIZE; ++i)
     {
         struct key_state *ks = get_key_scan(multi, i);
-        if (ks->mda_key_id == mda_key_id)
+        if (ks->mda_key_id == mda_key_id && ks->state > S_UNDEF)
         {
             return ks;
         }
src/openvpn/ssl_verify.c +0 -0
index 4c78c2b2c..567f55ea3 100644
@@ -1279,6 +1279,11 @@ tls_authenticate_key(struct tls_multi *multi, const

unsigned int mda_key_id, con

         {
             ks->mda_status = auth ? ACF_SUCCEEDED : ACF_FAILED;
         }
src/openvpn/ssl_verify.c +3 -0
+        else
+        {
+            msg(D_TLS_DEBUG_LOW, "%s: no key state found for management

key id "

src/openvpn/ssl_verify.c tls_authenticate_key(struct tls_multi *multi, const unsigned int mda_key_id, con · line 1289

Quoted 5 lines
src/openvpn/ssl_verify.c +2 -0
+                "%d", __func__, mda_key_id);
+        }
     }
     return (bool) ks;
 }

Selva

#3 lore raw

Re: [Openvpn-devel] [PATCH 2/2] Fix CR_RESPONSE mangaement message using wrong key_id

Am 19.05.23 um 15:45 schrieb Selva Nair:

Quoted 3 lines

Hi,

While this bugfix should be merged, I'm a conflicted about the way these two patches are split up. It just makes reviewing harder than it should be. They actually form two independent changes but with one half intersecting with the other for no reason.

Yeah. I moved the logging to 1/2. It seems to fit much better in that patch.

Arne

#4 lore raw

PATCH v2 1/2 Introduce get_key_by_management_key_id helper function

In reply to Arne Schwabe

This function allows us to map from a management key id to a key structure and also allows this function to be reused.

Patch v2: add message when key is not found.

---
 src/openvpn/ssl_common.h | 20 ++++++++++++++++++++
 src/openvpn/ssl_verify.c | 23 +++++++++++++----------
 2 files changed, 33 insertions(+), 10 deletions(-)
src/openvpn/ssl_common.h +20 -0
index 27b029479..ebfd25432 100644
@@ -722,4 +722,24 @@ get_primary_key(const struct tls_multi *multi)
     return &multi->session[TM_ACTIVE].key[KS_PRIMARY];
 }
 
+#ifdef ENABLE_MANAGEMENT
+/**
+ * Gets the \c key_state  object that belong to the management key id or
+ * return NULL if not found.
+ */
+static inline struct key_state *
+get_key_by_management_key_id(struct tls_multi *multi, unsigned int mda_key_id)
+{
+    for (int i = 0; i < KEY_SCAN_SIZE; ++i)
+    {
+        struct key_state *ks = get_key_scan(multi, i);
+        if (ks->mda_key_id == mda_key_id)
+        {
+            return ks;
+        }
+    }
+    return NULL;
+}
+#endif
+
 #endif /* SSL_COMMON_H_ */
src/openvpn/ssl_verify.c +13 -10
index 1b589f1a6..d4d291098 100644
@@ -1268,22 +1268,25 @@ tls_authentication_status(struct tls_multi *multi)
 bool
 tls_authenticate_key(struct tls_multi *multi, const unsigned int mda_key_id, const bool auth, const char *client_reason)
 {
-    bool ret = false;
+    struct key_state *ks = NULL;
     if (multi)
     {
-        int i;
+
         auth_set_client_reason(multi, client_reason);
-        for (i = 0; i < KEY_SCAN_SIZE; ++i)
+        ks = get_key_by_management_key_id(multi, mda_key_id);
+
+        if (ks)
         {
-            struct key_state *ks = get_key_scan(multi, i);
-            if (ks->mda_key_id == mda_key_id)
-            {
-                ks->mda_status = auth ? ACF_SUCCEEDED : ACF_FAILED;
-                ret = true;
-            }
+            ks->mda_status = auth ? ACF_SUCCEEDED : ACF_FAILED;
         }
+        else
+        {
+            msg(D_TLS_DEBUG_LOW, "%s: no key state found for management key id "
+                "%d", __func__, mda_key_id);
+        }
+
     }
-    return ret;
+    return (bool) ks;
 }
 #endif /* ifdef ENABLE_MANAGEMENT */
 
Signature · 1 line
2.39.2 (Apple Git-143)
#5 lore raw

PATCH v2 2/2 Fix CR_RESPONSE mangaement message using wrong key_id

the management interface expects the management key id instead of the openvpn key id. In the past they often were the same for low ids which hid the bug quite well.

Also do not pick uninitialised keystates (management key_id is not valid in these).

Patch v2: do not add logging

Change-Id If9fa1165a0e886b570b3738546ed810a32367cbe
---
 src/openvpn/push.c       | 4 ++--
 src/openvpn/ssl_common.h | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)
src/openvpn/push.c +2 -2
index 8e9627199..8f0a534ac 100644
@@ -267,9 +267,9 @@ receive_cr_response(struct context *c, const struct buffer *buffer)
     struct tls_session *session = &c->c2.tls_multi->session[TM_ACTIVE];
     struct man_def_auth_context *mda = session->opt->mda_context;
     struct env_set *es = session->opt->es;
-    int key_id = get_primary_key(c->c2.tls_multi)->key_id;
+    unsigned int mda_key_id = get_primary_key(c->c2.tls_multi)->mda_key_id;
 
-    management_notify_client_cr_response(key_id, mda, es, m);
+    management_notify_client_cr_response(mda_key_id, mda, es, m);
 #endif
 #if ENABLE_PLUGIN
     verify_crresponse_plugin(c->c2.tls_multi, m);
src/openvpn/ssl_common.h +1 -1
index ebfd25432..be0f18746 100644
@@ -733,7 +733,7 @@ get_key_by_management_key_id(struct tls_multi *multi, unsigned int mda_key_id)
     for (int i = 0; i < KEY_SCAN_SIZE; ++i)
     {
         struct key_state *ks = get_key_scan(multi, i);
-        if (ks->mda_key_id == mda_key_id)
+        if (ks->mda_key_id == mda_key_id && ks->state > S_UNDEF)
         {
             return ks;
         }
Signature · 1 line
2.39.2 (Apple Git-143)
#6 lore raw

Re: [Openvpn-devel] [PATCH v2 2/2] Fix CR_RESPONSE mangaement message using wrong key_id

Quoted 8 lines · Arne Schwabe

the management interface expects the management key id instead of the openvpn key id. In the past they often were the same for low ids which hid the bug quite well.

Also do not pick uninitialised keystates (management key_id is not valid in these).

Patch v2: do not add logging

Similar patch was sent in via https://github.com/OpenVPN/openvpn/pull/359,
so kinda sorta acked?

Quoted 28 lines
Change-Id If9fa1165a0e886b570b3738546ed810a32367cbe
---
 src/openvpn/push.c       | 4 ++--
 src/openvpn/ssl_common.h | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)
src/openvpn/push.c +2 -2
index 8e9627199..8f0a534ac 100644
@@ -267,9 +267,9 @@ receive_cr_response(struct context *c, const struct buffer *buffer)
     struct tls_session *session = &c->c2.tls_multi->session[TM_ACTIVE];
     struct man_def_auth_context *mda = session->opt->mda_context;
     struct env_set *es = session->opt->es;
-    int key_id = get_primary_key(c->c2.tls_multi)->key_id;
+    unsigned int mda_key_id = get_primary_key(c->c2.tls_multi)->mda_key_id;
 
-    management_notify_client_cr_response(key_id, mda, es, m);
+    management_notify_client_cr_response(mda_key_id, mda, es, m);
 #endif
 #if ENABLE_PLUGIN
     verify_crresponse_plugin(c->c2.tls_multi, m);
src/openvpn/ssl_common.h +0 -0
index ebfd25432..be0f18746 100644

src/openvpn/ssl_common.h get_key_by_management_key_id(struct tls_multi *multi, unsigned int mda_key_id) · line 739

Quoted 8 lines
src/openvpn/ssl_common.h +1 -1
@@ -733,7 +733,7 @@ get_key_by_management_key_id(struct tls_multi *multi, unsigned int mda_key_id)
     for (int i = 0; i < KEY_SCAN_SIZE; ++i)
     {
         struct key_state *ks = get_key_scan(multi, i);
-        if (ks->mda_key_id == mda_key_id)
+        if (ks->mda_key_id == mda_key_id && ks->state > S_UNDEF)
         {
             return ks;
         }

Regards,

Signature · 1 line
  Frank Lichtenheld
#7 lore raw

Re: [Openvpn-devel] [PATCH v2 2/2] Fix CR_RESPONSE mangaement message using wrong key_id

In reply to Arne Schwabe

It seems I missed to send this ACK to the list.. Here it is.

Quoted 48 lines · Arne Schwabe

the management interface expects the management key id instead of the openvpn key id. In the past they often were the same for low ids which hid the bug quite well.

Also do not pick uninitialised keystates (management key_id is not valid in these).

Patch v2: do not add logging

Change-Id If9fa1165a0e886b570b3738546ed810a32367cbe
---
 src/openvpn/push.c       | 4 ++--
 src/openvpn/ssl_common.h | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)
src/openvpn/push.c +2 -2
index 8e9627199..8f0a534ac 100644
@@ -267,9 +267,9 @@ receive_cr_response(struct context *c, const struct
 buffer *buffer)
     struct tls_session *session = &c->c2.tls_multi->session[TM_ACTIVE];
     struct man_def_auth_context *mda = session->opt->mda_context;
     struct env_set *es = session->opt->es;
-    int key_id = get_primary_key(c->c2.tls_multi)->key_id;
+    unsigned int mda_key_id =
 get_primary_key(c->c2.tls_multi)->mda_key_id;
 
-    management_notify_client_cr_response(key_id, mda, es, m);
+    management_notify_client_cr_response(mda_key_id, mda, es, m);
 #endif
 #if ENABLE_PLUGIN
     verify_crresponse_plugin(c->c2.tls_multi, m);
src/openvpn/ssl_common.h +1 -1
index ebfd25432..be0f18746 100644
@@ -733,7 +733,7 @@ get_key_by_management_key_id(struct tls_multi *multi,
 unsigned int mda_key_id)
     for (int i = 0; i < KEY_SCAN_SIZE; ++i)
     {
         struct key_state *ks = get_key_scan(multi, i);
-        if (ks->mda_key_id == mda_key_id)
+        if (ks->mda_key_id == mda_key_id && ks->state > S_UNDEF)
         {
             return ks;
         }
Quoted 4 lines

--
2.39.2 (Apple Git-143)

Acked-by Selva Nair <[email protected]...>

#8 lore raw

[Openvpn-devel] [PATCH applied] Re: Fix CR_RESPONSE mangaement message using wrong key_id

In reply to Arne Schwabe

Thanks for reminding me that there was something pending here as well...

This is a bit complicated, though. The bugfix needs to go to 2.6 as well, so "2/2 applied", but the v2 as sent to the list has a hunk that is really a bugfix for get_key_by_management_key_id(), which is in 1/2, and that is refactoring -> master.

So I've only applied the first hunk here, and the second hunk should go together with all of 1/2 into a "master only" patch. Right?

I have run this through the basic client test, which isn't exactly excercising the management interface (not at all) but I have nothing for that - so I'm relying on Selva's ACK and Jemmy Wang's test results in GH #359 on "does it actually fix the bug".

Your patch has been applied to the master and release/2.6 branch.

commit 223baa9c9b818e4c542a9037f190f53ce6f7af5c (master) commit 0caf0389454c75ae9dfeda096a820446d2d1a926 (HEAD -> release/2.6)

Author: Arne Schwabe
Date:   Mon May 22 12:11:38 2023 +0200
     Fix CR_RESPONSE mangaement message using wrong key_id

     Signed-off-by: Arne Schwabe <[email protected]...>
     Acked-by: Selva Nair <[email protected]...>
     Message-Id: <[email protected]...>
     URL: https://www.mail-archive.com/[email protected]/msg26719.html
     Signed-off-by: Gert Doering <[email protected]...>

--
kind regards,

Gert Doering

#9 lore raw

PATCH v3 1/1 Introduce get_key_by_management_key_id helper function

In reply to Arne Schwabe

This function allows us to map from a management key id to a key structure and also allows this function to be reused.

Patch v2: add message when key is not found.
Patch v3: only consider valid keys

Change-Id I42d8785959c24bf688190965e58b9b98251b8557
---
 src/openvpn/ssl_common.h | 20 ++++++++++++++++++++
 src/openvpn/ssl_verify.c | 23 +++++++++++++----------
 2 files changed, 33 insertions(+), 10 deletions(-)
src/openvpn/ssl_common.h +20 -0
index 27b029479..be0f18746 100644
@@ -722,4 +722,24 @@ get_primary_key(const struct tls_multi *multi)
     return &multi->session[TM_ACTIVE].key[KS_PRIMARY];
 }
 
+#ifdef ENABLE_MANAGEMENT
+/**
+ * Gets the \c key_state  object that belong to the management key id or
+ * return NULL if not found.
+ */
+static inline struct key_state *
+get_key_by_management_key_id(struct tls_multi *multi, unsigned int mda_key_id)
+{
+    for (int i = 0; i < KEY_SCAN_SIZE; ++i)
+    {
+        struct key_state *ks = get_key_scan(multi, i);
+        if (ks->mda_key_id == mda_key_id && ks->state > S_UNDEF)
+        {
+            return ks;
+        }
+    }
+    return NULL;
+}
+#endif
+
 #endif /* SSL_COMMON_H_ */
src/openvpn/ssl_verify.c +13 -10
index 90416b69e..2395e55c8 100644
@@ -1266,22 +1266,25 @@ tls_authentication_status(struct tls_multi *multi)
 bool
 tls_authenticate_key(struct tls_multi *multi, const unsigned int mda_key_id, const bool auth, const char *client_reason)
 {
-    bool ret = false;
+    struct key_state *ks = NULL;
     if (multi)
     {
-        int i;
+
         auth_set_client_reason(multi, client_reason);
-        for (i = 0; i < KEY_SCAN_SIZE; ++i)
+        ks = get_key_by_management_key_id(multi, mda_key_id);
+
+        if (ks)
         {
-            struct key_state *ks = get_key_scan(multi, i);
-            if (ks->mda_key_id == mda_key_id)
-            {
-                ks->mda_status = auth ? ACF_SUCCEEDED : ACF_FAILED;
-                ret = true;
-            }
+            ks->mda_status = auth ? ACF_SUCCEEDED : ACF_FAILED;
         }
+        else
+        {
+            msg(D_TLS_DEBUG_LOW, "%s: no key state found for management key id "
+                "%d", __func__, mda_key_id);
+        }
+
     }
-    return ret;
+    return (bool) ks;
 }
 #endif /* ifdef ENABLE_MANAGEMENT */
 
Signature · 1 line
2.39.2 (Apple Git-143)
#10 lore raw

PATCH v3 1/1 Introduce get_key_by_management_key_id helper function

In reply to Arne Schwabe

This function allows us to map from a management key id to a key structure and also allows this function to be reused.

Patch v2: add message when key is not found.
Patch v3: only consider valid keys

Change-Id I42d8785959c24bf688190965e58b9b98251b8557
---
 src/openvpn/ssl_common.h | 20 ++++++++++++++++++++
 src/openvpn/ssl_verify.c | 23 +++++++++++++----------
 2 files changed, 33 insertions(+), 10 deletions(-)
src/openvpn/ssl_common.h +20 -0
index 27b029479..be0f18746 100644
@@ -722,4 +722,24 @@ get_primary_key(const struct tls_multi *multi)
     return &multi->session[TM_ACTIVE].key[KS_PRIMARY];
 }
 
+#ifdef ENABLE_MANAGEMENT
+/**
+ * Gets the \c key_state  object that belong to the management key id or
+ * return NULL if not found.
+ */
+static inline struct key_state *
+get_key_by_management_key_id(struct tls_multi *multi, unsigned int mda_key_id)
+{
+    for (int i = 0; i < KEY_SCAN_SIZE; ++i)
+    {
+        struct key_state *ks = get_key_scan(multi, i);
+        if (ks->mda_key_id == mda_key_id && ks->state > S_UNDEF)
+        {
+            return ks;
+        }
+    }
+    return NULL;
+}
+#endif
+
 #endif /* SSL_COMMON_H_ */
src/openvpn/ssl_verify.c +13 -10
index 90416b69e..2395e55c8 100644
@@ -1266,22 +1266,25 @@ tls_authentication_status(struct tls_multi *multi)
 bool
 tls_authenticate_key(struct tls_multi *multi, const unsigned int mda_key_id, const bool auth, const char *client_reason)
 {
-    bool ret = false;
+    struct key_state *ks = NULL;
     if (multi)
     {
-        int i;
+
         auth_set_client_reason(multi, client_reason);
-        for (i = 0; i < KEY_SCAN_SIZE; ++i)
+        ks = get_key_by_management_key_id(multi, mda_key_id);
+
+        if (ks)
         {
-            struct key_state *ks = get_key_scan(multi, i);
-            if (ks->mda_key_id == mda_key_id)
-            {
-                ks->mda_status = auth ? ACF_SUCCEEDED : ACF_FAILED;
-                ret = true;
-            }
+            ks->mda_status = auth ? ACF_SUCCEEDED : ACF_FAILED;
         }
+        else
+        {
+            msg(D_TLS_DEBUG_LOW, "%s: no key state found for management key id "
+                "%d", __func__, mda_key_id);
+        }
+
     }
-    return ret;
+    return (bool) ks;
 }
 #endif /* ifdef ENABLE_MANAGEMENT */
 
Signature · 1 line
2.39.2 (Apple Git-143)