- new upstream version

This commit is contained in:
Tomas Mraz 2010-12-08 21:34:28 +01:00
parent d7caee0560
commit 609ce39569
3 changed files with 78 additions and 230 deletions

View File

@ -1,150 +0,0 @@
diff -up gnutls-2.10.3/src/serv.c.sprintf gnutls-2.10.3/src/serv.c
--- gnutls-2.10.3/src/serv.c.sprintf 2010-11-01 13:18:24.000000000 +0100
+++ gnutls-2.10.3/src/serv.c 2010-12-02 15:13:12.000000000 +0100
@@ -438,7 +438,7 @@ static const char DEFAULT_DATA[] =
/* Creates html with the current session information.
*/
-#define tmp2 &http_buffer[strlen(http_buffer)]
+#define tmp2 &http_buffer[strlen(http_buffer)], len-strlen(http_buffer)
static char *
peer_print_info (gnutls_session_t session, int *ret_length,
const char *header)
@@ -448,7 +448,7 @@ peer_print_info (gnutls_session_t sessio
size_t i, sesid_size;
char *http_buffer;
gnutls_kx_algorithm_t kx_alg;
- size_t len = 5 * 1024 + strlen (header);
+ size_t len = 20 * 1024 + strlen (header);
char *crtinfo = NULL;
size_t ncrtinfo = 0;
@@ -512,11 +512,11 @@ peer_print_info (gnutls_session_t sessio
/* print session_id */
gnutls_session_get_id (session, sesid, &sesid_size);
- sprintf (tmp2, "\n<p>Session ID: <i>");
+ snprintf (tmp2, "\n<p>Session ID: <i>");
for (i = 0; i < sesid_size; i++)
- sprintf (tmp2, "%.2X", sesid[i]);
- sprintf (tmp2, "</i></p>\n");
- sprintf (tmp2,
+ snprintf (tmp2, "%.2X", sesid[i]);
+ snprintf (tmp2, "</i></p>\n");
+ snprintf (tmp2,
"<h5>If your browser supports session resuming, then you should see the "
"same session ID, when you press the <b>reload</b> button.</h5>\n");
@@ -530,7 +530,7 @@ peer_print_info (gnutls_session_t sessio
if (gnutls_server_name_get (session, dns, &dns_size, &type, 0) == 0)
{
- sprintf (tmp2, "\n<p>Server Name: %s</p>\n", dns);
+ snprintf (tmp2, "\n<p>Server Name: %s</p>\n", dns);
}
}
@@ -541,7 +541,7 @@ peer_print_info (gnutls_session_t sessio
#ifdef ENABLE_SRP
if (kx_alg == GNUTLS_KX_SRP)
{
- sprintf (tmp2, "<p>Connected as user '%s'.</p>\n",
+ snprintf (tmp2, "<p>Connected as user '%s'.</p>\n",
gnutls_srp_server_get_username (session));
}
#endif
@@ -549,7 +549,7 @@ peer_print_info (gnutls_session_t sessio
#ifdef ENABLE_PSK
if (kx_alg == GNUTLS_KX_PSK)
{
- sprintf (tmp2, "<p>Connected as user '%s'.</p>\n",
+ snprintf (tmp2, "<p>Connected as user '%s'.</p>\n",
gnutls_psk_server_get_username (session));
}
#endif
@@ -557,7 +557,7 @@ peer_print_info (gnutls_session_t sessio
#ifdef ENABLE_ANON
if (kx_alg == GNUTLS_KX_ANON_DH)
{
- sprintf (tmp2,
+ snprintf (tmp2,
"<p> Connect using anonymous DH (prime of %d bits)</p>\n",
gnutls_dh_get_prime_bits (session));
}
@@ -565,7 +565,7 @@ peer_print_info (gnutls_session_t sessio
if (kx_alg == GNUTLS_KX_DHE_RSA || kx_alg == GNUTLS_KX_DHE_DSS)
{
- sprintf (tmp2,
+ snprintf (tmp2,
"Ephemeral DH using prime of <b>%d</b> bits.<br>\n",
gnutls_dh_get_prime_bits (session));
}
@@ -576,7 +576,7 @@ peer_print_info (gnutls_session_t sessio
tmp = gnutls_protocol_get_name (gnutls_protocol_get_version (session));
if (tmp == NULL)
tmp = str_unknown;
- sprintf (tmp2,
+ snprintf (tmp2,
"<TABLE border=1><TR><TD>Protocol version:</TD><TD>%s</TD></TR>\n",
tmp);
@@ -587,50 +587,44 @@ peer_print_info (gnutls_session_t sessio
(session));
if (tmp == NULL)
tmp = str_unknown;
- sprintf (tmp2, "<TR><TD>Certificate Type:</TD><TD>%s</TD></TR>\n", tmp);
+ snprintf (tmp2, "<TR><TD>Certificate Type:</TD><TD>%s</TD></TR>\n", tmp);
}
tmp = gnutls_kx_get_name (kx_alg);
if (tmp == NULL)
tmp = str_unknown;
- sprintf (tmp2, "<TR><TD>Key Exchange:</TD><TD>%s</TD></TR>\n", tmp);
+ snprintf (tmp2, "<TR><TD>Key Exchange:</TD><TD>%s</TD></TR>\n", tmp);
tmp = gnutls_compression_get_name (gnutls_compression_get (session));
if (tmp == NULL)
tmp = str_unknown;
- sprintf (tmp2, "<TR><TD>Compression</TD><TD>%s</TD></TR>\n", tmp);
+ snprintf (tmp2, "<TR><TD>Compression</TD><TD>%s</TD></TR>\n", tmp);
tmp = gnutls_cipher_get_name (gnutls_cipher_get (session));
if (tmp == NULL)
tmp = str_unknown;
- sprintf (tmp2, "<TR><TD>Cipher</TD><TD>%s</TD></TR>\n", tmp);
+ snprintf (tmp2, "<TR><TD>Cipher</TD><TD>%s</TD></TR>\n", tmp);
tmp = gnutls_mac_get_name (gnutls_mac_get (session));
if (tmp == NULL)
tmp = str_unknown;
- sprintf (tmp2, "<TR><TD>MAC</TD><TD>%s</TD></TR>\n", tmp);
+ snprintf (tmp2, "<TR><TD>MAC</TD><TD>%s</TD></TR>\n", tmp);
tmp = gnutls_cipher_suite_get_name (kx_alg,
gnutls_cipher_get (session),
gnutls_mac_get (session));
if (tmp == NULL)
tmp = str_unknown;
- sprintf (tmp2, "<TR><TD>Ciphersuite</TD><TD>%s</TD></TR></p></TABLE>\n",
+ snprintf (tmp2, "<TR><TD>Ciphersuite</TD><TD>%s</TD></TR></p></TABLE>\n",
tmp);
if (crtinfo)
{
- strcat (http_buffer, "<hr><PRE>");
- strcat (http_buffer, crtinfo);
- strcat (http_buffer, "\n</PRE>\n");
+ snprintf(tmp2, "<hr><PRE>%s\n</PRE>\n", crtinfo);
free (crtinfo);
}
- strcat (http_buffer, "<hr><P>Your HTTP header was:<PRE>");
- strcat (http_buffer, header);
- strcat (http_buffer, "</PRE></P>");
-
- strcat (http_buffer, "\n" HTTP_END);
+ snprintf(tmp2, "<hr><P>Your HTTP header was:<PRE>%s</PRE></P>\n" HTTP_END, header);
*ret_length = strlen (http_buffer);

View File

@ -1,8 +1,8 @@
diff -up gnutls-2.10.3/build-aux/config.rpath gnutls-2.10.3/build-aux/config
diff -up gnutls-2.10.3/configure.rpath gnutls-2.10.3/configure
--- gnutls-2.10.3/configure.rpath 2010-11-19 13:40:11.000000000 +0100
+++ gnutls-2.10.3/configure 2010-11-19 16:15:47.000000000 +0100
@@ -15439,7 +15439,7 @@ shlibpath_var=
diff -up gnutls-2.10.4/build-aux/config.rpath gnutls-2.10.4/build-aux/config
diff -up gnutls-2.10.4/configure.rpath gnutls-2.10.4/configure
--- gnutls-2.10.4/configure.rpath 2010-12-06 14:53:28.000000000 +0100
+++ gnutls-2.10.4/configure 2010-12-08 21:29:22.000000000 +0100
@@ -15112,7 +15112,7 @@ shlibpath_var=
shlibpath_overrides_runpath=unknown
version_type=none
dynamic_linker="$host_os ld.so"
@ -11,80 +11,16 @@ diff -up gnutls-2.10.3/configure.rpath gnutls-2.10.3/configure
need_lib_prefix=unknown
hardcode_into_libs=no
@@ -15824,7 +15824,7 @@ rm -f core conftest.err conftest.$ac_obj
@@ -15510,7 +15510,7 @@ fi
# Append ld.so.conf contents to the search path
if test -f /etc/ld.so.conf; then
lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '`
- sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
+ sys_lib_dlsearch_path_spec="/lib /usr/lib /lib64/ /usr/lib64 $lt_ld_extra"
fi
# We used to test for /lib/ld.so.1 and disable shared libraries on
@@ -18908,7 +18908,7 @@ shlibpath_var=
shlibpath_overrides_runpath=unknown
version_type=none
dynamic_linker="$host_os ld.so"
-sys_lib_dlsearch_path_spec="/lib /usr/lib"
+sys_lib_dlsearch_path_spec="/lib /usr/lib /lib64 /usr/lib64"
need_lib_prefix=unknown
hardcode_into_libs=no
@@ -19292,7 +19292,7 @@ rm -f core conftest.err conftest.$ac_obj
# Append ld.so.conf contents to the search path
if test -f /etc/ld.so.conf; then
lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '`
lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '`
- sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
+ sys_lib_dlsearch_path_spec="/lib /usr/lib /lib64 /usr/lib64 $lt_ld_extra"
fi
# We used to test for /lib/ld.so.1 and disable shared libraries on
diff -up gnutls-2.10.3/lib/build-aux/config.rpath gnutls-2.10.3/lib/build-aux/config
diff -up gnutls-2.10.3/lib/configure.rpath gnutls-2.10.3/lib/configure
--- gnutls-2.10.3/lib/configure.rpath 2010-11-19 13:39:14.000000000 +0100
+++ gnutls-2.10.3/lib/configure 2010-11-19 16:15:22.000000000 +0100
@@ -10738,7 +10738,8 @@ shlibpath_var=
shlibpath_overrides_runpath=unknown
version_type=none
dynamic_linker="$host_os ld.so"
-sys_lib_dlsearch_path_spec="/lib /usr/lib"
+
+sys_lib_dlsearch_path_spec="/lib /usr/lib /lib64 /usr/lib64"
need_lib_prefix=unknown
hardcode_into_libs=no
@@ -11123,7 +11124,7 @@ rm -f core conftest.err conftest.$ac_obj
# Append ld.so.conf contents to the search path
if test -f /etc/ld.so.conf; then
lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '`
- sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
+ sys_lib_dlsearch_path_spec="/lib /usr/lib /lib64 /usr/lib64 $lt_ld_extra"
fi
# We used to test for /lib/ld.so.1 and disable shared libraries on
@@ -26039,7 +26040,8 @@ shlibpath_var=
shlibpath_overrides_runpath=unknown
version_type=none
dynamic_linker="$host_os ld.so"
-sys_lib_dlsearch_path_spec="/lib /usr/lib"
+
+sys_lib_dlsearch_path_spec="/lib /usr/lib /lib64 /usr/lib64"
need_lib_prefix=unknown
hardcode_into_libs=no
@@ -26423,7 +26425,7 @@ rm -f core conftest.err conftest.$ac_obj
# Append ld.so.conf contents to the search path
if test -f /etc/ld.so.conf; then
lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '`
- sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
+ sys_lib_dlsearch_path_spec="/lib /usr/lib /lib64 /usr/lib64 $lt_ld_extra"
fi
# We used to test for /lib/ld.so.1 and disable shared libraries on
diff -up gnutls-2.10.3/libextra/build-aux/config.rpath gnutls-2.10.3/libextra/build-aux/config
diff -up gnutls-2.10.3/libextra/configure.rpath gnutls-2.10.3/libextra/configure
--- gnutls-2.10.3/libextra/configure.rpath 2010-11-19 13:39:44.000000000 +0100
+++ gnutls-2.10.3/libextra/configure 2010-11-19 16:16:21.000000000 +0100
@@ -9919,7 +9919,7 @@ shlibpath_var=
@@ -18777,7 +18777,7 @@ shlibpath_var=
shlibpath_overrides_runpath=unknown
version_type=none
dynamic_linker="$host_os ld.so"
@ -93,10 +29,72 @@ diff -up gnutls-2.10.3/libextra/configure.rpath gnutls-2.10.3/libextra/configure
need_lib_prefix=unknown
hardcode_into_libs=no
@@ -10304,7 +10304,7 @@ rm -f core conftest.err conftest.$ac_obj
@@ -19173,7 +19173,7 @@ fi
# Append ld.so.conf contents to the search path
if test -f /etc/ld.so.conf; then
lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '`
lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '`
- sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
+ sys_lib_dlsearch_path_spec="/lib /usr/lib /lib64 /usr/lib64 $lt_ld_extra"
fi
# We used to test for /lib/ld.so.1 and disable shared libraries on
diff -up gnutls-2.10.4/lib/build-aux/config.rpath gnutls-2.10.4/lib/build-aux/config
diff -up gnutls-2.10.4/lib/configure.rpath gnutls-2.10.4/lib/configure
--- gnutls-2.10.4/lib/configure.rpath 2010-12-06 14:53:11.000000000 +0100
+++ gnutls-2.10.4/lib/configure 2010-12-08 21:30:09.000000000 +0100
@@ -10839,7 +10839,7 @@ shlibpath_var=
shlibpath_overrides_runpath=unknown
version_type=none
dynamic_linker="$host_os ld.so"
-sys_lib_dlsearch_path_spec="/lib /usr/lib"
+sys_lib_dlsearch_path_spec="/lib /usr/lib /lib64 /usr/lib64"
need_lib_prefix=unknown
hardcode_into_libs=no
@@ -11237,7 +11237,7 @@ fi
# Append ld.so.conf contents to the search path
if test -f /etc/ld.so.conf; then
lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '`
- sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
+ sys_lib_dlsearch_path_spec="/lib /usr/lib /lib64 /usr/lib64 $lt_ld_extra"
fi
# We used to test for /lib/ld.so.1 and disable shared libraries on
@@ -25790,7 +25790,7 @@ shlibpath_var=
shlibpath_overrides_runpath=unknown
version_type=none
dynamic_linker="$host_os ld.so"
-sys_lib_dlsearch_path_spec="/lib /usr/lib"
+sys_lib_dlsearch_path_spec="/lib /usr/lib /lib64 /usr/lib64"
need_lib_prefix=unknown
hardcode_into_libs=no
@@ -26186,7 +26186,7 @@ fi
# Append ld.so.conf contents to the search path
if test -f /etc/ld.so.conf; then
lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '`
- sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
+ sys_lib_dlsearch_path_spec="/lib /usr/lib /lib64 /usr/lib64 $lt_ld_extra"
fi
# We used to test for /lib/ld.so.1 and disable shared libraries on
diff -up gnutls-2.10.4/libextra/build-aux/config.rpath gnutls-2.10.4/libextra/build-aux/config
diff -up gnutls-2.10.4/libextra/configure.rpath gnutls-2.10.4/libextra/configure
--- gnutls-2.10.4/libextra/configure.rpath 2010-12-06 14:53:20.000000000 +0100
+++ gnutls-2.10.4/libextra/configure 2010-12-08 21:30:27.000000000 +0100
@@ -10013,7 +10013,7 @@ shlibpath_var=
shlibpath_overrides_runpath=unknown
version_type=none
dynamic_linker="$host_os ld.so"
-sys_lib_dlsearch_path_spec="/lib /usr/lib"
+sys_lib_dlsearch_path_spec="/lib /usr/lib /lib64 /usr/lib64"
need_lib_prefix=unknown
hardcode_into_libs=no
@@ -10411,7 +10411,7 @@ fi
# Append ld.so.conf contents to the search path
if test -f /etc/ld.so.conf; then
lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '`
- sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
+ sys_lib_dlsearch_path_spec="/lib /usr/lib /lib64 /usr/lib64 $lt_ld_extra"
fi

View File

@ -1,7 +1,7 @@
Summary: A TLS protocol implementation
Name: gnutls
Version: 2.10.3
Release: 2%{?dist}
Version: 2.10.4
Release: 1%{?dist}
# The libgnutls library is LGPLv2+, utilities and remaining libraries are GPLv3+
License: GPLv3+ and LGPLv2+
Group: System Environment/Libraries
@ -15,14 +15,12 @@ URL: http://www.gnutls.org/
# XXX patent tainted SRP code removed.
Source0: %{name}-%{version}-nosrp.tar.bz2
Source1: libgnutls-config
Patch1: gnutls-2.10.3-rpath.patch
Patch1: gnutls-2.10.4-rpath.patch
Patch2: gnutls-2.8.6-link-libgcrypt.patch
# Remove nonexisting references from texinfo file
Patch3: gnutls-2.10.1-nosrp.patch
# Backport from upstream git
Patch4: gnutls-2.10.1-handshake-errors.patch
# Sent to upstream
Patch5: gnutls-2.10.3-sprintf.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
Requires: libgcrypt >= 1.2.2
@ -79,7 +77,6 @@ This package contains Guile bindings for the library.
%patch2 -p1 -b .link
%patch3 -p1 -b .nosrp
%patch4 -p1 -b .errors
%patch5 -p1 -b .sprintf
for i in auth_srp_rsa.c auth_srp_sb64.c auth_srp_passwd.c auth_srp.c gnutls_srp.c ext_srp.c; do
touch lib/$i
@ -163,6 +160,9 @@ fi
%{_datadir}/guile/site/gnutls.scm
%changelog
* Wed Dec 8 2010 Tomas Mraz <tmraz@redhat.com> 2.10.4-1
- new upstream version
* Tue Dec 2 2010 Tomas Mraz <tmraz@redhat.com> 2.10.3-2
- fix buffer overflow in gnutls-serv (#659259)