Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 1 | SUMMARY = "Client for Wi-Fi Protected Access (WPA)" |
| 2 | HOMEPAGE = "http://w1.fi/wpa_supplicant/" |
| 3 | BUGTRACKER = "http://w1.fi/security/" |
| 4 | SECTION = "network" |
| 5 | LICENSE = "BSD" |
| 6 | LIC_FILES_CHKSUM = "file://COPYING;md5=292eece3f2ebbaa25608eed8464018a3 \ |
| 7 | file://README;beginline=1;endline=56;md5=3f01d778be8f953962388307ee38ed2b \ |
| 8 | file://wpa_supplicant/wpa_supplicant.c;beginline=1;endline=12;md5=4061612fc5715696134e3baf933e8aba" |
| 9 | DEPENDS = "dbus libnl" |
| 10 | RRECOMMENDS_${PN} = "wpa-supplicant-passphrase wpa-supplicant-cli" |
| 11 | |
| 12 | PACKAGECONFIG ??= "gnutls" |
| 13 | PACKAGECONFIG[gnutls] = ",,gnutls libgcrypt" |
| 14 | PACKAGECONFIG[openssl] = ",,openssl" |
| 15 | |
| 16 | inherit pkgconfig systemd |
| 17 | |
| 18 | SYSTEMD_SERVICE_${PN} = "wpa_supplicant.service wpa_supplicant-nl80211@.service wpa_supplicant-wired@.service" |
| 19 | SYSTEMD_AUTO_ENABLE = "disable" |
| 20 | |
| 21 | SRC_URI = "http://w1.fi/releases/wpa_supplicant-${PV}.tar.gz \ |
| 22 | file://defconfig \ |
| 23 | file://wpa-supplicant.sh \ |
| 24 | file://wpa_supplicant.conf \ |
| 25 | file://wpa_supplicant.conf-sane \ |
| 26 | file://99_wpa_supplicant \ |
Brad Bishop | d5ae7d9 | 2018-06-14 09:52:03 -0700 | [diff] [blame] | 27 | file://key-replay-cve-multiple1.patch \ |
| 28 | file://key-replay-cve-multiple2.patch \ |
| 29 | file://key-replay-cve-multiple3.patch \ |
| 30 | file://key-replay-cve-multiple4.patch \ |
| 31 | file://key-replay-cve-multiple5.patch \ |
| 32 | file://key-replay-cve-multiple6.patch \ |
| 33 | file://key-replay-cve-multiple7.patch \ |
| 34 | file://key-replay-cve-multiple8.patch \ |
Brad Bishop | bba38f3 | 2018-08-23 16:11:46 +0800 | [diff] [blame] | 35 | file://wpa_supplicant-CVE-2018-14526.patch \ |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 36 | " |
| 37 | SRC_URI[md5sum] = "091569eb4440b7d7f2b4276dbfc03c3c" |
| 38 | SRC_URI[sha256sum] = "b4936d34c4e6cdd44954beba74296d964bc2c9668ecaa5255e499636fe2b1450" |
| 39 | |
| 40 | CVE_PRODUCT = "wpa_supplicant" |
| 41 | |
| 42 | S = "${WORKDIR}/wpa_supplicant-${PV}" |
| 43 | |
| 44 | PACKAGES_prepend = "wpa-supplicant-passphrase wpa-supplicant-cli " |
| 45 | FILES_wpa-supplicant-passphrase = "${bindir}/wpa_passphrase" |
| 46 | FILES_wpa-supplicant-cli = "${sbindir}/wpa_cli" |
| 47 | FILES_${PN} += "${datadir}/dbus-1/system-services/*" |
| 48 | CONFFILES_${PN} += "${sysconfdir}/wpa_supplicant.conf" |
| 49 | |
| 50 | do_configure () { |
| 51 | ${MAKE} -C wpa_supplicant clean |
| 52 | install -m 0755 ${WORKDIR}/defconfig wpa_supplicant/.config |
| 53 | echo "CFLAGS +=\"-I${STAGING_INCDIR}/libnl3\"" >> wpa_supplicant/.config |
| 54 | echo "DRV_CFLAGS +=\"-I${STAGING_INCDIR}/libnl3\"" >> wpa_supplicant/.config |
| 55 | |
| 56 | if echo "${PACKAGECONFIG}" | grep -qw "openssl"; then |
| 57 | ssl=openssl |
| 58 | elif echo "${PACKAGECONFIG}" | grep -qw "gnutls"; then |
| 59 | ssl=gnutls |
| 60 | fi |
| 61 | if [ -n "$ssl" ]; then |
| 62 | sed -i "s/%ssl%/$ssl/" wpa_supplicant/.config |
| 63 | fi |
| 64 | |
| 65 | # For rebuild |
| 66 | rm -f wpa_supplicant/*.d wpa_supplicant/dbus/*.d |
| 67 | } |
| 68 | |
| 69 | export EXTRA_CFLAGS = "${CFLAGS}" |
| 70 | export BINDIR = "${sbindir}" |
| 71 | |
| 72 | do_compile () { |
| 73 | unset CFLAGS CPPFLAGS CXXFLAGS |
| 74 | sed -e "s:CFLAGS\ =.*:& \$(EXTRA_CFLAGS):g" -i ${S}/src/lib.rules |
| 75 | oe_runmake -C wpa_supplicant |
| 76 | } |
| 77 | |
| 78 | do_install () { |
| 79 | install -d ${D}${sbindir} |
| 80 | install -m 755 wpa_supplicant/wpa_supplicant ${D}${sbindir} |
| 81 | install -m 755 wpa_supplicant/wpa_cli ${D}${sbindir} |
| 82 | |
| 83 | install -d ${D}${bindir} |
| 84 | install -m 755 wpa_supplicant/wpa_passphrase ${D}${bindir} |
| 85 | |
| 86 | install -d ${D}${docdir}/wpa_supplicant |
| 87 | install -m 644 wpa_supplicant/README ${WORKDIR}/wpa_supplicant.conf ${D}${docdir}/wpa_supplicant |
| 88 | |
| 89 | install -d ${D}${sysconfdir} |
| 90 | install -m 600 ${WORKDIR}/wpa_supplicant.conf-sane ${D}${sysconfdir}/wpa_supplicant.conf |
| 91 | |
| 92 | install -d ${D}${sysconfdir}/network/if-pre-up.d/ |
| 93 | install -d ${D}${sysconfdir}/network/if-post-down.d/ |
| 94 | install -d ${D}${sysconfdir}/network/if-down.d/ |
| 95 | install -m 755 ${WORKDIR}/wpa-supplicant.sh ${D}${sysconfdir}/network/if-pre-up.d/wpa-supplicant |
| 96 | cd ${D}${sysconfdir}/network/ && \ |
| 97 | ln -sf ../if-pre-up.d/wpa-supplicant if-post-down.d/wpa-supplicant |
| 98 | |
| 99 | install -d ${D}/${sysconfdir}/dbus-1/system.d |
| 100 | install -m 644 ${S}/wpa_supplicant/dbus/dbus-wpa_supplicant.conf ${D}/${sysconfdir}/dbus-1/system.d |
| 101 | install -d ${D}/${datadir}/dbus-1/system-services |
| 102 | install -m 644 ${S}/wpa_supplicant/dbus/*.service ${D}/${datadir}/dbus-1/system-services |
| 103 | |
| 104 | if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then |
| 105 | install -d ${D}/${systemd_unitdir}/system |
| 106 | install -m 644 ${S}/wpa_supplicant/systemd/*.service ${D}/${systemd_unitdir}/system |
| 107 | fi |
| 108 | |
| 109 | install -d ${D}/etc/default/volatiles |
| 110 | install -m 0644 ${WORKDIR}/99_wpa_supplicant ${D}/etc/default/volatiles |
| 111 | } |
| 112 | |
| 113 | pkg_postinst_wpa-supplicant () { |
| 114 | # If we're offline, we don't need to do this. |
| 115 | if [ "x$D" = "x" ]; then |
| 116 | killall -q -HUP dbus-daemon || true |
| 117 | fi |
| 118 | |
| 119 | } |