[packages/ettercap] - new URLs, updated to 0.8.3 - removed obsolete patches - added buildtype,gtk3,link patches

qboosh qboosh at pld-linux.org
Sat May 23 21:23:02 CEST 2020


commit f8c47986b55307ca9098e4356260d256a6e089a1
Author: Jakub Bogusz <qboosh at pld-linux.org>
Date:   Sat May 23 21:23:32 2020 +0200

    - new URLs, updated to 0.8.3
    - removed obsolete patches
    - added buildtype,gtk3,link patches

 ettercap-as-needed.patch  |  12 --
 ettercap-build.patch      |  11 --
 ettercap-buildtype.patch  |  14 ++
 ettercap-flags.patch      |  19 ---
 ettercap-gtk3.patch       |  20 +++
 ettercap-libmissing.patch |  71 ----------
 ettercap-link.patch       |  69 ++++++++++
 ettercap-shlib_ext.patch  |  26 ----
 ettercap.spec             | 121 +++++++++++------
 openssl.patch             | 333 ----------------------------------------------
 10 files changed, 181 insertions(+), 515 deletions(-)
---
diff --git a/ettercap.spec b/ettercap.spec
index 6708252..e1ea4b3 100644
--- a/ettercap.spec
+++ b/ettercap.spec
@@ -1,36 +1,50 @@
 #
 # Conditional build:
-%bcond_without	gtk		# build without gtk-based frontend (fewer dependencies)
+%bcond_without	geoip	# GeoIP support
+%bcond_without	gtk	# gtk-based frontend
+%bcond_with	gtk2	# use GTK+ 2.x instead of 3.x
+%bcond_with	lua	# experimental Lua support
 #
 Summary:	ettercap - a ncurses-based sniffer/interceptor utility
 Summary(pl.UTF-8):	ettercap - oparte o ncurses narzędzie do sniffowania/przechwytywania
 Summary(pt_BR.UTF-8):	ettercap e um interceptador/sniffer paseado em ncurses
 Name:		ettercap
-Version:	0.7.3
-Release:	18
+Version:	0.8.3
+Release:	1
 Epoch:		1
-License:	GPL
+License:	GPL v2+ with OpenSSL exception
 Group:		Networking/Utilities
-Source0:	http://downloads.sourceforge.net/ettercap/%{name}-NG-%{version}.tar.gz
-# Source0-md5:	28fb15cd024162c55249888fe1b97820
-Patch1:		%{name}-build.patch
-Patch2:		%{name}-as-needed.patch
-Patch3:		%{name}-libmissing.patch
-Patch4:		%{name}-shlib_ext.patch
-Patch5:		%{name}-flags.patch
-Patch6:		openssl.patch
-URL:		http://ettercap.sourceforge.net/
-BuildRequires:	autoconf
-BuildRequires:	automake
-%{?with_gtk:BuildRequires:	gtk+2-devel}
-BuildRequires:	libltdl-devel
-BuildRequires:	libnet-devel >= 1.1.2.1
+#Source0Download: https://github.com/Ettercap/ettercap/releases
+Source0:	https://github.com/Ettercap/ettercap/releases/download/v%{version}/%{name}-%{version}.tar.gz
+# Source0-md5:	6b27d329a509e65fef9044c95a2dde35
+Patch0:		%{name}-buildtype.patch
+Patch1:		%{name}-gtk3.patch
+Patch2:		%{name}-link.patch
+URL:		https://www.ettercap-project.org/
+%{?with_geoip:BuildRequires:	GeoIP-devel}
+BuildRequires:	bison
+BuildRequires:	cmake >= 2.8
+BuildRequires:	curl-devel >= 7.26.0
+BuildRequires:	flex
+%if %{with gtk}
+%{?with_gtk2:BuildRequires:	gtk+2-devel >= 2:2.10}
+%{!?with_gtk2:BuildRequires:	gtk+3-devel >= 3.12.0}
+%endif
+BuildRequires:	libbsd-devel
+BuildRequires:	libnet-devel >= 1:1.1.5
 BuildRequires:	libpcap-devel
-BuildRequires:	libtool
+%{?with_lua:BuildRequires:	luajit-devel >= 2.0.0}
 BuildRequires:	ncurses-ext-devel
 BuildRequires:	openssl-devel >= 0.9.7d
 BuildRequires:	pcre-devel
 BuildRequires:	pkgconfig
+BuildRequires:	zlib-devel
+Requires:	curl-libs >= 7.26.0
+%if %{with gtk}
+%{?with_gtk2:Requires:	gtk+2 >= 2:2.10}
+%{!?with_gtk2:Requires:	gtk+3 >= 3.12.0}
+%endif
+Requires:	libnet >= 1:1.1.5
 BuildRoot:	%{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
 %define		specflags	-fomit-frame-pointer
@@ -80,45 +94,66 @@ hosts na rede local, portas abertas, versão de serviços, tipo de host
 (gateway, router ou um computador) e a distância estimada no hop.
 
 %prep
-%setup -q -n %{name}-NG-%{version}
+%setup -q
+%patch0 -p1
 %patch1 -p1
 %patch2 -p1
-%patch3 -p1
-%patch4 -p1
-%patch5 -p1
-%patch6 -p1
 
 %build
-%{__libtoolize}
-%{__aclocal}
-%{__autoconf}
-%{__autoheader}
-%{__automake}
-%configure \
-	--%{!?debug:dis}%{?debug:en}able-debug \
-	--%{?with_gtk:en}%{!?with_gtk:dis}able-gtk \
-	--enable-plugins \
-	--enable-https
+install -d build
+cd build
+%cmake .. \
+	-DBUNDLED_LIBS=OFF \
+	%{!?with_geoip:-DENABLE_GEOIP=OFF} \
+	%{!?with_gtk:-DENABLE_GTK=OFF} \
+	-DENABLE_IPV6=ON
+	%{?with_lua:-DENABLE_LUA=ON} \
+	%{?with_gtk2:-DGTK_BUILD_TYPE=GTK2}
+
 %{__make}
 
 %install
 rm -rf $RPM_BUILD_ROOT
 
-%{__make} install \
+%{__make} -C build install \
 	DESTDIR=$RPM_BUILD_ROOT
 
+# API not exported
+%{__rm} $RPM_BUILD_ROOT%{_libdir}/libettercap*.so
+
 %clean
 rm -rf $RPM_BUILD_ROOT
 
+%post	-p /sbin/ldconfig
+%postun	-p /sbin/ldconfig
+
 %files
 %defattr(644,root,root,755)
-%doc README CHANGELOG AUTHORS TODO doc/*
-%doc THANKS README.BUGS
-%attr(755,root,root) %{_bindir}/*
+%doc AUTHORS CHANGELOG LICENSE.OPENSSL README README.{BINARIES,BUGS} THANKS TODO doc/*
+%attr(755,root,root) %{_bindir}/ettercap
+%attr(755,root,root) %{_bindir}/ettercap-pkexec
+%attr(755,root,root) %{_bindir}/etterfilter
+%attr(755,root,root) %{_bindir}/etterlog
+%attr(755,root,root) %{_libdir}/libettercap.so.*.*.*
+%attr(755,root,root) %ghost %{_libdir}/libettercap.so.0
+%attr(755,root,root) %{_libdir}/libettercap-ui.so.*.*.*
+%attr(755,root,root) %ghost %{_libdir}/libettercap-ui.so.0
 %dir %{_libdir}/ettercap
-%attr(755,root,root) %{_libdir}/ettercap/*.so
-%{_libdir}/ettercap/*.la
+%attr(755,root,root) %{_libdir}/ettercap/ec_*.so
+%dir %{_sysconfdir}/ettercap
+%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/ettercap/etter.conf
+%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/ettercap/etter.dns
+%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/ettercap/etter.mdns
+%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/ettercap/etter.nbns
+%{_datadir}/appdata/ettercap.appdata.xml
 %{_datadir}/ettercap
-%{_mandir}/man8/*
-%{_mandir}/man5/*
-%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/etter.conf
+%{_datadir}/polkit-1/actions/org.pkexec.ettercap.policy
+%{_desktopdir}/ettercap.desktop
+%{_pixmapsdir}/ettercap.svg
+%{_mandir}/man5/etter.conf.5*
+%{_mandir}/man8/ettercap.8*
+%{_mandir}/man8/ettercap-pkexec.8*
+%{_mandir}/man8/ettercap_curses.8*
+%{_mandir}/man8/ettercap_plugins.8*
+%{_mandir}/man8/etterfilter.8*
+%{_mandir}/man8/etterlog.8*
diff --git a/ettercap-as-needed.patch b/ettercap-as-needed.patch
deleted file mode 100644
index 10f7ad5..0000000
--- a/ettercap-as-needed.patch
+++ /dev/null
@@ -1,12 +0,0 @@
---- a/src/Makefile.am
-+++ b/src/Makefile.am
-@@ -140,7 +140,8 @@ if GTK
- ettercap_LDADD += interfaces/gtk/libec_gtk.a
- endif
- 
--ettercap_LDFLAGS = -export-dynamic @EC_LIBS@ 
-+ettercap_LDFLAGS = -export-dynamic
-+ettercap_LDADD += $(EC_LIBS)
- 
- CLEANFILES = *.log *.out core* missing/*.o *~
- 
diff --git a/ettercap-build.patch b/ettercap-build.patch
deleted file mode 100644
index 10756f7..0000000
--- a/ettercap-build.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- ec/src/ec_log.c~	2004-09-30 18:01:45.000000000 +0200
-+++ ec/src/ec_log.c	2008-11-01 14:43:25.354519564 +0100
-@@ -190,7 +190,7 @@
-       if (fd->cfd == NULL)
-          SEMIFATAL_ERROR("%s", gzerror(fd->cfd, &zerr));
-    } else {
--      fd->fd = open(filename, O_CREAT | O_TRUNC | O_RDWR | O_BINARY);
-+      fd->fd = open(filename, O_CREAT | O_TRUNC | O_RDWR | O_BINARY, 0644);
-       if (fd->fd == -1)
-          SEMIFATAL_ERROR("Can't create %s: %s", filename, strerror(errno));
-    }
diff --git a/ettercap-buildtype.patch b/ettercap-buildtype.patch
new file mode 100644
index 0000000..24e78c7
--- /dev/null
+++ b/ettercap-buildtype.patch
@@ -0,0 +1,14 @@
+--- ettercap-0.8.3/CMakeLists.txt.orig	2019-06-28 01:19:16.000000000 +0200
++++ ettercap-0.8.3/CMakeLists.txt	2020-05-23 18:12:37.619999020 +0200
+@@ -29,11 +29,6 @@
+   set(CMAKE_BUILD_TYPE "Release" CACHE STRING
+     "Choose the type of build, options are: ${VALID_BUILD_TYPES}." FORCE)
+ endif()
+-list(FIND VALID_BUILD_TYPES ${CMAKE_BUILD_TYPE} contains_valid)
+-if(contains_valid EQUAL -1)
+-  message(FATAL_ERROR "Unknown CMAKE_BUILD_TYPE: '${CMAKE_BUILD_TYPE}'. Valid options are: ${VALID_BUILD_TYPES}")
+-endif()
+-unset(contains_valid)
+ 
+ include(CMakeDependentOption)
+ 
diff --git a/ettercap-flags.patch b/ettercap-flags.patch
deleted file mode 100644
index 7ecbe9d..0000000
--- a/ettercap-flags.patch
+++ /dev/null
@@ -1,19 +0,0 @@
-diff --git a/configure.in b/configure.in
-index 36d1fc1..6845c48 100644
---- a/configure.in
-+++ b/configure.in
-@@ -333,12 +333,12 @@ AC_ARG_ENABLE(debug, AC_HELP_STRING(--enable-debug,create a file for debugging m
-       ac_ec_debug=yes
-       ;;
-    no)  AC_MSG_RESULT(no)
--      DEBUG_FLAGS="-O2 -funroll-loops -fomit-frame-pointer -Wall"
-+      DEBUG_FLAGS="-fomit-frame-pointer -Wall"
-       ac_ec_debug=no
-       ;;
- esac ],
-    AC_MSG_RESULT(no)
--   DEBUG_FLAGS="-O2 -funroll-loops -fomit-frame-pointer -Wall"
-+   DEBUG_FLAGS="-fomit-frame-pointer -Wall"
-    ac_ec_debug=no
- )
- 
diff --git a/ettercap-gtk3.patch b/ettercap-gtk3.patch
new file mode 100644
index 0000000..0f0edd5
--- /dev/null
+++ b/ettercap-gtk3.patch
@@ -0,0 +1,20 @@
+--- ettercap-0.8.3/cmake/Modules/FindGTK3.cmake.orig	2019-06-28 01:19:16.000000000 +0200
++++ ettercap-0.8.3/cmake/Modules/FindGTK3.cmake	2020-05-23 19:35:27.043077345 +0200
+@@ -126,6 +126,7 @@
+     giomm-2.4
+     gtk-3.0
+     gtkmm-2.4
++    harfbuzz
+     libglade-2.0
+     libglademm-2.4
+     pango-1.0
+@@ -425,6 +426,9 @@
+ 
+     _gtk3_find_include_dir(GTK3_FONTCONFIG_INCLUDE_DIR fontconfig/fontconfig.h)
+ 
++    _gtk3_find_include_dir(GTK3_HARFBUZZ_INCLUDE_DIR hb.h)
++    _gtk3_find_library(GTK3_HARFBUZZ_LIBRARY harfbuzz false false)
++
+     _gtk3_find_include_dir(GTK3_PANGO_INCLUDE_DIR pango/pango.h)
+     _gtk3_find_library(GTK3_PANGO_LIBRARY pango false true)
+ 
diff --git a/ettercap-libmissing.patch b/ettercap-libmissing.patch
deleted file mode 100644
index 0f7dda7..0000000
--- a/ettercap-libmissing.patch
+++ /dev/null
@@ -1,71 +0,0 @@
-diff --git a/configure.in b/configure.in
-index 4d87a3f..36d1fc1 100644
---- a/configure.in
-+++ b/configure.in
-@@ -295,16 +295,16 @@ AM_CONDITIONAL(MISSING_SCANDIR, false)
- 
- dnl AC_REPLACE_FUNCS(strlcpy)
- 
--AC_CHECK_FUNCS([strlcpy], , [AC_LIBOBJ(missing/strlcpy) AM_CONDITIONAL(MISSING_STRLCPY, true)])
--AC_CHECK_FUNCS([strlcat], , [AC_LIBOBJ(missing/strlcat) AM_CONDITIONAL(MISSING_STRLCAT, true)])
--AC_CHECK_FUNCS([strsep], , [AC_LIBOBJ(missing/strsep) AM_CONDITIONAL(MISSING_STRSEP, true)])
--AC_CHECK_FUNCS([memmem], , [AC_LIBOBJ(missing/memmem) AM_CONDITIONAL(MISSING_MEMMEM, true)])
--AC_CHECK_FUNCS([memcmp], , [AC_LIBOBJ(missing/memcmp) AM_CONDITIONAL(MISSING_MEMCMP, true)])
--AC_CHECK_FUNCS([basename], , [AC_LIBOBJ(missing/basename) AM_CONDITIONAL(MISSING_BASENAME, true)])
--AC_CHECK_FUNCS([getopt_long], , [AC_LIBOBJ(missing/getopt) AM_CONDITIONAL(MISSING_GETOPT_LONG, true)])
--AC_CHECK_FUNCS([strcasestr], , [AC_LIBOBJ(missing/strcasestr) AM_CONDITIONAL(MISSING_STRCASESTR, true)])
--AC_CHECK_FUNCS([scandir], , [AC_LIBOBJ(missing/scandir) AM_CONDITIONAL(MISSING_SCANDIR, true)])
--AC_CHECK_FUNCS([inet_aton], , [AC_LIBOBJ(missing/inet_aton) AM_CONDITIONAL(MISSING_INET_ATON, true)])
-+AC_CHECK_FUNCS([strlcpy], , [AC_LIBOBJ(strlcpy) AM_CONDITIONAL(MISSING_STRLCPY, true)])
-+AC_CHECK_FUNCS([strlcat], , [AC_LIBOBJ(strlcat) AM_CONDITIONAL(MISSING_STRLCAT, true)])
-+AC_CHECK_FUNCS([strsep], , [AC_LIBOBJ(strsep) AM_CONDITIONAL(MISSING_STRSEP, true)])
-+AC_CHECK_FUNCS([memmem], , [AC_LIBOBJ(memmem) AM_CONDITIONAL(MISSING_MEMMEM, true)])
-+AC_CHECK_FUNCS([memcmp], , [AC_LIBOBJ(memcmp) AM_CONDITIONAL(MISSING_MEMCMP, true)])
-+AC_CHECK_FUNCS([basename], , [AC_LIBOBJ(basename) AM_CONDITIONAL(MISSING_BASENAME, true)])
-+AC_CHECK_FUNCS([getopt_long], , [AC_LIBOBJ(getopt) AM_CONDITIONAL(MISSING_GETOPT_LONG, true)])
-+AC_CHECK_FUNCS([strcasestr], , [AC_LIBOBJ(strcasestr) AM_CONDITIONAL(MISSING_STRCASESTR, true)])
-+AC_CHECK_FUNCS([scandir], , [AC_LIBOBJ(scandir) AM_CONDITIONAL(MISSING_SCANDIR, true)])
-+AC_CHECK_FUNCS([inet_aton], , [AC_LIBOBJ(inet_aton) AM_CONDITIONAL(MISSING_INET_ATON, true)])
- 
- AC_CHECK_LIB(resolv, inet_aton,
-    AM_CONDITIONAL(INET_ATON_WANTS_RESOLV, true), 
-@@ -836,6 +836,7 @@ AC_CONFIG_FILES(  Makefile
-                   man/etter.conf.5
-                   share/Makefile 
-                   src/Makefile 
-+                  src/missing/Makefile
-                   src/os/Makefile 
-                   src/interfaces/Makefile 
-                   src/interfaces/daemon/Makefile 
-diff --git a/src/Makefile.am b/src/Makefile.am
-index 717b2fb..2bc0dcf 100644
---- a/src/Makefile.am
-+++ b/src/Makefile.am
-@@ -3,7 +3,7 @@
- 
- include $(top_srcdir)/Makefile.am.common
- 
--SUBDIRS = os interfaces
-+SUBDIRS = os interfaces missing
- 
- bin_PROGRAMS = ettercap
- 
-@@ -127,7 +127,7 @@ ettercap_SOURCES += dissectors/ec_socks.c \
- 
- ettercap_CFLAGS = @EC_CFLAGS@
- 
--ettercap_LDADD = @LIBOBJS@ \
-+ettercap_LDADD = missing/libmissing.a \
-                  os/libec_os.a \
-                  interfaces/daemon/libec_daemon.a \
-                  interfaces/text/libec_text.a 
-diff --git a/src/missing/Makefile.am b/src/missing/Makefile.am
-new file mode 100644
-index 0000000..594e470
---- /dev/null
-+++ b/src/missing/Makefile.am
-@@ -0,0 +1,4 @@
-+
-+noinst_LIBRARIES = libmissing.a
-+libmissing_a_SOURCES =
-+libmissing_a_LIBADD = $(LIBOBJS) $(ALLOCA)
diff --git a/ettercap-link.patch b/ettercap-link.patch
new file mode 100644
index 0000000..a8cdd98
--- /dev/null
+++ b/ettercap-link.patch
@@ -0,0 +1,69 @@
+--- ettercap-0.8.3/src/interfaces/CMakeLists.txt.orig	2019-06-28 01:19:16.000000000 +0200
++++ ettercap-0.8.3/src/interfaces/CMakeLists.txt	2020-05-23 19:59:18.055324887 +0200
+@@ -109,5 +109,5 @@
+   VERSION ${VERSION}
+   SOVERSION 0
+   )
+-target_link_libraries(ec_interfaces ${EC_INTERFACES_LIBS} ${EC_LIBS})
++target_link_libraries(ec_interfaces ${EC_INTERFACES_LIBS} lib_ettercap ${EC_LIBS})
+ install(TARGETS ec_interfaces DESTINATION ${INSTALL_LIBDIR})
+--- ettercap-0.8.3/src/CMakeLists.txt.orig	2019-06-28 01:19:16.000000000 +0200
++++ ettercap-0.8.3/src/CMakeLists.txt	2020-05-23 20:10:25.768374241 +0200
+@@ -190,7 +190,7 @@
+ 
+ add_library(lib_ettercap SHARED ${EC_SRC})
+ add_dependencies(lib_ettercap libnet)
+-target_link_libraries(lib_ettercap ec_interfaces ${EC_LIBS})
++target_link_libraries(lib_ettercap ${EC_LIBS})
+ 
+ if(NOT LIBRARY_BUILD)
+   add_subdirectory(interfaces)
+@@ -199,7 +199,7 @@
+     include_directories(interfaces/curses interfaces/curses/widgets)
+   endif()
+   add_executable(ettercap ec_parser.c ec_main.c)
+-  target_link_libraries(ettercap lib_ettercap ${EC_LIBS})
++  target_link_libraries(ettercap ec_interfaces lib_ettercap ${EC_LIBS})
+   if(NOT DISABLE_RPATH)
+     set_target_properties(ettercap PROPERTIES
+     INSTALL_RPATH ${INSTALL_LIBDIR})
+--- ettercap-0.8.3/utils/CMakeLists.txt.orig	2019-06-28 01:19:17.000000000 +0200
++++ ettercap-0.8.3/utils/CMakeLists.txt	2020-05-23 20:23:46.770701506 +0200
+@@ -20,7 +20,7 @@
+ include_directories(${CMAKE_CURRENT_BINARY_DIR})
+ 
+ add_executable(etterfilter ${EF_SRC} ${FLEX_EF_SCANNER_OUTPUTS} ${BISON_EF_PARSER_OUTPUTS})
+-target_link_libraries(etterfilter lib_ettercap)
++target_link_libraries(etterfilter ec_interfaces lib_ettercap)
+ if(NOT DISABLE_RPATH)
+   set_target_properties(etterfilter PROPERTIES INSTALL_RPATH ${INSTALL_LIBDIR})
+ endif()
+@@ -42,7 +42,7 @@
+ )
+ 
+ add_executable(etterlog ${EL_SRC})
+-target_link_libraries(etterlog lib_ettercap)
++target_link_libraries(etterlog ec_interfaces lib_ettercap)
+ 
+ if(NOT DISABLE_RPATH)
+   set_target_properties(etterlog PROPERTIES INSTALL_RPATH ${INSTALL_LIBDIR})
+--- ettercap-0.8.3/cmake/Modules/EttercapLibCheck.cmake.orig	2019-06-28 01:19:16.000000000 +0200
++++ ettercap-0.8.3/cmake/Modules/EttercapLibCheck.cmake	2020-05-23 21:00:24.582128273 +0200
+@@ -189,7 +189,7 @@
+     check_library_exists(bsd strlcat "bsd/string.h" HAVE_STRLCAT)
+     check_library_exists(bsd strlcpy "bsd/string.h" HAVE_STRLCPY)
+     if(HAVE_STRLCAT OR HAVE_STRLCPY)
+-        set(EC_INTERFACES_LIBS ${EC_INTERFACES_LIBS} bsd)
++        set(EC_LIBS ${EC_LIBS} bsd)
+     endif()
+ endif()
+ 
+@@ -202,7 +202,7 @@
+ 
+ find_library(HAVE_PCAP pcap)
+ if(HAVE_PCAP)
+-    set(EC_INTERFACES_LIBS ${EC_INTERFACES_LIBS} ${HAVE_PCAP})
++    set(EC_LIBS ${EC_LIBS} ${HAVE_PCAP})
+ else()
+     message(FATAL_ERROR "libpcap not found!")
+ endif()
diff --git a/ettercap-shlib_ext.patch b/ettercap-shlib_ext.patch
deleted file mode 100644
index 7a4e25d..0000000
--- a/ettercap-shlib_ext.patch
+++ /dev/null
@@ -1,26 +0,0 @@
-diff --git a/include/ec_os_mingw.h b/include/ec_os_mingw.h
-index 51b8ca9..2741e39 100644
---- a/include/ec_os_mingw.h
-+++ b/include/ec_os_mingw.h
-@@ -163,7 +163,7 @@ EC_API_EXTERN const char *ec_win_get_ec_dir (void);
-  */
- #if !defined(HAVE_DLOPEN)
-    #define RTLD_NOW 0
--   #define LTDL_SHLIB_EXT       "*.dll"
-+   #define LT_MODULE_EXT       ".dll"
- 
-    #define dlopen(dll,flg)      ec_win_dlopen (dll, flg)
-    #define lt_dlopen(dll)       ec_win_dlopen (dll, 0)
-diff --git a/src/ec_plugins.c b/src/ec_plugins.c
-index 88c3c46..ffe16c5 100644
---- a/src/ec_plugins.c
-+++ b/src/ec_plugins.c
-@@ -131,7 +131,7 @@ int plugin_filter(struct dirent *d)
- int plugin_filter(const struct dirent *d)
- #endif
- {
--   if ( match_pattern(d->d_name, PLUGIN_PATTERN LTDL_SHLIB_EXT) )
-+   if ( match_pattern(d->d_name, PLUGIN_PATTERN LT_MODULE_EXT) )
-       return 1;
- 
-    return 0;
diff --git a/openssl.patch b/openssl.patch
deleted file mode 100644
index bad147e..0000000
--- a/openssl.patch
+++ /dev/null
@@ -1,333 +0,0 @@
-From f0d63b27c82df2ad5f7ada6310727d841b43fbcc Mon Sep 17 00:00:00 2001
-From: Gianfranco Costamagna <costamagnagianfranco at yahoo.it>
-Date: Mon, 27 Jun 2016 12:41:33 +0200
-Subject: [PATCH 1/2] First draft of openssl 1.1 compatibility layer (from
- https://github.com/curl/curl/commit/cfe16c22d7891a1f65ea8cd4c5352504a2afbddc)
- Closes: #739
-
----
- src/dissectors/ec_ssh.c | 93 ++++++++++++++++++++++++++++++++++++++++-
- src/ec_sslwrap.c        | 14 +++++++
- 2 files changed, 106 insertions(+), 1 deletion(-)
-
-diff --git a/src/dissectors/ec_ssh.c b/src/dissectors/ec_ssh.c
-index f89200dca..26c864910 100644
---- a/src/dissectors/ec_ssh.c
-+++ b/src/dissectors/ec_ssh.c
-@@ -36,6 +36,10 @@
- #include <openssl/md5.h>
- #include <zlib.h>
- 
-+#if (OPENSSL_VERSION_NUMBER >= 0x10100000L)
-+#define HAVE_OPAQUE_RSA_DSA_DH 1 /* since 1.1.0 -pre5 */
-+#endif
-+
- #define SMSG_PUBLIC_KEY 2
- #define CMSG_SESSION_KEY 3
- #define CMSG_USER 4
-@@ -138,6 +142,11 @@ FUNC_DECODER(dissector_ssh)
-    char tmp[MAX_ASCII_ADDR_LEN];
-    u_int32 ssh_len, ssh_mod;
-    u_char ssh_packet_type, *ptr, *key_to_put;
-+#ifdef HAVE_OPAQUE_RSA_DSA_DH
-+   BIGNUM *h_n, *s_n, *m_h_n, *m_s_n;
-+   BIGNUM *h_e, *s_e, *m_h_e, *m_s_e;
-+   BIGNUM *h_d, *s_d, *m_h_d, *m_s_d;
-+#endif
- 
-    /* don't complain about unused var */
-    (void) DECODE_DATA; 
-@@ -383,12 +392,25 @@ FUNC_DECODER(dissector_ssh)
-             if (session_data->ptrkey == NULL) { 
-                /* Initialize RSA key structures (other fileds are set to 0) */
-                session_data->serverkey = RSA_new();
-+#ifdef HAVE_OPAQUE_RSA_DSA_DH
-+               s_n = BN_new();
-+               s_e = BN_new();
-+               RSA_set0_key(session_data->serverkey, s_n, s_e, s_d);
-+#else
-                session_data->serverkey->n = BN_new();
-                session_data->serverkey->e = BN_new();
-+#endif
- 
-                session_data->hostkey = RSA_new();
-+
-+#ifdef HAVE_OPAQUE_RSA_DSA_DH
-+               h_n = BN_new();
-+               h_e = BN_new();
-+               RSA_set0_key(session_data->hostkey, h_n, h_e, h_d);
-+#else
-                session_data->hostkey->n = BN_new();
-                session_data->hostkey->e = BN_new();
-+#endif
- 
-                /* Get the RSA Key from the packet */
-                NS_GET32(server_mod,ptr);
-@@ -396,19 +418,37 @@ FUNC_DECODER(dissector_ssh)
-                   DEBUG_MSG("Dissector_ssh Bougs Server_Mod");
-                   return NULL;
-                }
-+#ifdef HAVE_OPAQUE_RSA_DSA_DH
-+               RSA_get0_key(session_data->serverkey, &s_n, &s_e, &s_d);
-+               get_bn(s_e, &ptr);
-+               get_bn(s_n, &ptr);
-+#else
-                get_bn(session_data->serverkey->e, &ptr);
-                get_bn(session_data->serverkey->n, &ptr);
-+#endif
- 
-                NS_GET32(host_mod,ptr);
-                if (ptr + (host_mod/8) > PACKET->DATA.data + PACKET->DATA.len) {
-                   DEBUG_MSG("Dissector_ssh Bougs Host_Mod");
-                   return NULL;
-                }
-+
-+#ifdef HAVE_OPAQUE_RSA_DSA_DH
-+               RSA_get0_key(session_data->hostkey, &h_n, &h_e, &h_d);
-+               get_bn(h_e, &ptr);
-+               get_bn(h_n, &ptr);
-+#else
-                get_bn(session_data->hostkey->e, &ptr);
-                get_bn(session_data->hostkey->n, &ptr);
-+#endif
- 
-+#ifdef HAVE_OPAQUE_RSA_DSA_DH
-+               server_exp = BN_get_word(s_e);
-+               host_exp   = BN_get_word(h_e);
-+#else
-                server_exp = *(session_data->serverkey->e->d);
-                host_exp   = *(session_data->hostkey->e->d);
-+#endif
- 
-                /* Check if we already have a suitable RSA key to substitute */
-                index_ssl = &ssh_conn_key;
-@@ -424,7 +464,7 @@ FUNC_DECODER(dissector_ssh)
-                   SAFE_CALLOC(*index_ssl, 1, sizeof(ssh_my_key));
- 
-                   /* Generate the new key */
--                  (*index_ssl)->myserverkey = (RSA *)RSA_generate_key(server_mod, server_exp, NULL, NULL);
-+                  (*index_ssl)->myserverkey = (RSA *)RSA_generate_key_ex(server_mod, server_exp, NULL, NULL);
-                   (*index_ssl)->myhostkey = (RSA *)RSA_generate_key(host_mod, host_exp, NULL, NULL);
-                   (*index_ssl)->server_mod = server_mod;
-                   (*index_ssl)->host_mod = host_mod;
-@@ -443,11 +483,25 @@ FUNC_DECODER(dissector_ssh)
- 
-             /* Put our RSA key in the packet */
-             key_to_put+=4;
-+
-+#ifdef HAVE_OPAQUE_RSA_DSA_DH
-+            RSA_get0_key(session_data->ptrkey->myserverkey, &m_s_n, &m_s_e, &m_s_d);
-+            put_bn(m_s_e, &key_to_put);
-+            put_bn(m_s_n, &key_to_put);
-+#else
-             put_bn(session_data->ptrkey->myserverkey->e, &key_to_put);
-             put_bn(session_data->ptrkey->myserverkey->n, &key_to_put);
-+#endif
-             key_to_put+=4;
-+
-+#ifdef HAVE_OPAQUE_RSA_DSA_DH
-+            RSA_get0_key(session_data->ptrkey->myhostkey, &m_h_n, &m_h_e, &m_h_d);
-+            put_bn(m_h_e, &key_to_put);
-+            put_bn(m_h_n, &key_to_put);
-+#else
-             put_bn(session_data->ptrkey->myhostkey->e, &key_to_put);
-             put_bn(session_data->ptrkey->myhostkey->n, &key_to_put);
-+#endif
- 
-             /* Recalculate SSH crc */
-             *(u_int32 *)(PACKET->DATA.data + PACKET->DATA.len - 4) = htonl(CRC_checksum(PACKET->DATA.data+4, PACKET->DATA.len-8, CRC_INIT_ZERO));
-@@ -482,19 +536,34 @@ FUNC_DECODER(dissector_ssh)
-             key_to_put = ptr;
- 
-             /* Calculate real session id and our fake session id */
-+#ifdef HAVE_OPAQUE_RSA_DSA_DH
-+            temp_session_id = ssh_session_id(cookie, h_n, s_n);
-+#else
-             temp_session_id = ssh_session_id(cookie, session_data->hostkey->n, session_data->serverkey->n);
-+#endif
-             if (temp_session_id)
-                memcpy(session_id1, temp_session_id, 16);
-+
-+#ifdef HAVE_OPAQUE_RSA_DSA_DH
-+            temp_session_id=ssh_session_id(cookie, m_h_n, m_s_n);
-+#else
-             temp_session_id=ssh_session_id(cookie, session_data->ptrkey->myhostkey->n, session_data->ptrkey->myserverkey->n);
-+#endif
-+
-             if (temp_session_id)
-                memcpy(session_id2, temp_session_id, 16);
- 
-             /* Get the session key */
-             enckey = BN_new();
-+
-             get_bn(enckey, &ptr);
- 
-             /* Decrypt session key */
-+#ifdef HAVE_OPAQUE_RSA_DSA_DH
-+            if (BN_cmp(m_s_n, m_h_n) > 0) {
-+#else
-             if (BN_cmp(session_data->ptrkey->myserverkey->n, session_data->ptrkey->myhostkey->n) > 0) {
-+#endif
-               rsa_private_decrypt(enckey, enckey, session_data->ptrkey->myserverkey);
-               rsa_private_decrypt(enckey, enckey, session_data->ptrkey->myhostkey);
-             } else {
-@@ -534,7 +603,11 @@ FUNC_DECODER(dissector_ssh)
-                  BN_add_word(bn, sesskey[i]);
-             }
- 
-+#ifdef HAVE_OPAQUE_RSA_DSA_DH
-+            if (BN_cmp(s_n, h_n) < 0) {
-+#else
-             if (BN_cmp(session_data->serverkey->n, session_data->hostkey->n) < 0) {
-+#endif
-                rsa_public_encrypt(bn, bn, session_data->serverkey);
-                rsa_public_encrypt(bn, bn, session_data->hostkey);
-             } else {
-@@ -716,7 +789,16 @@ static void rsa_public_encrypt(BIGNUM *out, BIGNUM *in, RSA *key)
-    u_char *inbuf, *outbuf;
-    int32 len, ilen, olen;
- 
-+#ifdef HAVE_OPAQUE_RSA_DSA_DH
-+   BIGNUM *n;
-+   BIGNUM *e;
-+   BIGNUM *d;
-+   RSA_get0_key(key, &n, &e, &d);
-+   olen = BN_num_bytes(n);
-+#else
-    olen = BN_num_bytes(key->n);
-+#endif
-+
-    outbuf = malloc(olen);
-    if (outbuf == NULL) /* oops, couldn't allocate memory */
-       return;
-@@ -744,7 +826,16 @@ static void rsa_private_decrypt(BIGNUM *out, BIGNUM *in, RSA *key)
-    u_char *inbuf, *outbuf;
-    int32 len, ilen, olen;
- 
-+#ifdef HAVE_OPAQUE_RSA_DSA_DH
-+   BIGNUM *n;
-+   BIGNUM *e;
-+   BIGNUM *d;
-+   RSA_get0_key(key, &n, &e, &d);
-+   olen = BN_num_bytes(n);
-+#else
-    olen = BN_num_bytes(key->n);
-+#endif
-+
-    outbuf = malloc(olen);
-    if (outbuf == NULL) /* oops, couldn't allocate memory */
-       return;
-diff --git a/src/ec_sslwrap.c b/src/ec_sslwrap.c
-index c6c74421e..6369d2514 100644
---- a/src/ec_sslwrap.c
-+++ b/src/ec_sslwrap.c
-@@ -56,6 +56,10 @@
- #define OPENSSL_NO_KRB5 1
- #include <openssl/ssl.h>
- 
-+#if (OPENSSL_VERSION_NUMBER >= 0x10100000L)
-+#define HAVE_OPAQUE_RSA_DSA_DH 1 /* since 1.1.0 -pre5 */
-+#endif
-+
- #define BREAK_ON_ERROR(x,y,z) do {  \
-    if (x == -E_INVALID) {            \
-       SAFE_FREE(z.DATA.disp_data);  \
-@@ -1102,9 +1106,19 @@ static X509 *sslw_create_selfsigned(X509 *server_cert)
-    index = X509_get_ext_by_NID(server_cert, NID_authority_key_identifier, -1);
-    if (index >=0) {
-       ext = X509_get_ext(server_cert, index);
-+#ifdef HAVE_OPAQUE_RSA_DSA_DH
-+      ASN1_OCTET_STRING* data;
-+      data = X509_EXTENSION_get_data (ext);
-+#endif
-       if (ext) {
-+#ifdef HAVE_OPAQUE_RSA_DSA_DH
-+         data->data[7] = 0xe7;
-+         data->data[8] = 0x7e;
-+         X509_EXTENSION_set_data (ext, data);
-+#else
-          ext->value->data[7] = 0xe7;
-          ext->value->data[8] = 0x7e;
-+#endif
-          X509_add_ext(out_cert, ext, -1);
-       }
-    }
-
-From def7a62c542241367428223dc460906b0634dcd1 Mon Sep 17 00:00:00 2001
-From: Gianfranco Costamagna <costamagnagianfranco at yahoo.it>
-Date: Tue, 28 Jun 2016 17:04:20 +0200
-Subject: [PATCH 2/2] Fix naming, from koeppea
-
----
- src/ec_sslwrap.c | 10 +++++-----
- 1 file changed, 5 insertions(+), 5 deletions(-)
-
-diff --git a/src/ec_sslwrap.c b/src/ec_sslwrap.c
-index 6369d2514..696b690a4 100644
---- a/src/ec_sslwrap.c
-+++ b/src/ec_sslwrap.c
-@@ -1107,14 +1107,14 @@ static X509 *sslw_create_selfsigned(X509 *server_cert)
-    if (index >=0) {
-       ext = X509_get_ext(server_cert, index);
- #ifdef HAVE_OPAQUE_RSA_DSA_DH
--      ASN1_OCTET_STRING* data;
--      data = X509_EXTENSION_get_data (ext);
-+      ASN1_OCTET_STRING* os;
-+      os = X509_EXTENSION_get_data (ext);
- #endif
-       if (ext) {
- #ifdef HAVE_OPAQUE_RSA_DSA_DH
--         data->data[7] = 0xe7;
--         data->data[8] = 0x7e;
--         X509_EXTENSION_set_data (ext, data);
-+         os->data[7] = 0xe7;
-+         os->data[8] = 0x7e;
-+         X509_EXTENSION_set_data (ext, os);
- #else
-          ext->value->data[7] = 0xe7;
-          ext->value->data[8] = 0x7e;
-diff -ur ettercap-NG-0.7.3/src/dissectors/ec_ssh.c ettercap-NG-0.7.3.new/src/dissectors/ec_ssh.c
---- ettercap-NG-0.7.3/src/dissectors/ec_ssh.c	2018-09-26 07:30:04.680505099 +0200
-+++ ettercap-NG-0.7.3.new/src/dissectors/ec_ssh.c	2018-09-26 07:29:52.413476351 +0200
-@@ -91,8 +91,8 @@
- 
- struct des3_state
- {
--   des_key_schedule k1, k2, k3;
--   des_cblock iv1, iv2, iv3;
-+   DES_key_schedule k1, k2, k3;
-+   DES_cblock iv1, iv2, iv3;
- };
- 
- struct blowfish_state 
-@@ -674,13 +674,13 @@
- 
-    state = malloc(sizeof(*state));
- 
--   des_set_key((void *)sesskey, (state->k1));
--   des_set_key((void *)(sesskey + 8), (state->k2));
-+   DES_set_key((DES_cblock *)sesskey, &(state->k1));
-+   DES_set_key((DES_cblock *)(sesskey + 8), &(state->k2));
- 
-    if (len <= 16)
--      des_set_key((void *)sesskey, (state->k3));
-+      DES_set_key((void *)sesskey, &(state->k3));
-    else
--      des_set_key((void *)(sesskey + 16), (state->k3));
-+      DES_set_key((void *)(sesskey + 16), &(state->k3));
- 
-    memset(state->iv1, 0, 8);
-    memset(state->iv2, 0, 8);
-@@ -696,9 +696,9 @@
-    dstate = (struct des3_state *)state;
-    memcpy(dstate->iv1, dstate->iv2, 8);
- 
--   des_ncbc_encrypt(src, dst, len, (dstate->k3), &dstate->iv3, DES_DECRYPT);
--   des_ncbc_encrypt(dst, dst, len, (dstate->k2), &dstate->iv2, DES_ENCRYPT);
--   des_ncbc_encrypt(dst, dst, len, (dstate->k1), &dstate->iv1, DES_DECRYPT);
-+   DES_ncbc_encrypt(src, dst, len, &(dstate->k3), &dstate->iv3, DES_DECRYPT);
-+   DES_ncbc_encrypt(dst, dst, len, &(dstate->k2), &dstate->iv2, DES_ENCRYPT);
-+   DES_ncbc_encrypt(dst, dst, len, &(dstate->k1), &dstate->iv1, DES_DECRYPT);
- }
- 
- static void swap_bytes(const u_char *src, u_char *dst, int n)
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/ettercap.git/commitdiff/f8c47986b55307ca9098e4356260d256a6e089a1



More information about the pld-cvs-commit mailing list