diff mbox series

[meta-security,04/13] aircrack-ng: Upgrade to 1.7

Message ID 1792ae2762fc869e2762da670bb7793527dc9c89.1777476608.git.scott.murray@konsulko.com
State New
Headers show
Series Assorted updates 04/29 and wrynose branch plan | expand

Commit Message

Scott Murray April 29, 2026, 3:39 p.m. UTC
Upgrade to the latest release, 1.7, and rework recipe so that it
actually builds again.  Note that the extra scripts are no longer
installed by default as they seem somewhat stale and likely further
work is required to have any of them work.  A PACKAGECONFIG option,
"ext-scripts" has been added to enable installing them if they are
required for some reason.

Signed-off-by: Scott Murray <scott.murray@konsulko.com>
---
 ...001-Remove-build-directory-reference.patch | 79 +++++++++++++++++++
 .../aircrack-ng/aircrack-ng_1.6.bb            | 36 ---------
 .../aircrack-ng/aircrack-ng_1.7.bb            | 54 +++++++++++++
 3 files changed, 133 insertions(+), 36 deletions(-)
 create mode 100644 recipes-security/aircrack-ng/aircrack-ng/0001-Remove-build-directory-reference.patch
 delete mode 100644 recipes-security/aircrack-ng/aircrack-ng_1.6.bb
 create mode 100644 recipes-security/aircrack-ng/aircrack-ng_1.7.bb
diff mbox series

Patch

diff --git a/recipes-security/aircrack-ng/aircrack-ng/0001-Remove-build-directory-reference.patch b/recipes-security/aircrack-ng/aircrack-ng/0001-Remove-build-directory-reference.patch
new file mode 100644
index 0000000..335a420
--- /dev/null
+++ b/recipes-security/aircrack-ng/aircrack-ng/0001-Remove-build-directory-reference.patch
@@ -0,0 +1,79 @@ 
+From 3101dcd56c19112c6b6e4378886cdfdae7001304 Mon Sep 17 00:00:00 2001
+From: Scott Murray <scott.murray@konsulko.com>
+Date: Sun, 26 Apr 2026 02:10:06 +0300
+Subject: [PATCH] Remove build directory reference
+
+Remove logic in crypto engine loader code that tries to detect
+running inside a build tree to remove the resulting reference
+to the absolute build directoy path in the binary.
+
+Upstream-Status: Inappropriate [OE-specific]
+Signed-off-by: Scott Murray <scott.murray@konsulko.com>
+---
+ lib/libac/support/crypto_engine_loader.c | 40 +++++-------------------
+ 1 file changed, 7 insertions(+), 33 deletions(-)
+
+diff --git a/lib/libac/support/crypto_engine_loader.c b/lib/libac/support/crypto_engine_loader.c
+index 0ec02e7..f9f9cfd 100644
+--- a/lib/libac/support/crypto_engine_loader.c
++++ b/lib/libac/support/crypto_engine_loader.c
+@@ -251,26 +251,13 @@ EXPORT int ac_crypto_engine_loader_get_available(void)
+ #endif
+ 	REQUIRE(working_directory != NULL);
+ 
+-	if (strncmp(working_directory, ABS_TOP_BUILDDIR, strlen(ABS_TOP_BUILDDIR))
+-		== 0)
+-	{
+-		// use development paths
+-		snprintf(library_path,
+-				 sizeof(library_path) - 1,
+-				 "%s%s",
+-				 LIBAIRCRACK_CE_WPA_PATH,
+-				 LT_OBJDIR);
+-	}
+-	else
+-	{
+ #if defined(WIN32_PORTABLE)
+-		// use the current directory
+-		snprintf(library_path, sizeof(library_path) - 1, working_directory);
++	// use the current directory
++	snprintf(library_path, sizeof(library_path) - 1, working_directory);
+ #else
+-		// use installation paths
+-		snprintf(library_path, sizeof(library_path) - 1, "%s", LIBDIR);
++	// use installation paths
++	snprintf(library_path, sizeof(library_path) - 1, "%s", LIBDIR);
+ #endif
+-	}
+ 	free(working_directory);
+ 
+ 	// enumerate all DSOs in folder, opening, searching symbols, and testing
+@@ -353,22 +340,9 @@ EXPORT char * ac_crypto_engine_loader_best_library_for(int simd_features)
+ 		= get_current_working_directory(); // or the binary's path?
+ 	REQUIRE(working_directory != NULL);
+ 
+-	if (strncmp(
+-			working_directory, ABS_TOP_BUILDDIR, sizeof(ABS_TOP_BUILDDIR) - 1)
+-		== 0)
+-	{
+-		// use development paths
+-		snprintf(library_path,
+-				 sizeof(library_path) - 1,
+-				 "%s%s",
+-				 LIBAIRCRACK_CE_WPA_PATH,
+-				 LT_OBJDIR);
+-	}
+-	else
+-	{
+-		// use installation paths
+-		snprintf(library_path, sizeof(library_path) - 1, "%s", LIBDIR);
+-	}
++	// use installation paths
++	snprintf(library_path, sizeof(library_path) - 1, "%s", LIBDIR);
++
+ 	free(working_directory);
+ 
+ #if defined(WIN32_PORTABLE)
+-- 
+2.47.3
+
diff --git a/recipes-security/aircrack-ng/aircrack-ng_1.6.bb b/recipes-security/aircrack-ng/aircrack-ng_1.6.bb
deleted file mode 100644
index d3722c0..0000000
--- a/recipes-security/aircrack-ng/aircrack-ng_1.6.bb
+++ /dev/null
@@ -1,36 +0,0 @@ 
-SUMMARY = "Aircrack-ng is a set of tools for auditing wireless networks"
-DESCRIPTION = "Aircrack-ng is an 802.11 WEP and WPA-PSK keys cracking program that can recover keys once enough data packets have been captured. It implements the standard FMS attack along with some optimizations like KoreK attacks, as well as the PTW attack, thus making the attack much faster compared to other WEP cracking tools."
-SECTION = "security"
-LICENSE = "GPL-2.0-only"
-
-LIC_FILES_CHKSUM = "file://LICENSE;beginline=1;endline=2;md5=1fbd81241fe252ec0f5658a521ab7dd8"
-
-DEPENDS = "libnl openssl sqlite3 libpcre libpcap"
-
-SRC_URI = "http://download.aircrack-ng.org/${BP}.tar.gz"
-
-SRC_URI[md5sum] = "22ddc85549b51ed0da0931d01ef215e5"
-SRC_URI[sha256sum] = "4f0bfd486efc6ea7229f7fbc54340ff8b2094a0d73e9f617e0a39f878999a247"
-
-inherit autotools-brokensep pkgconfig
-
-PACKAGECONFIG ?= ""
-CFLAGS += " -I${S}/src/include"
-
-OEMAKE_EXTRA = "sqlite=true experimental=true pcre=true \
-                prefix=${prefix} \
-                "
-
-do_compile () {
-    make ${OEMAKE_EXTRA} TOOL_PREFIX=${TARGET_SYS}-
-}
-
-do_install () {
-    make DESTDIR=${D} ${OEMAKE_EXTRA} ext_scripts=true install
-}
-
-FILES:${PN} += "${libdir}/*.so"
-FILES_SOLIBSDEV = ""
-INSANE_SKIP:${PN} += "dev-so"
-
-RDEPENDS:${PN} = "libpcap"
diff --git a/recipes-security/aircrack-ng/aircrack-ng_1.7.bb b/recipes-security/aircrack-ng/aircrack-ng_1.7.bb
new file mode 100644
index 0000000..c2144be
--- /dev/null
+++ b/recipes-security/aircrack-ng/aircrack-ng_1.7.bb
@@ -0,0 +1,54 @@ 
+SUMMARY = "Aircrack-ng is a set of tools for auditing wireless networks"
+DESCRIPTION = "Aircrack-ng is an 802.11 WEP and WPA-PSK keys cracking program that can recover keys once enough data packets have been captured. It implements the standard FMS attack along with some optimizations like KoreK attacks, as well as the PTW attack, thus making the attack much faster compared to other WEP cracking tools."
+SECTION = "security"
+LICENSE = "GPL-2.0-only"
+
+LIC_FILES_CHKSUM = "file://LICENSE;beginline=1;endline=2;md5=1fbd81241fe252ec0f5658a521ab7dd8"
+
+DEPENDS = "libnl openssl libpcap"
+
+SRC_URI = "http://download.aircrack-ng.org/${BP}.tar.gz \
+           file://0001-Remove-build-directory-reference.patch \
+"
+SRC_URI[sha256sum] = "05a704e3c8f7792a17315080a21214a4448fd2452c1b0dd5226a3a55f90b58c3"
+
+inherit autotools-brokensep pkgconfig python3targetconfig
+
+PACKAGECONFIG ??= "pcre sqlite3 experimental"
+
+PACKAGECONFIG[pcre] = ",,libpcre"
+PACKAGECONFIG[sqlite3] = "--with-sqlite3=${STAGING_DIR_HOST}${prefix},--with-sqlite3=no,sqlite3"
+PACKAGECONFIG[experimental] = "--with-experimental=yes,--with-experimental=no"
+PACKAGECONFIG[ext-scripts] = "--with-ext-scripts=yes,--with-ext-scripts=no,python3-setuptools-native,ethtool python3 python3-requests"
+
+# pcap is theoretically optional, but is not unless the configure script is modified
+EXTRA_OECONF = " \
+    --with-libpcap-include=${STAGING_INCDIR}/pcap \
+    ac_cv_prog_ETHTOOL=${bindir}/ethtool \
+"
+
+EXTRA_OEMAKE = "pkgpythondir=${PYTHON_SITEPACKAGES_DIR}"
+
+do_install:append() {
+    # Remove to avoid TMPDIR leakage
+    rm -f ${D}${PYTHON_SITEPACKAGES_DIR}/airdrop-ng-install_files.txt
+    rm -f ${D}${PYTHON_SITEPACKAGES_DIR}/airgraph-ng-install_files.txt
+    rm -rf ${D}${PYTHON_SITEPACKAGES_DIR}/airdrop/__pycache__/
+    rm -rf ${D}${PYTHON_SITEPACKAGES_DIR}/airgraphviz/__pycache__/
+
+    # Fix up Python paths for target
+    for f in airdrop-ng airgraph-ng airodump-join; do
+        if [ -f "${D}${bindir}/$f" ]; then
+            sed -i -e 's,${PYTHON},/usr/bin/env python3,g' ${D}${bindir}/$f
+        fi
+    done
+
+}
+
+FILES:${PN} += " \
+    ${libdir}/*.so \
+    ${datadir}/airgraph-ng/ \
+    ${PYTHON_SITEPACKAGES_DIR} \
+"
+FILES_SOLIBSDEV = ""
+INSANE_SKIP:${PN} += "dev-so"