summaryrefslogtreecommitdiffstats
path: root/meta/recipes-connectivity/wpa-supplicant/wpa-supplicant/0013-EAP-pwd-client-Verify-received-scalar-and-element.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-connectivity/wpa-supplicant/wpa-supplicant/0013-EAP-pwd-client-Verify-received-scalar-and-element.patch')
-rw-r--r--meta/recipes-connectivity/wpa-supplicant/wpa-supplicant/0013-EAP-pwd-client-Verify-received-scalar-and-element.patch61
1 files changed, 61 insertions, 0 deletions
diff --git a/meta/recipes-connectivity/wpa-supplicant/wpa-supplicant/0013-EAP-pwd-client-Verify-received-scalar-and-element.patch b/meta/recipes-connectivity/wpa-supplicant/wpa-supplicant/0013-EAP-pwd-client-Verify-received-scalar-and-element.patch
new file mode 100644
index 0000000000..c6e61cb803
--- /dev/null
+++ b/meta/recipes-connectivity/wpa-supplicant/wpa-supplicant/0013-EAP-pwd-client-Verify-received-scalar-and-element.patch
@@ -0,0 +1,61 @@
1From 8ad8585f91823ddcc3728155e288e0f9f872e31a Mon Sep 17 00:00:00 2001
2From: Mathy Vanhoef <mathy.vanhoef@nyu.edu>
3Date: Sun, 31 Mar 2019 17:43:44 +0200
4Subject: [PATCH 13/14] EAP-pwd client: Verify received scalar and element
5
6When processing an EAP-pwd Commit frame, the server's scalar and element
7(elliptic curve point) were not validated. This allowed an adversary to
8bypass authentication, and act as a rogue Access Point (AP) if the
9crypto implementation did not verify the validity of the EC point.
10
11Fix this vulnerability by assuring the received scalar lies within the
12valid range, and by checking that the received element is not the point
13at infinity and lies on the elliptic curve being used. (CVE-2019-9499)
14
15The vulnerability is only exploitable if OpenSSL version 1.0.2 or lower
16is used, or if LibreSSL or wolfssl is used. Newer versions of OpenSSL
17(and also BoringSSL) implicitly validate the elliptic curve point in
18EC_POINT_set_affine_coordinates_GFp(), preventing the attack.
19
20Signed-off-by: Mathy Vanhoef <mathy.vanhoef@nyu.edu>
21Signed-off-by: Adrian Bunk <bunk@stusta.de>
22Upstream-Status: Backport
23CVE: CVE-2019-9499
24---
25 src/eap_peer/eap_pwd.c | 20 ++++++++++++++++++++
26 1 file changed, 20 insertions(+)
27
28diff --git a/src/eap_peer/eap_pwd.c b/src/eap_peer/eap_pwd.c
29index 761c16a..5a05e54 100644
30--- a/src/eap_peer/eap_pwd.c
31+++ b/src/eap_peer/eap_pwd.c
32@@ -594,6 +594,26 @@ eap_pwd_perform_commit_exchange(struct eap_sm *sm, struct eap_pwd_data *data,
33 goto fin;
34 }
35
36+ /* verify received scalar */
37+ if (crypto_bignum_is_zero(data->server_scalar) ||
38+ crypto_bignum_is_one(data->server_scalar) ||
39+ crypto_bignum_cmp(data->server_scalar,
40+ crypto_ec_get_order(data->grp->group)) >= 0) {
41+ wpa_printf(MSG_INFO,
42+ "EAP-PWD (peer): received scalar is invalid");
43+ goto fin;
44+ }
45+
46+ /* verify received element */
47+ if (!crypto_ec_point_is_on_curve(data->grp->group,
48+ data->server_element) ||
49+ crypto_ec_point_is_at_infinity(data->grp->group,
50+ data->server_element)) {
51+ wpa_printf(MSG_INFO,
52+ "EAP-PWD (peer): received element is invalid");
53+ goto fin;
54+ }
55+
56 /* check to ensure server's element is not in a small sub-group */
57 if (!crypto_bignum_is_one(cofactor)) {
58 if (crypto_ec_point_mul(data->grp->group, data->server_element,
59--
602.7.4
61