--- /dev/null
- Version: 2.38.0
+%bcond_with libproxy
+Name: glib-networking
- Source: http://download.gnome.org/sources/glib-networking/2.35/%{name}-%{version}.tar.xz
++Version: 2.50.0
+Release: 0
+License: LGPL-2.1+
+Summary: Network-related GIO modules for glib
+Group: System/Libraries
- BuildRequires: pkgconfig(gio-2.0) >= 2.31.6
- BuildRequires: pkgconfig(gnutls) >= 2.11.0
++Source: http://download.gnome.org/sources/glib-networking/2.50/%{name}-%{version}.tar.xz
+Source99: baselibs.conf
+Source1001: glib-networking.manifest
+Url: http://www.gnome.org
+BuildRequires: intltool
+BuildRequires: which
+BuildRequires: libgcrypt-devel
+BuildRequires: pkgconfig(dbus-1)
++BuildRequires: pkgconfig(gio-2.0) >= 2.46.0
++BuildRequires: pkgconfig(gnutls) >= 3.0
+BuildRequires: pkgconfig(dlog)
+BuildRequires: pkgconfig(libtzplatform-config)
+BuildRequires: ca-certificates-devel
+Requires: ca-certificates
+%if %{with libproxy}
+BuildRequires: pkgconfig(libproxy-1.0)
+%endif
+
+%description
+This package contains network-related GIO modules for glib.
+
+Currently, there is only a proxy module based on libproxy.
+
+%lang_package
+
+%prep
+%setup -q
+cp %{SOURCE1001} .
+
+%build
+export CFLAGS='-Wformat-nonliteral'
+%autogen \
+ --disable-static \
+%if %{with libproxy}
+ --with-libproxy \
+%endif
+ --enable-tizen-dlog \
+%if 0
+ --enable-tizen-gnutls-debug \
+%endif
+%if "%{TIZEN_PROFILE_TV}" == "1"
+ --enable-tizen-multiple-certificate=yes \
+ --enable-tizen-tv-update-default-priority \
+ --enable-tizen-performance-test-log \
+%endif
+%if "%{TIZEN_PROFILE_TV}" == "1"
+ --with-ca-certificates=%{TZ_SYS_RO_CA_CERTS} \
+%else
+ --with-ca-certificates=%{TZ_SYS_RO_CA_BUNDLE} \
+%endif
+
+%__make %{?_smp_mflags} V=1
+
+%install
+%if "%{TIZEN_PROFILE_TV}" == "1"
+rm -rf %{buildroot}
+mkdir -p %{buildroot}%{TZ_SYS_SHARE}/ca-certificates/
+cp wss.pem %{buildroot}%{TZ_SYS_SHARE}/ca-certificates/
+%endif
+%make_install
+%find_lang %{name}
+
+%post
+%glib2_gio_module_post
+
+%postun
+%glib2_gio_module_postun
+
+%files
+%manifest %{name}.manifest
+%defattr(-, root, root)
+%license COPYING
+%{_libdir}/gio/modules/libgiognutls.so
+%if "%{TIZEN_PROFILE_TV}" == "1"
+%{TZ_SYS_SHARE}/ca-certificates/wss.pem
+%endif
+
+%if %{with libproxy}
+%{_libdir}/gio/modules/libgiolibproxy.so
+%{_libexecdir}/glib-pacrunner
+%{_datadir}/dbus-1/services/org.gtk.GLib.PACRunner.service
+%endif
gnutls_x509_crt_t *chain;
GTlsCertificateFlags gtls_flags;
time_t t, now;
+#if ENABLE(TIZEN_TV_ADJUST_TIME) && ENABLE(TIZEN_DLOG)
+ char timebuf[256];
+#endif
-
cert_gnutls = G_TLS_CERTIFICATE_GNUTLS (cert);
for (num_certs = 0; cert_gnutls; cert_gnutls = cert_gnutls->priv->issuer)
num_certs++;
#include "pkcs11/gpkcs11pin.h"
#endif
+ #ifdef G_OS_WIN32
+ #include <winsock2.h>
+ #include <winerror.h>
+
+ /* It isn’t clear whether MinGW always defines EMSGSIZE. */
+ #ifndef EMSGSIZE
+ #define EMSGSIZE WSAEMSGSIZE
+ #endif
+ #endif
+
#include <glib/gi18n-lib.h>
+#include "TIZEN.h"
+
+#if ENABLE(TIZEN_PERFORMANCE_TEST_LOG)
+#include <sys/prctl.h>
+#ifndef PR_TASK_PERF_USER_TRACE
+#define PR_TASK_PERF_USER_TRACE 666
+#endif
+#define HWCLOCK_LOG(s) {const char *str=s; prctl(PR_TASK_PERF_USER_TRACE, str, strlen(str));}
+#endif
+
static ssize_t g_tls_connection_gnutls_push_func (gnutls_transport_ptr_t transport_data,
const void *buf,
size_t buflen);
g_mutex_init (&gnutls->priv->op_mutex);
}
- /* First field is "ssl3 only", second is "allow unsafe rehandshaking" */
+ /* First field is "fallback", second is "allow unsafe rehandshaking" */
static gnutls_priority_t priorities[2][2];
+#if ENABLE(TIZEN_TV_UPDATE_DEFAULT_PRIORITY)
+#define DEFAULT_BASE_PRIORITY "NORMAL:%COMPAT:!VERS-SSL3.0:%LATEST_RECORD_VERSION"
++#else
+ #define DEFAULT_BASE_PRIORITY "NORMAL:%COMPAT:%LATEST_RECORD_VERSION"
+#endif
static void
g_tls_connection_gnutls_init_priorities (void)
GTlsCertificate *peer_certificate,
GTlsCertificateFlags peer_certificate_errors)
{
- gboolean accepted;
+ gboolean accepted = FALSE;
+#if ENABLE(TIZEN_PERFORMANCE_TEST_LOG)
+ HWCLOCK_LOG("[BGN] gnutls_verify_peer");
+#endif
+
if (G_IS_TLS_CLIENT_CONNECTION (gnutls))
{
GTlsCertificateFlags validation_flags =
#include <glib/gi18n-lib.h>
#include <gnutls/x509.h>
+ #include "gtlscertificate-gnutls.h"
+
+#include <TIZEN.h>
+
+#if ENABLE(TIZEN_TV_MULTIPLE_CERTIFICATE)
+#include <dirent.h>
+#include <stdio.h>
+#include <sys/stat.h>
+#endif
++
static void g_tls_file_database_gnutls_file_database_interface_init (GTlsFileDatabaseInterface *iface);
static void g_tls_file_database_gnutls_initable_interface_init (GInitableIface *iface);
(GDestroyNotify)g_bytes_unref,
(GDestroyNotify)g_bytes_unref);
- result = load_anchor_file (self->priv->anchor_filename, subjects, issuers,
- complete, error);
+#if ENABLE(TIZEN_TV_MULTIPLE_CERTIFICATE)
+ if (self->priv->anchor_filename)
+ {
+ gchar **paths = g_strsplit (self->priv->anchor_filename, ":", 0);
+ gint i;
+ for (i = 0; paths[i]; i++)
+ {
+ mutiple_certicate_result = traverse_load_anchor_file (paths[i], subjects, issuers, complete, error);
+ if (mutiple_certicate_result == TRUE)
+ result = TRUE;
+ }
+ if((*error == NULL) && (result == FALSE))
+ *error = g_error_new (G_CONVERT_ERROR, G_CONVERT_ERROR_ILLEGAL_SEQUENCE,
+ _("Invalid byte sequence in conversion input"));
+ if((*error != NULL) && (result == TRUE))
+ g_clear_error (error);
+ g_strfreev(paths);
+ }
+ else
+ *error = g_error_new (G_CONVERT_ERROR, G_CONVERT_ERROR_ILLEGAL_SEQUENCE,
+ _("Invalid byte sequence in conversion input"));
+#else
+ if (self->priv->anchor_filename)
+ result = load_anchor_file (self->priv->anchor_filename, subjects, issuers,
+ complete, error);
+ else
+ result = TRUE;
+
+#endif
+
if (g_cancellable_set_error_if_cancelled (cancellable, error))
result = FALSE;