[openvas-libraries] Fix the usage of deprecated data types with migration to gnutls 3.
rebus
rebus at fedoraproject.org
Sat Feb 9 17:09:17 UTC 2013
commit dccd5fed8fc0cee76cd57d4378d2da2c88b805b6
Author: Michal Ambroz <rebus at seznam.cz>
Date: Sat Feb 9 18:07:49 2013 +0100
Fix the usage of deprecated data types with migration to gnutls 3.
openvas-libraries-6.0-gnutls3.patch | 62 +++++++++++++++++++++++++++++++++++
openvas-libraries-6.0-memset.patch | 12 +++++++
openvas-libraries.spec | 36 +++++++++++++++-----
3 files changed, 101 insertions(+), 9 deletions(-)
---
diff --git a/openvas-libraries-6.0-gnutls3.patch b/openvas-libraries-6.0-gnutls3.patch
new file mode 100644
index 0000000..2ec1a90
--- /dev/null
+++ b/openvas-libraries-6.0-gnutls3.patch
@@ -0,0 +1,62 @@
+diff -ru openvas-libraries-6.0+beta3/misc/network.c openvas-libraries-6.0+beta3.new/misc/network.c
+--- openvas-libraries-6.0+beta3/misc/network.c 2012-12-14 10:44:30.000000000 +0100
++++ openvas-libraries-6.0+beta3.new/misc/network.c 2013-02-09 13:15:54.631814918 +0100
+@@ -570,13 +570,13 @@
+
+
+ /** helper function copied from cli.c from GnuTLS
+- Reads a file into a gnutls_datum
++ Reads a file into a gnutls_datum_t
+ **/
+-static gnutls_datum
++static gnutls_datum_t
+ load_file (const char *file)
+ {
+ FILE *f;
+- gnutls_datum loaded_file = { NULL, 0 };
++ gnutls_datum_t loaded_file = { NULL, 0 };
+ long filelen;
+ void *ptr;
+
+@@ -603,7 +603,7 @@
+ * twice on the same data.
+ */
+ static void
+-unload_file (gnutls_datum * data)
++unload_file (gnutls_datum_t * data)
+ {
+ efree (&(data->data));
+ }
+@@ -623,7 +623,7 @@
+ {
+ gnutls_x509_crt_t x509_crt = NULL;
+ gnutls_x509_privkey_t x509_key = NULL;
+- gnutls_datum data = { NULL, 0 };
++ gnutls_datum_t data = { NULL, 0 };
+ int ret;
+ int result = 0;
+
+diff -ru openvas-libraries-6.0+beta3/misc/openvas_server.c openvas-libraries-6.0+beta3.new/misc/openvas_server.c
+--- openvas-libraries-6.0+beta3/misc/openvas_server.c 2012-12-14 10:44:30.000000000 +0100
++++ openvas-libraries-6.0+beta3.new/misc/openvas_server.c 2013-02-09 16:39:34.660483201 +0100
+@@ -608,7 +608,7 @@
+ * @return 0 on success, -1 on error.
+ */
+ int
+-openvas_server_new (gnutls_connection_end_t end_type, gchar * ca_cert_file,
++openvas_server_new (unsigned int end_type, gchar * ca_cert_file,
+ gchar * cert_file, gchar * key_file,
+ gnutls_session_t * server_session,
+ gnutls_certificate_credentials_t * server_credentials)
+diff -ru openvas-libraries-6.0+beta3/misc/openvas_server.h openvas-libraries-6.0+beta3.new/misc/openvas_server.h
+--- openvas-libraries-6.0+beta3/misc/openvas_server.h 2012-12-14 10:44:30.000000000 +0100
++++ openvas-libraries-6.0+beta3.new/misc/openvas_server.h 2013-02-09 16:38:44.595490655 +0100
+@@ -64,7 +64,7 @@
+
+ int openvas_server_sendf_xml (gnutls_session_t *, const char *, ...);
+
+-int openvas_server_new (gnutls_connection_end_t, gchar *, gchar *, gchar *,
++int openvas_server_new (unsigned int, gchar *, gchar *, gchar *,
+ gnutls_session_t *, gnutls_certificate_credentials_t *);
+
+ int openvas_server_free (int, gnutls_session_t,
diff --git a/openvas-libraries-6.0-memset.patch b/openvas-libraries-6.0-memset.patch
new file mode 100644
index 0000000..b021620
--- /dev/null
+++ b/openvas-libraries-6.0-memset.patch
@@ -0,0 +1,12 @@
+diff -ru openvas-libraries-6.0+beta3/nasl/md5.c openvas-libraries-6.0+beta3.new/nasl/md5.c
+--- openvas-libraries-6.0+beta3/nasl/md5.c 2012-12-14 10:44:32.000000000 +0100
++++ openvas-libraries-6.0+beta3.new/nasl/md5.c 2013-02-09 12:32:07.193209739 +0100
+@@ -142,7 +142,7 @@
+ MD5Transform(ctx->buf, (uint32 *) ctx->in);
+ byteReverse((unsigned char *) ctx->buf, 4);
+ memmove(digest, ctx->buf, 16);
+- memset(ctx, 0, sizeof(ctx)); /* In case it's sensitive */
++ memset(ctx, 0, sizeof(*ctx)); /* In case it's sensitive */
+ }
+
+ /* The four core functions - F1 is optimized somewhat */
diff --git a/openvas-libraries.spec b/openvas-libraries.spec
index 3e21ad1..f5ccbc8 100644
--- a/openvas-libraries.spec
+++ b/openvas-libraries.spec
@@ -6,7 +6,7 @@ URL: http://www.openvas.org
License: LGPLv2
Group: System Environment/Libraries
Version: 6.0
-Release: 0.beta3%{?dist}
+Release: 1.beta3%{?dist}
Source0: http://wald.intevation.org/frs/download.php/1221/%{name}-%{tar_version}.tar.gz
Source1: https://svn.wald.intevation.org/svn/openvas/trunk/tools/openvas-check-setup
@@ -34,6 +34,16 @@ Source1: https://svn.wald.intevation.org/svn/openvas/trunk/tools/openvas-check-s
#Not needed anymore as gnutls in Fedora 16 is being pushed to version 2.12.14
#Patch4: openvas-libraries-key.patch
+#Issue found during build http://kojipkgs.fedoraproject.org//work/tasks/1940/4931940/build.log
+#The memset is called with size of the pointer and not with size of the buffer
+Patch5: openvas-libraries-6.0-memset.patch
+
+#http://kojipkgs.fedoraproject.org//work/tasks/1586/4941586/build.log
+#Usage of deprecated gnutls_datum - replaced with gnutls_datum_t
+#http://kojipkgs.fedoraproject.org//work/tasks/1600/4941600/build.log
+#Usage of deprecated gnutls_cnnection_end_t - replaced with unsigned int
+Patch6: openvas-libraries-6.0-gnutls3.patch
+
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
Obsoletes: openvas-libnasl
@@ -77,17 +87,22 @@ This package contains documentation for %{name}.
%prep
%setup -q -n %{name}-%{tar_version}
-#%patch0 -p 1 -b .notused.patch
+#%patch0 -p 1 -b .notused
#Patch for gnutls > 2.12.0
-#%patch1 -p 1 -b .gnutls.patch
+#%patch1 -p 1 -b .gnutls
#%patch2 -p 1 -b .lowat.patch
#Used mainly to troubleshoot SIGSEG in gnutls. Once solved patch1/2 shuold be used instead
-#%patch3 -p 1 -b .nowerror.patch
+#%patch3 -p 1 -b .nowerror
#Avoid SIGSEG in gnutls.
-#patch4 -p 1 -b .key.patch
+#patch4 -p 1 -b .key
+#Fix wrong size to memset
+%patch5 -p 1 -b .memset
+
+#Usage of deprecated gnutls_datum
+%patch6 -p 1 -b .gnutls3
#Fix FSF address in source files - FIXED in 4.0.7
#OLDADDR="675 Mass Ave, Cambridge, MA 02139, USA"
@@ -166,6 +181,9 @@ rm -rf %{buildroot}
%changelog
+* Sat Feb 09 2013 Michal Ambroz <rebus at, seznam.cz> - 6.0-1.beta3
+- fix wrong size to memset
+
* Wed Feb 06 2013 Michal Ambroz <rebus at, seznam.cz> - 6.0-0.beta3
- bump to OpenVas-6 version 6.0+beta3
@@ -193,7 +211,7 @@ rm -rf %{buildroot}
* Fri Nov 04 2011 Michal Ambroz <rebus at, seznam.cz> - 4.0.6-1
- bump to version 4.0.6
-* Thu Oct 18 2011 Michal Ambroz <rebus at, seznam.cz> - 4.0.5-5
+* Tue Oct 18 2011 Michal Ambroz <rebus at, seznam.cz> - 4.0.5-5
- revert back to code withou gnutls modifications to confirm gnutls
issues are not caused by it
- disabling the -Werror to avoid compilation issues with the deprecated gnutls code
@@ -236,7 +254,7 @@ issues are not caused by it
- Upgraded to a new upstream version
- Spec from Stjepan Gros
-* Wed Nov 26 2009 Huzaifa Sidhpurwala <huzaifas at redhat.com> 2.0.4-3
+* Thu Nov 26 2009 Huzaifa Sidhpurwala <huzaifas at redhat.com> 2.0.4-3
- Update to 2.0.4.
- Fix %%setup invocation.
- Add BR: glib2-devel.
@@ -248,11 +266,11 @@ issues are not caused by it
* Mon Oct 13 2008 Huzaifa Sidhpurwala <huzaifas at redhat.com> 1.0-2-2
- More changes to the spec
-* Wed Sep 9 2008 Huzaifa Sidhpurwala <huzaifas at redhat.com> 1.0.2-1
+* Sun Sep 9 2008 Huzaifa Sidhpurwala <huzaifas at redhat.com> 1.0.2-1
- Built on newer upstream version
- Minor spec changes
-* Wed Sep 9 2008 Huzaifa Sidhpurwala <huzaifas at redhat.com> 1.0.1-1
+* Sun Sep 9 2008 Huzaifa Sidhpurwala <huzaifas at redhat.com> 1.0.1-1
- Inital Fedora version
* Tue Apr 15 2008 Jan-Oliver Wagner <jan-oliver.wagner at intevation.de>
More information about the scm-commits
mailing list