From e81b4c07ac872cb80e1ab01ecc9b900b4fe4788d Mon Sep 17 00:00:00 2001 From: Alice Carroll Date: Tue, 2 Apr 2024 08:09:32 +0300 Subject: [PATCH 1/2] maintainers: add caralice --- maintainers/maintainer-list.nix | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/maintainers/maintainer-list.nix b/maintainers/maintainer-list.nix index 9891026580b90d8..8c50bdc8b904a27 100644 --- a/maintainers/maintainer-list.nix +++ b/maintainers/maintainer-list.nix @@ -3134,6 +3134,16 @@ github = "CaptainJawZ"; githubId = 43111068; }; + caralice = { + name = "Alice Carroll"; + email = "nix@alice-carroll.pet"; + github = "thecaralice"; + githubId = 43097806; + keys = [ + { fingerprint = "C7EA B182 2AB1 246C 0FB8 DD72 0514 0B67 902C D3AF"; } + { fingerprint = "DA77 EDDB 4AF5 244C 665E 9176 A05E A86A 5834 1AA8"; } + ]; + }; CardboardTurkey = { name = "Kiran Ostrolenk"; email = "kiran@ostrolenk.co.uk"; From ad7afa95c63bfa760f9bf6aeb1e33c12b808dd43 Mon Sep 17 00:00:00 2001 From: Alice Carroll Date: Tue, 2 Apr 2024 09:46:32 +0300 Subject: [PATCH 2/2] aircrack-ng: refactor Support other systems, add test dependencies etc. --- pkgs/tools/networking/aircrack-ng/default.nix | 109 ++++++++++++++---- 1 file changed, 89 insertions(+), 20 deletions(-) diff --git a/pkgs/tools/networking/aircrack-ng/default.nix b/pkgs/tools/networking/aircrack-ng/default.nix index b4cab28e3ebdfb3..6bfd3136dc984da 100644 --- a/pkgs/tools/networking/aircrack-ng/default.nix +++ b/pkgs/tools/networking/aircrack-ng/default.nix @@ -1,34 +1,103 @@ -{ lib, stdenv, fetchurl, libpcap, openssl, zlib, wirelesstools -, iw, ethtool, pciutils, libnl, pkg-config, makeWrapper -, autoreconfHook, usbutils }: +{ lib +, stdenv +, fetchFromGitHub +, fetchzip +, makeWrapper +, autoreconfHook +, pkg-config +, openssl +, libgcrypt +, cmocka +, expect +, sqlite +, pcre2 + # Linux +, libpcap +, zlib +, wirelesstools +, iw +, ethtool +, pciutils +, libnl +, usbutils +, tcpdump +, hostapd +, wpa_supplicant +, screen + + # Cygwin +, libiconv + + # options +, enableExperimental ? true +, useGcrypt ? false +, enableAirolib ? true +, enableRegex ? true +, useAirpcap ? stdenv.isCygwin +}: +let + airpcap-sdk = fetchzip { + pname = "airpcap-sdk"; + version = "4.1.1"; + url = "https://support.riverbed.com/bin/support/download?sid=l3vk3eu649usgu3rj60uncjqqu"; + hash = "sha256-kJhnUvhnF9F/kIJx9NcbRUfIXUSX/SRaO/SWNvdkVT8="; + stripRoot = false; + extension = "zip"; + }; +in stdenv.mkDerivation rec { pname = "aircrack-ng"; version = "1.7"; - src = fetchurl { - url = "https://download.aircrack-ng.org/aircrack-ng-${version}.tar.gz"; - sha256 = "1hsq1gwmafka4bahs6rc8p98yi542h9a502h64bjlygpr3ih99q5"; + src = fetchFromGitHub { + owner = "aircrack-ng"; + repo = "aircrack-ng"; + rev = version; + hash = "sha256-niQDwiqi5GtBW5HIn0endnqPb/MqllcjsjXw4pTyFKY="; }; + postPatch = lib.optionalString stdenv.isLinux '' + substituteInPlace lib/osdep/linux.c --replace-warn /usr/local/bin ${lib.escapeShellArg (lib.makeBinPath [ + wirelesstools + ])} + ''; + + configureFlags = [ + (lib.withFeature enableExperimental "experimental") + (lib.withFeature useGcrypt "gcrypt") + (lib.withFeatureAs useAirpcap "airpcap" airpcap-sdk) + ]; + nativeBuildInputs = [ pkg-config makeWrapper autoreconfHook ]; - buildInputs = [ libpcap openssl zlib libnl iw ethtool pciutils ]; + buildInputs = + lib.singleton (if useGcrypt then libgcrypt else openssl) + ++ lib.optionals stdenv.isLinux [ libpcap zlib libnl iw ethtool pciutils ] + ++ lib.optional (stdenv.isCygwin && stdenv.isClang) libiconv + ++ lib.optional enableAirolib sqlite + ++ lib.optional enableRegex pcre2 + ++ lib.optional useAirpcap airpcap-sdk; - patchPhase = '' - sed -e 's@/usr/local/bin@'${wirelesstools}@ -i lib/osdep/linux.c - ''; + nativeCheckInputs = [ cmocka expect ]; - postFixup = '' - wrapProgram $out/bin/airmon-ng --prefix PATH : ${lib.makeBinPath [ - ethtool iw pciutils usbutils - ]} + postFixup = lib.optionalString stdenv.isLinux '' + wrapProgram "$out/bin/airmon-ng" --prefix PATH : ${lib.escapeShellArg (lib.makeBinPath [ + ethtool + iw + pciutils + usbutils + ])} ''; - meta = with lib; { - description = "Wireless encryption cracking tools"; - homepage = "http://www.aircrack-ng.org/"; - license = licenses.gpl2Plus; - maintainers = with maintainers; [ ]; - platforms = platforms.linux; + installCheckTarget = "integration"; + nativeInstallCheckInputs = [ cmocka expect ] ++ lib.optionals stdenv.isLinux [ tcpdump hostapd wpa_supplicant screen ]; + + meta = { + description = "WiFi security auditing tools suite"; + homepage = "https://www.aircrack-ng.org/"; + license = lib.licenses.gpl2Plus; + maintainers = with lib.maintainers; [ caralice ]; + platforms = with lib.platforms; builtins.concatLists [ linux darwin cygwin netbsd openbsd freebsd illumos ]; + changelog = "https://github.com/aircrack-ng/aircrack-ng/blob/${src.rev}/ChangeLog"; }; }