Replace OpenSSL helpers with ones based on GnuTLS. GnuTLS is already an indirect
dependency since we require GLib's TLS support. As support for older protocol
versions was removed, we will not need any extra library for handling explicit
packet decryption.
This change will also resolve potential license incompatibility issues.
Introduce support for device channel encryption using TLS. The change is
compatible with current KDE Connect protocol version 7.
Device no longer has a public key, instead the public key was replaced by its
certificate as obtained during TLS handshake.
Device channel connection is now 3 step - first, the initial connection happens,
after which an identity packet is sent to the device, followed by TLS
handshake (including crypto suite negotiation, certificate exchange). Note, KDE
Connect supports TLS 1.0 at the moment. Failure to perform a TLS handshake will
cause device connection to be dropped.
GLib.Socket implements GLib.DatagramBased, hence calling
Socket.create_source() results in a C call to
g_socket_datagram_based_create_source() insted of
g_socket_create_source() as one my expect. The former works only for
datagram based sockets (as implemented in gio/gsocket.c), hence
Socket.create_source() for TCP socket will always return null. To
workaround this, export g_socket_create_source() as
Socket.create_socket_source() method.
The change is expected to be a part of vala 0.34 release.
VAPI is autogenerated based on GObject introspection. The problem is
that for gir to work a library must be run on the host, what obviously
brakes if cross compilation is used. As a workaround use the hand
generated VAPI and completely dump autogeneration.
This enables debugging with gdb. Without -g flag, the generated C code
does not have file/line set, hence gdb has no way of telling the Vala
code line the C code corresponds to.