about summary refs log tree commit diff
path: root/src/core/supplicant
diff options
context:
space:
mode:
authorMichael Biebl <biebl@debian.org>2022-12-18 21:32:59 +0100
committerMichael Biebl <biebl@debian.org>2022-12-18 21:32:59 +0100
commitf08ae1668e2f4f5ad4649eb7e47730625026bca2 (patch)
treec836083cba838563c5b333696b796cf28a6a1b0b /src/core/supplicant
parentbfd2ca916ff5aa53d394178c3beeb17680a0e2c5 (diff)
parent2965dc70bb3cbfa8de2f279761812b84b87600cb (diff)
Update upstream source from tag 'upstream/1.40.8'
Update to upstream version '1.40.8'
with Debian dir 5c809f5de1842697051e414edf8c873684b9b3fe
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;