From 26c88bf3ebcade64e8fe7693da89d9c2d298d90d Mon Sep 17 00:00:00 2001 From: Alexander Vickberg Date: Mon, 17 May 2021 18:03:48 +0200 Subject: hostapd: fix building with CONFIG_TLS=internal The patch recently added for CVE-2021-30004 broke compilation with CONFIG_TLS=internal. This adds the necessary function to let it compile again. Signed-off-by: Alexander Vickberg Signed-off-by: Khem Raj (cherry picked from commit d6ef4170747d6668fa940328334055eef3e1e1d6) Signed-off-by: Armin Kuster --- .../0001-Prepare-for-CVE-2021-30004.patch.patch | 45 ++++++++++++++++++++++ .../recipes-connectivity/hostapd/hostapd_2.9.bb | 1 + 2 files changed, 46 insertions(+) create mode 100644 meta-oe/recipes-connectivity/hostapd/hostapd/0001-Prepare-for-CVE-2021-30004.patch.patch diff --git a/meta-oe/recipes-connectivity/hostapd/hostapd/0001-Prepare-for-CVE-2021-30004.patch.patch b/meta-oe/recipes-connectivity/hostapd/hostapd/0001-Prepare-for-CVE-2021-30004.patch.patch new file mode 100644 index 0000000000..1bedb4f753 --- /dev/null +++ b/meta-oe/recipes-connectivity/hostapd/hostapd/0001-Prepare-for-CVE-2021-30004.patch.patch @@ -0,0 +1,45 @@ +From 14fab0772db19297c82dd1b8612c9335369dce41 Mon Sep 17 00:00:00 2001 +From: Alexander Vickberg +Date: Mon, 17 May 2021 17:54:13 +0200 +Subject: [PATCH] Prepare for CVE-2021-30004.patch + +Without this building fails for CONFIG_TLS=internal + +Signed-off-by: Alexander Vickberg +--- + src/tls/asn1.h | 6 ++++++ + src/utils/includes.h | 1 + + 2 files changed, 7 insertions(+) + +diff --git a/src/tls/asn1.h b/src/tls/asn1.h +index 6bd7df5..77b94ef 100644 +--- a/src/tls/asn1.h ++++ b/src/tls/asn1.h +@@ -66,6 +66,12 @@ void asn1_oid_to_str(const struct asn1_oid *oid, char *buf, size_t len); + unsigned long asn1_bit_string_to_long(const u8 *buf, size_t len); + int asn1_oid_equal(const struct asn1_oid *a, const struct asn1_oid *b); + ++static inline bool asn1_is_null(const struct asn1_hdr *hdr) ++{ ++ return hdr->class == ASN1_CLASS_UNIVERSAL && ++ hdr->tag == ASN1_TAG_NULL; ++} ++ + extern struct asn1_oid asn1_sha1_oid; + extern struct asn1_oid asn1_sha256_oid; + +diff --git a/src/utils/includes.h b/src/utils/includes.h +index 75513fc..741fc9c 100644 +--- a/src/utils/includes.h ++++ b/src/utils/includes.h +@@ -18,6 +18,7 @@ + + #include + #include ++#include + #include + #include + #include +-- +2.25.1 + diff --git a/meta-oe/recipes-connectivity/hostapd/hostapd_2.9.bb b/meta-oe/recipes-connectivity/hostapd/hostapd_2.9.bb index e586018685..a9780bc6db 100644 --- a/meta-oe/recipes-connectivity/hostapd/hostapd_2.9.bb +++ b/meta-oe/recipes-connectivity/hostapd/hostapd_2.9.bb @@ -11,6 +11,7 @@ SRC_URI = " \ file://defconfig \ file://init \ file://hostapd.service \ + file://0001-Prepare-for-CVE-2021-30004.patch.patch \ file://CVE-2019-16275.patch \ file://CVE-2019-5061.patch \ file://CVE-2021-0326.patch \ -- cgit 1.2.3-korg