[network-manager-sstp] Restore the subject name from VPN configuration



commit 7a92c27637e309b829cf46f593ff39f8e228f8db
Author: Eivind Næss <eivnaes yahoo com>
Date:   Mon Apr 11 16:05:40 2022 -0700

    Restore the subject name from VPN configuration
    
    Without it, the second time you open and save the VPN configuration causes
    the nm-sstp-service to omit the "name <identity>" and thus the EAP-TLS
    negotiation fails.
    
    This value is automatically obtained by the subject name of the certificate
    and can be overriden in the Advanced settings dialog by setting a value for
    Identiy (see TLS page).
    
    Like for any instance of EAP, the Identity is used on the Authentication
    server to propose the correct EAP authentication. It is also used to establish
    the correct authentication credentials in case of EAP-TLS, i.e. the identity
    as presented to the server during EAP Identity should match that of the
    certificate's subject name.
    
    Signed-off-by: Eivind Næss <eivnaes yahoo com>

 properties/nm-sstp-editor.c | 5 +++++
 1 file changed, 5 insertions(+)
---
diff --git a/properties/nm-sstp-editor.c b/properties/nm-sstp-editor.c
index f750106..14d5f71 100644
--- a/properties/nm-sstp-editor.c
+++ b/properties/nm-sstp-editor.c
@@ -443,6 +443,11 @@ tls_setup(SstpPluginUiWidget *self, NMSettingVpn *s_vpn, ChangedCallback changed
         if (value) {
             nma_cert_chooser_set_key_password (cert, value);
         }
+
+        value = nm_setting_vpn_get_data_item (s_vpn, NM_SSTP_KEY_TLS_SUBJECT_NAME);
+        if (value && *value) {
+            priv->subject = g_strdup (value);
+        }
     }
 
     nma_cert_chooser_setup_key_password_storage (cert, 0, (NMSetting *) s_vpn,


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]