[gtk-frdp/wip/oholy/fix-livelock] frdp-session: Fix livelock when certificate is changed



commit 8bf5267b85310a1c06463dc41ec5f388bec5f232
Author: Ondrej Holy <oholy redhat com>
Date:   Fri May 15 17:08:50 2020 +0200

    frdp-session: Fix livelock when certificate is changed
    
    Currently, gtk-frdp loops forever when the certificate is changed.
    Let's silently accept the changed certificate to fix the loop.
    
    It is bad to accept certificates without informing the user, but
    I suppose that this change is acceptable given the fact that the
    inital certificate is also silently used... before gtk-frdp will
    get proper API to handle certificates.
    
    Fixes: https://gitlab.gnome.org/GNOME/gtk-frdp/-/issues/21

 src/frdp-session.c | 15 +++++++++++++++
 1 file changed, 15 insertions(+)
---
diff --git a/src/frdp-session.c b/src/frdp-session.c
index 45643be..a73535b 100644
--- a/src/frdp-session.c
+++ b/src/frdp-session.c
@@ -357,6 +357,20 @@ frdp_certificate_verify (freerdp     *freerdp_session,
   return TRUE;
 }
 
+static guint
+frdp_changed_certificate_verify (freerdp     *freerdp_session,
+                                 const gchar *common_name,
+                                 const gchar *subject,
+                                 const gchar *issuer,
+                                 const gchar *new_fingerprint,
+                                 const gchar *old_subject,
+                                 const gchar *old_issuer,
+                                 const gchar *old_fingerprint)
+{
+  /* TODO */
+  return TRUE;
+}
+
 static gboolean
 frdp_authenticate (freerdp  *freerdp_session,
                    gchar   **username,
@@ -563,6 +577,7 @@ frdp_session_init_freerdp (FrdpSession *self)
   priv->freerdp_session->PostConnect = frdp_post_connect;
   priv->freerdp_session->Authenticate = frdp_authenticate;
   priv->freerdp_session->VerifyCertificate = frdp_certificate_verify;
+  priv->freerdp_session->VerifyChangedCertificate = frdp_changed_certificate_verify;
 
   priv->freerdp_session->ContextSize = sizeof (frdpContext);
 


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