After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 598852 - Implementation of GTLSConnection
Implementation of GTLSConnection
Status: RESOLVED DUPLICATE of bug 588189
Product: glib
Classification: Platform
Component: gio
unspecified
Other Linux
: Normal normal
: ---
Assigned To: gtkdev
gtkdev
Depends on:
Blocks:
 
 
Reported: 2009-10-18 17:04 UTC by Philip Van Hoof
Modified: 2009-10-22 08:13 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Corrections to gtls.c/h and renamed to gtlsconnection.? (40.00 KB, application/x-tar)
2009-10-18 17:04 UTC, Philip Van Hoof
Details
Example for use with gtlsconnection (2.57 KB, text/plain)
2009-10-18 17:07 UTC, Philip Van Hoof
Details

Description Philip Van Hoof 2009-10-18 17:04:59 UTC
Created attachment 145738 [details]
Corrections to gtls.c/h and renamed to gtlsconnection.?

In the old GNIO git repositories* I found an outdated implementation of a
GTLSConnection in files named gtls.c and gtls.h.

A problem with this implementation is that it assumes GIOStream to be an
interface and that it returns (and assumes) a caller-owns reference for the
get_input_stream and get_output_stream functions.

I have ported this a bit so that it again works against a typical IMAP server
(the examples/client.c in the GNIO git repositories tries to connect, using the
GTLSConnection, to an IMAP server)

I guess Ryan Lorty was the first to make the GTLSConnection class, perhaps the
reviewer of this stuff should get in touch with Ryan to check whether I adapted
everything correctly.

I'm attaching this as as-is because I first want to know whether this kind of
functionality is desired in GLib/GIO. If the answer is yes, then I'll rework
into a proper patch with checks in GLib's configure.in for GnuTLS (which is
probably why it was not picked from the GNIO git repositories in the first
place).

* http://sciyoshi.com/projects/gnio/
Comment 1 Philip Van Hoof 2009-10-18 17:07:02 UTC
Created attachment 145739 [details]
Example for use with gtlsconnection

cd glib/gio/tests

vi Makefile.am
Add these:

imap_INCLUDES = `pkg-config gnutls --cflags`

imap_SOURCES = client.c gtlsconnection.c gtlsconnection.h
imap_LDADD = $(progs_ldadd) $(top_builddir)/gthread/libgthread-2.0.la
imap_LDFLAGS = `pkg-config gnutls --libs`

Copy gtlsconnection.c and gtlsconnection.h from the tar in glib/gio/tests

make imap

 ./imap 
21 bytes read: * OK Dovecot ready.

33 bytes read: a OK Begin TLS negotiation now.

** (process:6953): DEBUG: awesome!!  TLS worked out.


164 bytes read: * CAPABILITY IMAP4rev1 SASL-IR SORT THREAD=REFERENCES MULTIAPPEND UNSELECT LITERAL+ IDLE CHILDREN NAMESPACE LOGIN-REFERRALS AUTH=PLAIN
a OK Capability completed.
Comment 2 Javier Jardón (IRC: jjardon) 2009-10-22 04:36:47 UTC
Hello Philip,

I think we can mark this as duplicate of bug #588189, of course revert the duplication if you want.

*** This bug has been marked as a duplicate of bug 588189 ***
Comment 3 Philip Van Hoof 2009-10-22 08:13:42 UTC
Agree