add use_starttls and require_starttls members to LmSSLBase, plus corresponding access functions
authorDafydd Harries <daf@rhydd.org>
Tue, 23 Oct 2007 15:57:14 +0100
changeset 286 e0bcf40cbf5e
parent 285 7dee90bf5ee8
child 287 fb0f9a524963
add use_starttls and require_starttls members to LmSSLBase, plus corresponding access functions
loudmouth/lm-ssl-base.h
loudmouth/lm-ssl-generic.c
loudmouth/lm-ssl.h
--- a/loudmouth/lm-ssl-base.h	Fri Oct 19 17:27:32 2007 +0100
+++ b/loudmouth/lm-ssl-base.h	Tue Oct 23 15:57:14 2007 +0100
@@ -32,6 +32,8 @@
 	GDestroyNotify  data_notify;
 	gchar          *expected_fingerprint;
 	char            fingerprint[20];
+	gboolean        use_starttls;
+	gboolean        require_starttls;
 
 	gint            ref_count;
 };
--- a/loudmouth/lm-ssl-generic.c	Fri Oct 19 17:27:32 2007 +0100
+++ b/loudmouth/lm-ssl-generic.c	Tue Oct 23 15:57:14 2007 +0100
@@ -170,6 +170,52 @@
 }
 
 /**
+ * lm_ssl_use_starttls:
+ * @ssl: an #LmSSL
+ *
+ * Set whether STARTTLS should be used.
+ **/
+void
+lm_ssl_use_starttls (LmSSL *ssl,
+		     gboolean use_starttls,
+		     gboolean require_starttls)
+{
+	LmSSLBase *base;
+
+	base = LM_SSL_BASE (ssl);
+	base->use_starttls = use_starttls;
+	base->require_starttls = require_starttls;
+}
+
+/**
+ * lm_ssl_get_use_starttls:
+ *
+ * Return value: TRUE is @ssl is configured to use STARTTLS.
+ **/
+gboolean
+lm_ssl_get_use_starttls (LmSSL *ssl)
+{
+	LmSSLBase *base;
+
+	base = LM_SSL_BASE (ssl);
+	return base->use_starttls;
+}
+
+/**
+ * lm_ssl_get_require_starttls:
+ *
+ * Return value: TRUE if @ssl requires that STARTTLS succeed.
+ **/
+gboolean
+lm_ssl_get_require_starttls (LmSSL *ssl)
+{
+	LmSSLBase *base;
+
+	base = LM_SSL_BASE (ssl);
+	return base->require_starttls;
+}
+
+/**
  * lm_ssl_unref
  * @ssl: an #LmSSL
  * 
--- a/loudmouth/lm-ssl.h	Fri Oct 19 17:27:32 2007 +0100
+++ b/loudmouth/lm-ssl.h	Tue Oct 23 15:57:14 2007 +0100
@@ -65,6 +65,13 @@
 
 const gchar *         lm_ssl_get_fingerprint (LmSSL          *ssl);
 
+void                  lm_ssl_use_starttls    (LmSSL *ssl,
+					      gboolean use_starttls,
+					      gboolean require);
+
+gboolean              lm_ssl_get_use_starttls (LmSSL *ssl);
+
+gboolean              lm_ssl_get_require_starttls (LmSSL *ssl);
 
 LmSSL *               lm_ssl_ref             (LmSSL          *ssl);
 void                  lm_ssl_unref           (LmSSL          *ssl);