about summary refs log tree commit diff
path: root/src/core/supplicant
diff options
context:
space:
mode:
authorJeremy Bicha <jeremy.bicha@canonical.com>2023-01-04 18:29:22 -0500
committerJeremy Bicha <jeremy.bicha@canonical.com>2023-01-04 18:29:22 -0500
commitb40fb4d87dea97023ceae223cc8f3ded60726fe0 (patch)
tree26768660a2db4134bde3c42e99bf1c84fb631adf /src/core/supplicant
parent47995cc5a8e379555be2d010c4201bdc56c8fca4 (diff)
parentb2ca000f0e0a915aba25f7d16b34bd092055ad59 (diff)
Merge tag 'debian/1.40.8-1' into ubuntu/master
network-manager Debian release 1.40.8-1
Diffstat (limited to 'src/core/supplicant')
-rw-r--r--src/core/supplicant/nm-supplicant-config.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/core/supplicant/nm-supplicant-config.c b/src/core/supplicant/nm-supplicant-config.c
index 22c422a2..bd48ed92 100644
--- a/src/core/supplicant/nm-supplicant-config.c
+++ b/src/core/supplicant/nm-supplicant-config.c
@@ -403,6 +403,7 @@ nm_supplicant_config_add_setting_macsec(NMSupplicantConfig *self,
     const char *value;
     char        buf[32];
     int         port;
+    gsize       key_len;
 
     g_return_val_if_fail(NM_IS_SUPPLICANT_CONFIG(self), FALSE);
     g_return_val_if_fail(setting != NULL, FALSE);
@@ -446,7 +447,16 @@ nm_supplicant_config_add_setting_macsec(NMSupplicantConfig *self,
             return FALSE;
 
         value = nm_setting_macsec_get_mka_ckn(setting);
-        if (!value || !nm_utils_hexstr2bin_buf(value, FALSE, FALSE, NULL, buffer_ckn)) {
+        if (!value
+            || !nm_utils_hexstr2bin_full(value,
+                                         FALSE,
+                                         FALSE,
+                                         FALSE,
+                                         NULL,
+                                         0,
+                                         buffer_ckn,
+                                         G_N_ELEMENTS(buffer_ckn),
+                                         &key_len)) {
             g_set_error_literal(error,
                                 NM_SUPPLICANT_ERROR,
                                 NM_SUPPLICANT_ERROR_CONFIG,
@@ -456,7 +466,7 @@ nm_supplicant_config_add_setting_macsec(NMSupplicantConfig *self,
         if (!nm_supplicant_config_add_option(self,
                                              "mka_ckn",
                                              (char *) buffer_ckn,
-                                             sizeof(buffer_ckn),
+                                             key_len,
                                              value,
                                              error))
             return FALSE;